• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Python Object Oriented v. Functional Programming - with a concrete example!

AtlantaBob

Golden Member
Man, I sure wish I could sleep....

In my insomniac mood, I figured I would play around with a little programming. Why not try to do Conway's Game of Life on Python? I googled first, just to avoid any huge traps, but one thing surprises me. A lot of the "suggested" implementations suggest doing this in an object-oriented framework.

To my (admitted limited) understanding, wouldn't that just add a huge amount of overhead to a program that could be relatively simply implemented in a regular function-based framework? Are professors/others just suggesting that people implement this with objects so that programmers get some experience with object oriented programming?

Thanks for any thoughts.
 
I don't know much about Python specifically, but the overhead associated with an object-oriented approach is essentially the overhead associated with a higher level of decoupling and modularity, and it's well worth it imo, expecially in a world with gobs of cheap processor cycles.
 
I dont think functional programming is what you think it is. Haskell is a functional programming language, for instance.

Anyway, yes OO is worth it, for anything larger than a hello world program.
 
No. OOP really isn't THAT much more expensive.

In C++ land, the cost of OOP is a little more memory accessing, and one more invisible parameter passed into object member functions (unless you start doing polymorphism sorts of things, then it gains a fair amount more overhead). The gains, however, are well worth it.

Pythons overhead comes from many other things, OOP is not one of them. I've never been impressed with the python as a programming language, I find it overly slow and cluncky. Java or C# do much better jobs at RAD and are less clunky.
 
I dont think functional programming is what you think it is. Haskell is a functional programming language, for instance.

Anyway, yes OO is worth it, for anything larger than a hello world program.

And this. Lisp, Haskel, smalltalk?, OOCaml are examples of functional languages. I believe the OP meant procedural languages.
 
Thanks, yes, I meant procedural. That's what I get for posting about (a) a topic that I don't deal with on a daily basis, and (b) when it's 3:00 AM.

Anyhow, thanks for the feedback everyone. Much appreciated!
 
Back
Top