Linux Today: Linux News On Internet Time.

More on LinuxToday

LinuxDev.net: Better OOP with Python

Jun 24, 2000, 12:40 (0 Talkback[s])
(Other stories by Rick Muller)


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

[ Thanks to BeOpen for this link. ]

"All programmers are familiar with writing a small, well-structured program, and watching it grow out of control, feature by feature, until it becomes unrecognizable and unmanageable. OOP can help stem this flow. No programming philosophy can make a 5 million line program as easy to understand as "Hello, World." Where OOP helps, though, is in dividing a program into objects that contain a logically connected set of data and all of the functions that act on that data. Thus, instead of having to muck through 5 million lines of code, one must only muck through the 5 thousand line code containing the whoosit that needs to be modified."

"Python makes it easy to test drive a number of different patterns rapidly. Data types are assigned automatically, much of the overhead involved in writing constructor and destructor functions is handled automatically, and inheritance is a snap. One would expect that the result of this relaxation of syntax and typing rules would result either in unreadable code or in a lack of power to do sophisticated tricks (such as passing in a function as an argument to another function). Luckily, this is not the case with Python. Consequently, Python offers all of the power one would require to try out different patterns, and lets you do so quickly enough that you don't just get bored and settle for an imperfect solution."

"...if you find that your programming languages are old, sequential-type languages like Fortran, C, Basic, or Pascal, give Python a try. You'll learn a very useful language, and you will be introduced into the wider world of OOP."

Complete Story

Related Stories: