ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Python and Apache
Subject:   Article not well informed
Date:   2003-04-26 21:39:47
From:   anonymous2
No offense, but I'm a Python newbie and have not really used regexes, yet even I know one should use the re module. Heck, Python even gives you a warning about it:


>>> import regex
C:\Programming\ActivePython\Scripts\pycrust:1: DeprecationWarning: the regex module is deprecated; please use the re module
#!/usr/bin/env python


You mention getting split() to work was impossible. Here's my try:


>>>"Name=John".split('=')
['Name', 'John']
>>>"Name=John".split('=')[1]
'John'


You criticize the syntax, mentioning people would have to unlearn indenting when learning a different language? Not true IMO. They should KEEP indenting, but they'll find they're required to add parentheses or BEGIN/END or whatever to it. If anything, it teaches good programming practice. I know, as a beginner I wrote programs in other languages which I didn't indent because it wasn't necessary. I obviously ended up regretting that.


You also mention the burden of having to place "\" to continue long lines. Someone already pointed out that in many cases this isn't even necessary (particularly what you're doing in line 7 is quite pointless). But anyway, I'd rather add a character to that handful of wide lines I have than a ";" after *every single line*.


After showing how little you really know about Python (even though you do succeed in making a working script from scratch with no prior knowledge in an hour), you tell that it misses bells and whistles. Considering that you didn't even find index.html in the docs directory, I doubt you'd know a bell from a whistle in Python if they both hit you on the nose. By the way, you'll be happy to know that Python has a nice help() function which displays documentation on functions, modules, etc. Give it a try, I find it quite handy.


I hope you take the time to correct your article.