943,822 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Dec 20th, 2006
0

Object Oriented Programming

Expand Post »
Hello everyone.

What are the disadvantages/shortcomings of object oriented Programming?:eek:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sosina abraha is offline Offline
2 posts
since Dec 2006
Dec 20th, 2006
0

Re: Object Oriented Programming

Hello everyone.

What are the disadvantages/shortcomings of object oriented Programming?:eek:

Google provided a ton of results..... here is just the first hit:

http://wiki.tcl.tk/13398
Reputation Points: 25
Solved Threads: 3
Junior Poster in Training
TylerSBreton is offline Offline
89 posts
since Oct 2006
Jan 22nd, 2007
0

Re: Object Oriented Programming

@ TylerSBrenton: If (s)he asked, you should at least have the common curtosey to provide an answer that isn't a google result.

@ sosina abraha:
There are two branches of programming: functional, and object-oriented. Functional languages leave the entire language at your disposal without having to import other "classes". The problem that arises with functional languages, is that you end up re-typing out code again and again. For instance, let's say you're creating a program that requires networking protocols like TCP/IP and HTTP. So, you spend the time writing the program, and it works perfectly. Now, you go to write another program, some time later, and you require the TCP/IP and HTTP protocols this time. You are going to find yourself re-typing or copy-and-pasting the code from the old program - this can prove to be time consuming, and perhaps even cause big errors in the code. Also note, most functional languages, are scripting languages.

Now, with Object Oriented Programming approaches code importing a little differently. In Java, let's say, you have the option to just use the standard code base, which can keep small programs neat and tidy. But for larger applications, it starts turning into a functional approach to things - and not to mention, some things in Java just aren't possible without importing some classes. Object-Oriented Languages make use of "objects", "classes", "inheritance"...things like that. A class is an object definition, and an object is a creatable/destroyable instance of a class - it's a roundabout definition, but it's the best I can do for the moment. Inheritance allows other classes to keep their inherent functions (or, as Java-heads call them, "methods"), and expand on the number of methods available to the user through that one class.

For more on this, Wikipedia is always a good reference, and if you would like to get into Object-Oriented Programming, Java would be a good place to start - it teaches you what you need to know about OOP, and without the complexities of operator overloading and pre-processor calls inherent in C++.
Last edited by indienick; Jan 22nd, 2007 at 3:37 pm.
Reputation Points: 23
Solved Threads: 2
Junior Poster in Training
indienick is offline Offline
71 posts
since Aug 2005
Jan 22nd, 2007
0

Re: Object Oriented Programming

Click to Expand / Collapse  Quote originally posted by indienick ...
There are two branches of programming: functional, and object-oriented. Functional languages leave the entire language at your disposal without having to import other "classes". The problem that arises with functional languages, is that you end up re-typing out code again and again. For instance, let's say you're creating a program that requires networking protocols like TCP/IP and HTTP. So, you spend the time writing the program, and it works perfectly. Now, you go to write another program, some time later, and you require the TCP/IP and HTTP protocols this time. You are going to find yourself re-typing or copy-and-pasting the code from the old program - this can prove to be time consuming, and perhaps even cause big errors in the code.
That's why we have libraries...

Quote ...
Now, with Object Oriented Programming approaches code importing a little differently. In Java, let's say, you have the option to just use the standard code base, which can keep small programs neat and tidy. But for larger applications, it starts turning into a functional approach to things - and not to mention, some things in Java just aren't possible without importing some classes. Object-Oriented Languages make use of "objects", "classes", "inheritance"...things like that. A class is an object definition, and an object is a creatable/destroyable instance of a class - it's a roundabout definition, but it's the best I can do for the moment. Inheritance allows other classes to keep their inherent functions (or, as Java-heads call them, "methods"), and expand on the number of methods available to the user through that one class.
Or... not. You've sort of described how the language works, but not really touched on why that's important. Object oriented languages (e.g. Java, Smalltalk) provide a way of modeling an environment as a set of objects and methods detailing how the objects interact. There are also ways of representing an objects relation to another (e.g. the stuff about inheritance). As the project grows, the code should not become more functional; it might use many methods, but that's not the same as being functional. Procedural programming (e.g. C), allows you to define a set of procedures (or functions) and run them in a specific order. Some people might make the argument that OOP style is possible in C, but it's messy. Functional programming langauges (e.g. Lisp, Haskell) usually have very terse solutions to problems, but as they usually are non-imperative (i.e. lack side effects such as variable state), they aren't very popular for programs that have to retain state.

Quote ...
For more on this, Wikipedia is always a good reference, and if you would like to get into Object-Oriented Programming, Java would be a good place to start - it teaches you what you need to know about OOP, and without the complexities of operator overloading and pre-processor calls inherent in C++.
Complexities of operator overloading and pre-processor calls? :lol:

You might also consider Python, Ruby, or Smalltalk if you're wanting to try an OO language. Java is widely used, but it's certainly not the flagship language for the OO paradigm...
Reputation Points: 683
Solved Threads: 53
Posting Virtuoso
Infarction is offline Offline
1,580 posts
since May 2006
Jan 22nd, 2007
0

Re: Object Oriented Programming

Click to Expand / Collapse  Quote originally posted by indienick ...
@ sosina abraha:
There are two branches of programming: functional, and object-oriented.
What about Logical (Prolog) and Procedural (C/Fortran)
Last edited by TylerSBreton; Jan 22nd, 2007 at 4:26 pm.
Reputation Points: 25
Solved Threads: 3
Junior Poster in Training
TylerSBreton is offline Offline
89 posts
since Oct 2006
Jan 22nd, 2007
0

Re: Object Oriented Programming

From the way I was tought things, function programming is synonymous with procedural programming.

As for the "complexities" of operator overloading and pre-processor commands, I consider those complexities, because if you overload an operator, and you are developing a large application, the operator overloading can be lost in the lines, and become a serious source of frustration - something I've experienced in the past, and which has led me to keep away from C and C++. As for pre-processor commands, I just don't see a point for them aside from incorporating header files.

I'm a Lisp (primarily), Python, Perl, Java, BASIC, Expect and shell programmer by trade, and am learning Linux-based x86 assembly - all languages which have no imminent focus on pre-processor calls.

I know I didn't provide a complete definition of Object-Oriented Programming, but I got the ball rolling, and provided the OP with a direct link to information (Wikipedia), instead of just a "just google it" response.

Quote ...
Functional programming langauges (e.g. Lisp...
Lisp is object-oriented, but not forcefully object-oriented, like Java. :cheesy: Not to mention, Lisp prides itself on not locking itself down to one solution per problem.
Last edited by indienick; Jan 22nd, 2007 at 7:32 pm.
Reputation Points: 23
Solved Threads: 2
Junior Poster in Training
indienick is offline Offline
71 posts
since Aug 2005
Jan 22nd, 2007
0

Re: Object Oriented Programming

Click to Expand / Collapse  Quote originally posted by indienick ...
From the way I was tought things, function programming is synonymous with procedural programming.
You were taught wrong. From wikipedia:
Quote originally posted by Wikipedia ...
Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes the application of functions, in contrast with imperative programming, which emphasizes changes in state and the execution of sequential commands.[1]
The articles on procedural and imperative programming have notes mentioning that the two terms are mostly interchangeable.

Quote ...
As for the "complexities" of operator overloading and pre-processor commands, I consider those complexities, because if you overload an operator, and you are developing a large application, the operator overloading can be lost in the lines, and become a serious source of frustration - something I've experienced in the past, and which has led me to keep away from C and C++. As for pre-processor commands, I just don't see a point for them aside from incorporating header files.
Operator overloading is one of the things I wish Java had. Of course, there is a matter of when it's appropriate to use operator overloading. As to pre-processor commands, they definitely have a point if you know what they do.

Quote ...
I'm a Lisp (primarily), Python, Perl, Java, BASIC, Expect and shell programmer by trade, and am learning Linux-based x86 assembly - all languages which have no imminent focus on pre-processor calls.
Congrats on your trade. Hopefully your OS-specific assembly will get you far. The pre-processor calls from C(++) are compiler functions, before the code actually gets translated to machine code.

Quote ...
I know I didn't provide a complete definition of Object-Oriented Programming, but I got the ball rolling, and provided the OP with a direct link to information (Wikipedia), instead of just a "just google it" response.
You gave a basic explanation in terms of a small subset of keywords typically associated with OOP. You didn't actually answer the OP's question (admittedly, I didn't either).

Quote ...
Lisp is object-oriented, but not forcefully object-oriented, like Java. :cheesy: Not to mention, Lisp prides itself on not locking itself down to one solution per problem.
Lisp is better known as a functional language. While it might support objects, I don't know that it's really OO (see my previous statement about C). Only used it a very small amount though, so I could be wrong.

@OP: Sorry for the hijacking. As to your question, the drawbacks from OOP typically relate to system design, when an OO model doesn't match your data organization. There might also be issues if you need low level code, such as a kernel, since an OO model is done at a level with the hardware abstracted away.
Reputation Points: 683
Solved Threads: 53
Posting Virtuoso
Infarction is offline Offline
1,580 posts
since May 2006
Jan 22nd, 2007
0

Re: Object Oriented Programming

Lisp can be used very much like a OO language, just as C can be used like a Functional language with the correct libraries. But the framework and libraries included are Functional for Lisp and Procedural for C and the languages (as I would assume) are grouped according to to the norm.

Regards,

Tyler S. Breton
Reputation Points: 25
Solved Threads: 3
Junior Poster in Training
TylerSBreton is offline Offline
89 posts
since Oct 2006
Jan 23rd, 2007
0

Re: Object Oriented Programming

Types of programming paradigms (note I am not saying types of Programming languages):
  • Imperative - C, Ada, Pascal, Modula 2
  • Functional - LISP, FP
  • Aggregate - SQL, Mathematica
  • Concurrent - SR, Lynx
  • Dataflow language - Val, Sisal, Post
  • Declarative - Prolog, Godel
  • Object Oriented - C++, Java, C#
Quote originally posted by indienick ...
Functional languages leave the entire language at your disposal without having to import other "classes". The problem that arises with functional languages, is that you end up re-typing out code again and again.
You can always use packages...
Quote originally posted by indienick ...
Lisp is object-oriented
Object oriented and Funtional programming are two different paradigms altogether. Saying LISP is object oriented would be completely wrong.

One of the disadvantages of Object Oriented programming I can think of is clubbing the program to death by overusing the abstraction mechanism. As said by someone "Object oriented programming is actually writing simple programs the complicated way."
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Jan 23rd, 2007
1

Re: Object Oriented Programming

Lisp certainly is object oriented, if that's what you want. With Lisp's macros and lexical scoping, you can do anything. Common Lisp was the first ANSI-standardized object oriented language, ever.

Common Lisp is not really a 'functional' programming language, it's a language that lets you program the way you want. It has variables that you may modify -- that are mutable -- so you can use it in a brain-dead manner the way you would use C. You could also choose not to modify your variables, and you have lexical scoping, which means you can use it in a functional manner. Scheme is better at that, though, since CL is kind of weird with its 'apply' and whatnot. Lisp certainly is better for object oriented programming than, say, C++ or Java, in the general sense.

The best language for programs that need to retain state, though, is Haskell, IMO. No other language handles state transformation in a better way. None that I've heard of.

Object orientedness is really about having objects pass messages to one another. The purpose of inheritance in languages like C++ is to allow for a form of dynamic typing. Object oriented is really a subset of what Lisp offers, since an object is nothing more than a function that takes some finite enumeration of method names as its first argument, along with a list of further arguments. Common Lisp has more explicit object orientation, with classes and the like.
Last edited by Rashakil Fol; Jan 23rd, 2007 at 9:06 pm.
Team Colleague
Reputation Points: 1135
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: Lisp Programming defparameter
Next Thread in Computer Science Forum Timeline: Final Year Project! Please help!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC