Procedural Code vs OOP

I disagree, forcing the cart before the horse is impractical; far more sensible to choose a language designed to exploit OOP
 
Last edited:
[)roi(];12753433 said:
I disagree, forcing the cart before the horse is impractical; far more sensible to choose a language designed to exploit OOP

I don't know what you're disagreeing with. I'm saying that it exists and that you can do it, not that it always makes sense to use it or to prefer it.
 
Last edited:
It's not politically correct to say that you prefer procedural code. Keep it to yourself. :D

Don't read to much into this... but my experience is that most business applications don't lend themselves to OOP because they are CRUD pass-through systems.
As a result I have learnt to often move most procedural code to static helpers, instead of trying to glorify the container classes into a (domain) object model which it is not.

For self-contained systems and game programming though, nothing beats a well designed object model.

I was recently on a project that was perfect for domain-driven design, and I know that the system would be simplified to take the development effort to ~6 months x1 dev from what seems like what will be ~2 years x3 devs for a mainframe-style / procedural design.
 
I don't know what you're disagreeing with. I'm saying that it exists and that you can do it, not that it always makes sense to use it or to prefer it.

Only if calling a lemon an orange is acceptable to you...
 
[)roi(];12754111 said:
Only if calling a lemon an orange is acceptable to you...

What on earth are you talking about? If you don't think that C or assembler can be programmed in an OO fashion, then just say so and state your reasons. If you just think that these are inferior languages for expressing OO features, then we are in full agreement.
 
For self-contained systems and game programming though, nothing beats a well designed object model.
I think you'll find many would disagree re game programming.

Basically there are many counter arguments about why it's best to avoid standard OOP with game programming for a component based model; the antithesis of typical OOP design.

http://m.kongregate.com/forums/4-ga...part-1-a-criticism-of-oop-in-game-development

http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy
 
What on earth are you talking about? If you don't think that C or assembler can be programmed in an OO fashion, then just say so and state your reasons. If you just think that these are inferior languages for expressing OO features, then we are in full agreement.

Surely calling them a lemon; as far as OOP is concerned is expressive enough. Not design for OOP means at best it'll be an abortion, or if you need a picture, hopefully this sums it up ;)

https://encrypted-tbn0.gstatic.com/...9pUib_N4BdFtjcnx5eNC6JK2Qb4rvbZV9RqbMUKRYv90P
 
[)roi(];12754339 said:
Surely calling them a lemon; as far as OOP is concerned is expressive enough. Not design for OOP means at best it'll be an abortion, or if you need a picture, hopefully this sums it up ;)

https://encrypted-tbn0.gstatic.com/...9pUib_N4BdFtjcnx5eNC6JK2Qb4rvbZV9RqbMUKRYv90P

A lot of firmware and custom ASIC code uses OO assembly code design, and a lot of system software (notably, the Linux kernel) uses OO C. It's pretty common, and can and has been used effectively. It can be challenging to program (OO) in relative to an OO language, but in a few cases it has its advantages, and in some cases, it's all you have available.
 
You can literally feel the tension in this thread
 
A lot of firmware and custom ASIC code uses OO assembly code design, and a lot of system software (notably, the Linux kernel) uses OO C. It's pretty common, and can and has been used effectively. It can be challenging to program (OO) in relative to an OO language, but in a few cases it has its advantages, and in some cases, it's all you have available.

Yet again, you are wasting your time with these guys.
 
A lot of firmware and custom ASIC code uses OO assembly code design, and a lot of system software (notably, the Linux kernel) uses OO C. It's pretty common, and can and has been used effectively. It can be challenging to program (OO) in relative to an OO language, but in a few cases it has its advantages, and in some cases, it's all you have available.
Source? Ps. don't ever post pictures of your car :D

On a similar silly note; it could be said there are viable culinary reasons for veggie burgers / sausages; IMO you probably have to be a staunch vegetarian to find cardboard sausages even slightly appetizing ;)
 
Last edited:
Last edited:
Why would you want to copy/paste hundreds of lines of codes (in some cases) to do the exact same thing, and then, when you have to fix a logic error, sit and fix it (and remember where you used it) in all those places; when you could just define an object and put the logic in there and fix it once?

:confused:

Maybe I'm just lazy and don't want to work "hard"
 
Why would you want to copy/paste hundreds of lines of codes (in some cases) to do the exact same thing, and then, when you have to fix a logic error, sit and fix it (and remember where you used it) in all those places; when you could just define an object and put the logic in there and fix it once?

:confused:

Maybe I'm just lazy and don't want to work "hard"

no one is really saying that, well at least I don't think anyone is. code duplication can just as easily be done in "OOP" than in a procedural style, and you see it happen all the time.

hopefully, it is basically, in an extremely simplistic view of things

myFunctions.c

Code:
function doSomething() {
  //snipped
}

myFile.c
Code:
import myFunctions

doSomething();


as opposed to

myFunctions.c

Code:
class Functions {

   static function doSomething() {
     //snipped
   }

}

myFile.c
Code:
import myFunctions

Functions.doSomething();


admittedly, that might not be good example, as those 2 are for all intensive purposes, identical.

personally, in my 12 years, I have never had the need not to use an OO language. maybe I just don't write things that are "cool" or "awesome"

http://en.wikipedia.org/wiki/Procedural_programming#Comparison_with_object-oriented_programming
 
Last edited:
[)roi(];12756015 said:
Source? Ps. don't ever post pictures of your car :D

Semaphore posted some links about the OO C Linux Kernel. Also this.

Here's some bits about drivers. GTK/gnome. There are even jobs advertising for it (also). I have personally worked on OO C drivers in the past, and also on OO assembler since the platform was in development and had no C compiler, and also OO C on systems that had a C compiler but no C++ compiler.

[)roi(];12756015 said:
On a similar silly note; it could be said there are viable culinary reasons for veggie burgers / sausages; IMO you probably have to be a staunch vegetarian to find cardboard sausages even slightly appetizing ;)

Similarly, it could be said that given the huge number of different veggie burger/sausages options out there and the many different palates out there, making a generalization like this simply speaks to your level of inexperience.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X