New to Python: Features
Alex Martelli
aleaxit at yahoo.com
Tue Oct 5 03:43:27 EDT 2004
More information about the Python-list mailing list
Tue Oct 5 03:43:27 EDT 2004
- Previous message (by thread): New to Python: Features
- Next message (by thread): New to Python: Features
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Richard Blackwood <richardblackwood at cloudthunder.com> wrote: ... > >> I'd like to be able to use a string as an integer without an explicit > >> coerion on my part for example. > > > > > > NO! Don't do that. Bad code. Subtle errors. > > > > Try Perl or Ruby instead. > > > Now your encouraging me not to use Python? If you require a feature that Python does not have, never had, never will, and which Pythonistas consider horrible from all points of view, it would be unwise to encourage you to use Python: your desire can be satisfied by languages designed with completely different criteria, apparently criteria fitting in better with your desire. Andrew was wrong about Ruby -- it's a well-designed language, so the feature you desire is of course not there -- but Perl _does_ have that feature you desire, and 20 tons more, so you may be happier with it than with either Ruby or Python. ((Ruby actually allows you to change behavior of built-in objects, so you may make addition behave like subtraction, or automatically coerce operands, or whatever else -- such excessive power in Ruby is exactly the number-1 reason I use Python instead, but since many questions you posed may be seen as hankering for just this kind of excesses, then you might like this aspect -- Perl lets you reach even deeper down into the bowels of the language and perform any level of hacks, google for lingua latina perligata to see an example)). > No, no, I want the C speed. Then use C: no other portable language (including C++ when properly used) quite matches C's speed across the board. Good programmers realize that "premature optimization is the root of all evil in programming" and choosing a language based on the speed of its implementations is the ultimate _premature_ optimization, of course; they code in a powerful high-level language, then, iff more speed is needed in some (typically tiny) corner of an application, recode that part, only (e.g. in pyrex, a mostly Python-like language which interoperates smoothly with Python and does "compile down to C"). If you don't need portability, C's speed isn't optimal anyway; psyco (a just-in-time optimizer for Python) can sometimes beat C by going directly to machine language (but it only works for intel and compatible CPUs, not for example for the PowerPC chips used in Apple's Mac computers -- that is the downside, of course). > > Why not just use Ruby? It seems to fit your search criteria > > much better. > > Because Python is...well...more Pythonic. I much prefer it (esp. > whitespace). I suspect that with the same tricks used in 'lingua latina perligata' you could make Perl use whitespace like Python, while keeping deeper semantic aspects, such as the ability to add integers and strings, which you appear to keenly desire. Alex
- Previous message (by thread): New to Python: Features
- Next message (by thread): New to Python: Features
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list