Page 1 of 5 [ 67 posts ]  Go to page 1, 2, 3, 4, 5  Next

Aspie_Chav
Veteran
Veteran

User avatar

Joined: 6 Feb 2006
Age: 51
Gender: Male
Posts: 2,931
Location: Croydon

19 Mar 2007, 5:55 pm

I have always new this because I told me it.
Now I have found this site to back it up.

http://www.geocities.com/tablizer/oopbad.htm



ahayes
Veteran
Veteran

User avatar

Joined: 2 Dec 2006
Gender: Male
Posts: 9,506

19 Mar 2007, 6:00 pm

I love C++, it's like having structors you can give orders to. You can do whatever programming you want, as long as you don't force it on me and I don't have to read your mess of a program at any point in time.



TheMachine1
Veteran
Veteran

User avatar

Joined: 11 Jun 2006
Gender: Male
Posts: 8,011
Location: 9099 will be my last post...what the hell 9011 will be.

19 Mar 2007, 6:39 pm

No question its a myth OOP makes programming more visual. I tend to think very visual
and an "action"/process is for more visualizable to me than an object.

I wrote only one OOP program to do skin dection in images. I wrote it years before in C
as structured action OP. But to translate it in to objects made little since. Most the objects were non-visualizable abstract things :)



Kosmonaut
Veteran
Veteran

User avatar

Joined: 14 Sep 2006
Gender: Male
Posts: 2,253

19 Mar 2007, 7:00 pm

Yes, it was a relatively new thing when i was working in the field.
Most computer programmers held it in high regard; i never saw the appeal.
I have a background in mathematics and tend to see things in terms of functions.
The programmers seemed to like the OO design, i just found it more confusing; rather counter-productive.
The company sent me on OOP course: a waste of money, i started using MATLAB afterwards.
Far superior for research.



TheMachine1
Veteran
Veteran

User avatar

Joined: 11 Jun 2006
Gender: Male
Posts: 8,011
Location: 9099 will be my last post...what the hell 9011 will be.

19 Mar 2007, 7:07 pm

Kosmonaut wrote:
i started using MATLAB afterwards.
Far superior for research.


My skin detection program was merely my C translation of MATLAB code that did the same thing.



chadders
Deinonychus
Deinonychus

User avatar

Joined: 3 Dec 2006
Gender: Male
Posts: 354

20 Mar 2007, 12:31 am

Once you have tried other programming styles (if that's the right word) such as Functional Programming you will learn to appreciate OOP. Not that Functional Programming is bad, but it's very different to OOP.


_________________
- Chadders

That's my two pence worth.


Xuincherguixe
Veteran
Veteran

User avatar

Joined: 9 May 2006
Gender: Male
Posts: 1,448
Location: Victoria, BC

20 Mar 2007, 3:39 am

Object Oriented programming is not the answer to everything, but there are good reasons for it's use.

Good OO techniques can reduce the length of time to develop software, and make it easier to find bugs. The key here is good techniques.


_________________
I don't think you get it


calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

20 Mar 2007, 6:31 am

There is little reason NOT to use OO techniques. They are prevalent, and well understood. Still, I think that my school is teaching them too soon. All comes of teaching in Java instead of C++.



hyperbolic
Veteran
Veteran

User avatar

Joined: 14 Aug 2006
Gender: Male
Posts: 1,869

20 Mar 2007, 1:24 pm

Your project has to conform to the OOP structure of the programming language you are using. OOP doesn't exactly conform to my thinking style. I prefer to spit out code, especially in a scripting language, like I would jot down something on a sticky note. This backs up this statement from the website. . .

Quote:
Ironically, OOP is sometimes billed as "better fitting the way people think". Years of meditation and study to learn how to "think naturally"??? I am thinking of setting up a $70-per-hour consultancy to teach football fans how to drink beer and belch in order to "optimize their natural recreational satisfaction".


But after my first C++ class (CS121) I have seen OOP as a necessary short term hurdle to prevent greater difficulties down the road. In CS121 we used objects for both GUI elements and the innards of our commandline programs. OOP does seem to help you keep your project better organized. For large projects that are hard to maintain, and especially projects that will be in use over a long period of time, this is very important.

Also, dealing with strings in OO C++ is way easier than dealing with string in C, once you've figured it out.

Maybe someone could come up with a way to keep organized functional/relational programming projects through a Google-like search algorithm or visual representations on a three-dimensional flow chart that doesn't rely entirely on the OOP paradigm.



Aspie_Chav
Veteran
Veteran

User avatar

Joined: 6 Feb 2006
Age: 51
Gender: Male
Posts: 2,931
Location: Croydon

21 Mar 2007, 2:27 am

Thinking about procedurel programming people think of C. C is a crappy language. Nobody mentioned Python.

One of the problem with OOP is sometime if you want to work on an class you find that it is attached to another class so you have to learn that class also. I have had this problem when starting a opensourse project where to learn what a section of code does, I have to learn what the whole class does and all it's attachements.

Shouldn't a programmer strive to make each of the fuctions indepenent testable like

>>> duplicate("hello world,",2)
hello world,hello world

Another problem is OOP objects contain mini globel veriables in them. While functional programming especially in programming languages like Lisp do not use globals as much as OOP.



chadders
Deinonychus
Deinonychus

User avatar

Joined: 3 Dec 2006
Gender: Male
Posts: 354

21 Mar 2007, 3:14 am

As a general rule it's not really a good idea to have Global variables in any language (Spite the fact that some permit it).


_________________
- Chadders

That's my two pence worth.


calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

21 Mar 2007, 4:28 am

Global's are sometimes necessary in some languages.

Python rocks - but it has OO features. Part of why it is
so good now.

The advantage of the OO style is that you can compartmentalize
better than you can without it. I don't see how mere project management
strategies are going to give you that power - unless you start hooking
code together with scripting glue. But then your objects become programs,
and you're not really gaining anything.



timseal
Emu Egg
Emu Egg

User avatar

Joined: 9 Dec 2006
Gender: Male
Posts: 2

21 Mar 2007, 1:33 pm

OO is helpful because you can bind code to data to make an object. You can also have the code vary a bit if the data and/or situation changes. Functional programming gives you this too, only backwards (passing functions around as data). From what I can tell, the functional way is more powerful and leads to cleaner code. The main problem with OO is that is can be a religion, Java being the priests' favourite language.
In Python you can program in any style, procedural, OO or functional.

tim



jfberge
Veteran
Veteran

User avatar

Joined: 4 Mar 2007
Age: 51
Gender: Male
Posts: 506
Location: Cell block B, #9

21 Mar 2007, 2:05 pm

I like the concept of classes and objects, but I've never really encountered a compelling reason to use polymorphism. If I want common functionality, I'll use an interface. Trying to force common functionality into a base class doesn't seem worth the time and interdependence.

I also find it cumbersome to ensure that all classes are isolated - that they don't rely on specific functionality of other classes, or global variables. Some resources are essentially global, like database access classes, and making them available as a singleton is simpler than passing references of a particular instance to everything. It's also much easier to pass objects as arguments than breaking out all the value type properties as individual arguments. So class A knows about class B. Who cares?

Of course, I don't work in a large group of coders, so no one else has to deal with my code. A lot of convention is about making modular, standardized code.



calandale
Veteran
Veteran

User avatar

Joined: 9 Mar 2007
Gender: Male
Posts: 12,439

21 Mar 2007, 5:13 pm

timseal wrote:
OO is helpful because you can bind code to data to make an object. You can also have the code vary a bit if the data and/or situation changes. Functional programming gives you this too, only backwards (passing functions around as data). From what I can tell, the functional way is more powerful and leads to cleaner code. The main problem with OO is that is can be a religion, Java being the priests' favourite language.
In Python you can program in any style, procedural, OO or functional.

tim


Neither is more powerful. In any powerful language (not java) functions are first class objects, and can be passed. Even C# allows this through delegates. You can program in any style in C++ too; you don't need OO. In fact, the templates give a whole new kind of OO, which is IMHO much more powerful than anything I've seen anywhere. I understand C# has real templates as well, but I haven't touched it in a few years, so I can't really give a good assessment.

jfb - Polymorphism has it's advantages. You can treat objects as though they are the same. The State pattern comes to mind as a very useful way to use polymorphism. Sure, you can use an enum, and embed the state dependent behavior right in your class, but the code looks a lot cleaner when it is seperated by the state itself.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 76
Gender: Male
Posts: 9,795
Location: Somerset UK

21 Mar 2007, 8:05 pm

Aspie_Chav wrote:
I have always new this because I told me it.
Now I have found this site to back it up.

http://www.geocities.com/tablizer/oopbad.htm

What a strange site. The guy there doesn't like OO. Hasn't bothered to learn OO. Seems to like spreadsheets, and thinks that's programming. I'll admit I didn't read much of it, because it was too bigoted for me.

Personally, I use (creaky, old, ambiguous) C for quickies. C# for serious code (because I can write code which reflects the algorithms in my mind).

Horses for courses. One of the best languages ever was (is) Forth. Basic has its uses. Lisp. Even Cobol, Fortran and RPG. APL has its moments.

Java was a good idea, and would have been brilliant, if Sun hadn't sat it it all this time.

I hated C++, with its pathetic messy approach. (I'd already used Pascal... which spoilt it for me).

Can't say I've ever got enthusiastic about Perl, PHP, Ruby, Python, Boo. All much of a muchness.

That's at the moment. When the next language come along, I'll look at that.

PS. Mustn't forget INTERCAL. Every programmer should be confident that they could write a program in INTERCAL - otherwise they're not really a programmer. See the INTERCAL Reference Manual, in particular, the sample program.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer