Old 1st February 2007, 16:25   #1
Triton4
Major Dude
 
Join Date: Feb 2003
Location: CA
Posts: 1,307
For those of you in the software field

Object Oriented Programming (vs) Procedural Programming

I think that Procedural Programming is the most efficient methodology of coding (perfectly operational, negligible amount of bugs and errors), whereas object-oriented programming is more practical (good-looking, easier to code & saves time).

Don't you agree?
Triton4 is offline   Reply With Quote
Old 1st February 2007, 16:33   #2
mikm
Major Dude
 
mikm's Avatar
 
Join Date: May 2001
Location: somewhere else
Posts: 1,255
I don't see why procedural coding would produce significantly less bugs than object-oriented.

powered by C₂H₅OH
mikm is offline   Reply With Quote
Old 1st February 2007, 16:45   #3
k_rock923
\m/
(Forum King)
 
k_rock923's Avatar
 
Join Date: Jul 2003
Location: /bin/bash
Posts: 7,850
Send a message via AIM to k_rock923
Quote:
Originally posted by mikm
I don't see why procedural coding would produce significantly less bugs than object-oriented.

Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.
k_rock923 is offline   Reply With Quote
Old 1st February 2007, 17:11   #4
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
There's little or nothing making procedural languages "more efficient" than object-orientated ones, either. Object orientation tends to lend itself to maintainability and modularity, though, but I can't think of very many "pure procedural" languages anyway.

zootm is offline   Reply With Quote
Old 1st February 2007, 17:24   #5
k_rock923
\m/
(Forum King)
 
k_rock923's Avatar
 
Join Date: Jul 2003
Location: /bin/bash
Posts: 7,850
Send a message via AIM to k_rock923
Assembly? C?

Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.
k_rock923 is offline   Reply With Quote
Old 1st February 2007, 18:32   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
the main thing really is using the best method for what's needed at the time. sticking to one philosopy isn't necessarily the best way to go but that's just me

-daz
DrO is offline   Reply With Quote
Old 1st February 2007, 19:07   #7
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
Quote:
Originally posted by k_rock923
Assembly? C?
Assembly's barely a language. The thing with C is that it's not "efficient" due to being procedural, it's efficient because it's close to the metal.

zootm is offline   Reply With Quote
Old 1st February 2007, 19:41   #8
rockouthippie
Banned
 
rockouthippie's Avatar
 
Join Date: Jun 2004
Location: Oregon
Posts: 11,002
I don't think they'res any reason that object oriented languages couldn't be as efficient (or more efficient) than so called procedural languages.

I think the important thing is to keep your eye on the ball for your project goals.

For example, I'm not going to use C, when python does the job better.

Or vice versa.

Use what works, use what you need for speed, if necessary.
rockouthippie is offline   Reply With Quote
Old 1st February 2007, 19:46   #9
dlinkwit27
has no CT
(Forum King)
 
dlinkwit27's Avatar
 
Join Date: Sep 2000
Posts: 13,235
Send a message via ICQ to dlinkwit27 Send a message via AIM to dlinkwit27 Send a message via Yahoo to dlinkwit27
*the following uses the term "best" in a general fashion, with full recognition that there are different views and exceptions for the following statements.

Different languages are better for different projects. That's why there are so many different languages. This is no more of a logical debate than saying which OS is "best" Windows might be best for "office" work such as word processing and spreadsheets. Macs could be best for photo and video editing, and linux is best for running servers on.

Each programming language, as with each OS, has their bread & butter, the things they do do better than the competition, but saying that one, OS or language, is better than another at everything is foolish and just plain wrong.
dlinkwit27 is offline   Reply With Quote
Old 2nd February 2007, 12:45   #10
ujay
Forum King
 
ujay's Avatar
 
Join Date: Jul 2001
Location: London
Posts: 6,072
Plain common sense that dlink

Efficient is much more than just the language being used, the quality of the development environment counts for a lot too. Probably less so now with the speed of modern machines and the smartness of modern compilers but back in the day I would often use BASIC for utility progs, purely because it could be done in an interpreter. You could always use inline code to replace the slower parts for the final compile.
The Code > Make > Compile > Run > Debug cycle of things like 'C' was only worth the time and hassle on major projects in those days.
I was even once advised to choose Fortran over Algol for the simple reason that the Fortran compiler we had available gave a few diagnostic messages and the Algol one didn't

It's a shame that low level programming doesn't seem to be taught so much either, nothing like it for promoting efficient structures when you move on to the high level languages.

UJ
ujay is offline   Reply With Quote
Old 2nd February 2007, 13:04   #11
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
Quote:
Originally posted by ujay
It's a shame that low level programming doesn't seem to be taught so much either, nothing like it for promoting efficient structures when you move on to the high level languages.
You can teach data structures just as effectively with higher-level languages, the problem is that people just don't teach about that at all a lot of the time.

zootm is offline   Reply With Quote
Old 2nd February 2007, 14:41   #12
ujay
Forum King
 
ujay's Avatar
 
Join Date: Jul 2001
Location: London
Posts: 6,072
Thanks for bringing me up to date zoot .. (I need it )

I guess I've always liked to get closer to the 'why' of things than the 'how to' of things.

It's always struck me that choosing the right data structures was the knub of coding and the first thing to be considered.

UJ
ujay is offline   Reply With Quote
Old 2nd February 2007, 18:41   #13
fwgx
Rudolf the Red.
(Forum King)
 
fwgx's Avatar
 
Join Date: Nov 2000
Posts: 9,314
OO alows you to model the problem better. You can create OO models that resemble what you are trying to do. Because you are modelling better you probably have a better design and can create more efficient algorithms etc.

.: fwgx.co.uk.:.My art:.

"We think science is interesting and if you disagree, you can fuck off."
fwgx is offline   Reply With Quote
Old 3rd February 2007, 00:25   #14
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
Quote:
Originally posted by ujay
It's always struck me that choosing the right data structures was the knub of coding and the first thing to be considered.
I agree; in fact, object orientation often makes this more relevant (since in OO the data structures are the program too). I just don't believe that people who say that C/C++ are "better for education" have any real basis. It's a very "I had to suffer, so so do you" sort of mentality, in reality. There's nothing of significance you learn from them you can't learn at least as well from other languages, except how spectacularly things can go wrong when you screw up.

zootm is offline   Reply With Quote
Old 3rd February 2007, 18:19   #15
k_rock923
\m/
(Forum King)
 
k_rock923's Avatar
 
Join Date: Jul 2003
Location: /bin/bash
Posts: 7,850
Send a message via AIM to k_rock923
I sort of feel that people should have at least a little bit of experience with a language that makes you manage your own memory. I'm not sure that it's a good thing that I see homework of my classmates creating a zillion objects because they don't realize that there's a memory penalty for it, let alone the time penalty.

I do realize that with garbage collection, it isn't a huge issue, but I think that not creating all these extra objects in the first place is the right way to go.

Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.
k_rock923 is offline   Reply With Quote
Old 5th February 2007, 17:15   #16
xzxzzx
Forum King
 
xzxzzx's Avatar
 
Join Date: Aug 2002
Posts: 7,254
Quote:
Originally posted by zootm
I just don't believe that people who say that C/C++ are "better for education" have any real basis.
I disagree, but that's another thread.

Regarding the whole OO vs procedural thing, well...

OO is better in every conceivable way for anything except possibly embedded or kernel kind of stuff.

Given the same degree of programmer competence and familiarity, the OO-based program will have significant advantages:

High(er) cohesion, lower coupling -- greater reusability
Better performance
Better readability
Fewer bugs
Lower development time

It's not that OO is an amazing technology per se, it's just that "procedural" is no technology at all. Note that OO-techniques are possible in basically any language, it's much more of a design technology than a coding one.

Freedom of speech is the basic freedom of humanity. When you've lost that, you've lost everything.
1\/\/4y 34|<$p4y 1gp4y 33714y, 0d4y 0uy4y? | Roses are #FF0000; Violets are #0000FF; chown -R ${YOU} ~/base
The DMCA. It really is that bad. : Count for your life.
xzxzzx is offline   Reply With Quote
Old 5th February 2007, 17:47   #17
fwgx
Rudolf the Red.
(Forum King)
 
fwgx's Avatar
 
Join Date: Nov 2000
Posts: 9,314
Quote:
Originally posted by xzxzzx
It's not that OO is an amazing technology per se, it's just that "procedural" is no technology at all. Note that OO-techniques are possible in basically any language, it's much more of a design technology than a coding one.
But the real power of OO is in inheritance and polymorphism not data hiding. Being able to pass around a pointer to a derrived class as a pointer to a base class is where the interesting OO stuff starts and that can only be done in an OO language - at least in any kind of type safe nice way I can think of.

.: fwgx.co.uk.:.My art:.

"We think science is interesting and if you disagree, you can fuck off."
fwgx is offline   Reply With Quote
Old 5th February 2007, 19:16   #18
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
Well, most of the stuff extra that you learn from OO is generally from the system enforcing structured programming. OO isn't required for this, it's just that most "normal" languages which are new enough to have this sort of an emphasis tend to be OO anyway.

zootm is offline   Reply With Quote
Old 6th February 2007, 03:49   #19
xzxzzx
Forum King
 
xzxzzx's Avatar
 
Join Date: Aug 2002
Posts: 7,254
Quote:
Originally posted by fwgx
But the real power of OO is in inheritance and polymorphism not data hiding. Being able to pass around a pointer to a derrived class as a pointer to a base class is where the interesting OO stuff starts and that can only be done in an OO language - at least in any kind of type safe nice way I can think of.
True enough, but again, this can be done in any language... it just gets harder the closer to assembly it gets, and yes, you sacrifice type safety unless you implement your own OO system in the language.

I'm not saying there isn't an advanrage to an OO-based language, of course, I'm just saying the things that you learn from OO-based programming can generally be applied back to your procedural code.

Freedom of speech is the basic freedom of humanity. When you've lost that, you've lost everything.
1\/\/4y 34|<$p4y 1gp4y 33714y, 0d4y 0uy4y? | Roses are #FF0000; Violets are #0000FF; chown -R ${YOU} ~/base
The DMCA. It really is that bad. : Count for your life.
xzxzzx is offline   Reply With Quote
Old 6th February 2007, 09:23   #20
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,375
Well, yes, of course, but it becomes a tougher match. This is why we have higher-level languages. They serve as a useful abstraction.

zootm is offline   Reply With Quote
Old 6th February 2007, 20:50   #21
xzxzzx
Forum King
 
xzxzzx's Avatar
 
Join Date: Aug 2002
Posts: 7,254
Well duh. Did someone stick a "I CODE ASSMEMBLER CUZ U CAN DO ANYTHING U WANT IN IT LOL" sign on my back?

My favorite language right now is Python, with Lispish languages a close second.

I'm just saying that the most important part of OO is that it's primarily a design methodology, not a coding one.

(Can you tell that I'm reading Object Success right now?)

Freedom of speech is the basic freedom of humanity. When you've lost that, you've lost everything.
1\/\/4y 34|<$p4y 1gp4y 33714y, 0d4y 0uy4y? | Roses are #FF0000; Violets are #0000FF; chown -R ${YOU} ~/base
The DMCA. It really is that bad. : Count for your life.
xzxzzx is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Community Center > General Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump