On Sat, 2003-03-22 at 08:51, Raj Mathur wrote: > IMO programming discipline should be a function of the programmer, not > of the programming language. I want a language that lets me make > mistakes if I choose to. A language where I can apply the rules of > good, structured OO programming (which both Perl and Python let me > do), or break them if I so desire (which only Perl lets me do). Software development has become a complex task. If you check out any big enough project, they have a style guide, they try to enforce. Which really indicate that there is no standard for indentation even when there are tools to auto indent. As far as language flexibility goes, python does allow you to write OO, functional and structured programming mixing which ever you want. You can handle several things, the lisp does. Offcourse it also works like java when it comes to object orientation. One language clone called Jython you can write java code in python. You could also write java beans. You could also write functions which resemble BASIC functions. Type checking and casting is automatic and correct in most cases. You can enforce a type to variable as well. > > Couple of example of what I mean... > > 1. C (another language that does not enforce discipline on a > programmer) permits you to use constructs of the form array[-1]. Now > normally negative indices to arrays are taboo. However, you'd be > surprised at how often in the Real World this sort of construct is not > only used, but indispensable. One example of a large application that > uses this construct is Glibc IIRC. > > 2. Most (all?) OO languages do not permit invocation of object methods > that do not exist at compile time. In any ``sane'' programming > language a construct of the form $object=new Class; $object->foo() is > an error unless Class contains a method called foo. As they say there are more than one way to do things. > > However this is not an error in Perl. Because of this feature, Perl > actually permits to do some creative messing around with class > definitions and dynamically generate lots of similar methods for > multiple classes at run-time without having to code each one > individually by hand. (No, this is not the same thing as templating in > C++.) you do write virtual functions in C++. which is a prototype of function to come.
> > Now some people may say that that's a rotten way of doing things, > since the code will be unmaintainable. My take is that, firstly, all > programming languages contain paradigms, and in order to read another > person's code you have to be familiar with the paradigms s/he has > used, otherwise you'll be lost in any case. More important, I believe > that 25 lines that implement cloning of similar methods are more > maintainable in the long term than 5 lines per method for 1000 > methods. > > Unstructured programming may actually be MORE maintainable than > structured programming in some cases. > > To sum up, I'd recommend Python as a great language for learning OO > programming and Perl for those programmers who want to have the > freedom to be constructive, creative and innovative. Zope and mailman are big applications to prove that python is not just novices language. Python has already been tested with/for in archival, image processing, networking , biotech, etc etc. Being well documented to the extend that each global variable is described makes python a flexible and reliable interpreted language. > > Regards, > > -- Raju > -- > Raj Mathur [EMAIL PROTECTED] http://kandalaya.org/ > It is the mind that moves > > Quote from an IRC channel: > > Perl, the only language that looks the same before and after > PGP-encryption! > > ================================================ > To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject header. > Check archives at http://www.mail-archive.com/ilugd%40wpaa.org >