I don't know about you but I hate to have a really good program chunk go to waste in only one program.... if I make it O.O... then I can easily use it in many different programs and make my programming faster... like when I work for a week on one tiny conversion routine... then find that I can use the same routine in 20 different programs and it saves me some space... so I use it...
also... commenting out one object call is pretty easy... so I can test functionality with several versions of the OO part.
2006-08-08 12:51:51
·
answer #1
·
answered by ♥Tom♥ 6
·
0⤊
0⤋
The two topics are unrelated, if you look at their strict definitions. Functional programming is a mathematical paradigm, while object oriented programming is a computer science paradigm. Now if you mean "why do people use classes, structures, and other objects in computer science instead of just functions," there is a very good reason: modularity. O.O. programs are very modular. You can download a module, pass a few variables to it, like, for instance, the name of a MP3 file, and it will do the conversion to something like an AAC file for an iPod. That way someone skilled in audio conversion can develop the object that handles the conversion, someone who is good at the interface design can handle the graphics, and someone else who is good with project management can tie it all together with a cohesive framework. Using only functions, one would have to worry about copying and pasting a lot of code, memorizing function names, learning how other people's code works, etc. O.O. programming eliminates this need and makes it so even novice programmers can "stand on the shoulders of giants" to build some really great programs. Examples? Facebook, MySpace, Winamp - to name a few.
2006-08-08 18:48:15
·
answer #2
·
answered by Kevin 3
·
1⤊
0⤋