6 ms·
Why python?
- ColinWright 15y agoAn old friend. Previous discussions: http://news.ycombinator.com/item?id=1822376 http://news.ycombinator.com/item?id=1822376 http://news.ycombinator.com/item?id=297683 http://news.ycombinator.com/item?id=297683 Lots of comments on each. Before commenting here it might be worth reading those earlier discussions.
- samuel 15y agoI started to use Python not much after this article(2002?), and I wonder how much of those days' simplicity holds true. "Modern Python" is full of list comprehensions, generators and decorators. Not that's intrinsically bad, but it's not "executable pseudocode" anymore. Books as "Collective Intelligence" require you to know Python intricacies in order to understand it.
- paganel 15y ago> I started to use Python not much after this article(2002?), and I wonder how much of those days' simplicity holds true. I started learning Python in 2003, I was really a programming newby, by I managed to get my first full-time programming job just 2 years later because Python made it that easy for a neophyte to get from 0 experience to getting paid to write code. List comprehensions are cool, and not that hard to grasp, but I agree, I sort of started losing track once people started using "generator that" or "decorator this" for every damn problem you threw at them.
- scott_s 15y agoI find list comprehensions to be far more natural and more readable than the equivalent for loop.
- kamaal 15y agoThat's hardly surprising, Minimalistic tools haven't been able to survive for a long time. Problems change, programmers needs change. What was not necessary yesterday, might be very important today. You will have no option but to keep adding on things as they are needed. I started out with vi, then found out I was better off using emacs. Its rather better to use something designed to be big from the scratch, than to be using some thing invented to be minimal but bloated later just to compete with others. Python is just undergoing the natural trend.
- Ixiaus 15y agoYou really think Python is losing its simplicity? List comprehensions are much easier to read than a multi-line for loop (obviously, though, nesting list comprehensions is A Bad Thing for readability) - they are much simpler. Generators don't add simplicity!? Do you even know why you would use a generator, why does this run: for i in xrange(1, 10000000000000): print i and this doesn't: for i in range(1, 10000000000000): print i To make the range() example run, you have to use generative behavior anyway, in some form or another. Generators are a simple way of expressing that kind of algorithmic behavior. (for the record, this little example is being ran on a machine with 2GB of ram) I know that is a very silly use case for generators, particularly when range() is going to become xrange() anyways - but it is a perfect example of why generative behavior can make things simpler. The trade off is memory vs computation - range() builds the whole list then iterates over it; xrange() generates the next item in the list; use normal list construction when the list is knowably going to be small, use generative behavior when the list is going to be big! Decorators make the language less simple????? A decorator gives you the ability to modify a function/class at runtime. Decorators have made my python code (where they are useful) much much simpler!! Decorators have given me another dimension to follow DRY with!! Decorators do make the implementation more complex but they make the code you write simpler - the trade off is very clear and the cons are almost non-existent. If you think decorators are cool, try picking up Common Lisp or Scheme - Macros will rock your socks off.
- theclay 15y agoI doubt people will argue that these features are useful, but they do increase Python's overall complexity by adding to the sum total one must learn to grok python. There's a danger here: add too many "simplifications" and you get something complex. (though list comprehensions really are awesome!)
- Ixiaus 15y agoI can agree with that (add too many simplifications...); that's why I've really fell for data-as-code in Scheme; the simplifications in that language are so broad that you don't have to /add/ simplifications. Whereas, with Python's (or any language that isn't homoiconic) "baked" syntax, you do have to add "simplifications" or "features".
- sgt 15y agoAn 11 year old article... Great. I still have the issue of Linux Journal with this article in it, lying around somewhere. That was ESR's heyday.
- dimmuborgir 15y agoThis and PG's Python Paradox have been discussed umpteen times on HN already.
- chunky1994 15y agoI'm sorry, I just found it interesting. Some of the new members may not have seen it, so I guess it might just bring about some fresh opinions. (And completely unrelated, if this is improper etiquette please forgive me, but I see you like Dimmu Borgir! Pretty cool)
- mambodog 15y agoBy the way, when you post an old article, the convention is to append the year to the title, eg: Why Python? (2000)
- chunky1994 15y agoOh,I had no clue it was old before the first comment, but I'll be sure to keep that in mind.
- krat0sprakhar 15y agoYou're the first hacker I've come across on HN who likes Dimmu(apart from me) :D
- adaml_623 15y agoI thought initially that an article this old would be full of historical and probably obsolete information. But I've realised that the second half of it is actually quiet interesting and worth a read for people who are thinking about the strengths and weaknesses of different programming languages.
- cypherpunks 15y agoI'm not sure if I trust much be ESR. He's extremely eloquent, so what he writes always sounds convincing. In practice, he's a pretty bad developer, or at least he was at the time he wrote most of his stuff (at the time, the most serious technical accomplishment he had under his belt was a refactoring of fetchmail). When I've applied the things he's written, more often than not, they've lead me astray. He has, more often than not, messed up in contexts involving technical interaction with other people (e.g. CML2). This is in stark contrast to e.g. RMS, who usually puts people off, but whose writing tends to be dead-on correct (if you don't believe me, read almost anything he wrote 10-30 years ago, and see how it panned out -- the guy's almost a prophet, cursed to know the truth but not be able to convince people). So I take everything ESR writes with a very large, maybe unhealthy degree of skepticism. It's too easy to be convinced of something incorrect (many eyes make bugs shallow, negative attitude towards RMS, etc.). I'm looking at his page now, and he appears to have written or contributed to more software since, so I'm not sure if this still applies. I suspect it does, but I'm not ready to pass judgment until I read his more recent essays.
- kahawe 15y agoI never understood where his "claim to fame" really came from? Apart from publishing and then maintaining a pre-existing dictionary on his website, publishing one of MANY books on Open Source and cursing admins with fetchmail, he hardly contributed to or founded any REALLY big projects or coded a lot like Linus or RMS did or did anything of real substance - but esr was always one of THOSE names during his heyday and he would go to great lengths telling everyone how "the community" selected him to be some sort of open source Keanu Reeves/Neo...
- sesqu 15y agoWriting has historically been very important for recognition, especially current writing.
- cypherpunks 15y agoHe's an exceptionally good communicator and has very strong soft skills, and applies them to self-promotion. He's also good at politics (as in convincing crowds of people -- not so much at interacting and making long-term connections with individuals). A lot of this has to do with feeling out crowds, and telling them what they want to hear. He's also got a slightly underdeveloped moral compass, which always helps (he was willing to be a little bit sleazy and subtly undermine competitors). That's mostly what it takes to get famous. He was also the only person, after RMS, who was arrogant enough to take credit for the whole movement.
- rjbond3rd 15y agoIt sounds like ESR was writing that old-fashioned single-script non-OO stuff, relying on big nested data structures which were indeed often messy and confusing. OO changed all that.
- rjbond3rd 15y agoDownvotes are not informative. Do people really disagree that huge, non-OO scripts were the dominant style back in the 1990's? Or that people tried to solve problems with huge data structures instead of classes? And that these practices gave Perl a less than stellar reputation? Or is it that people don't realize that Perl apps are virtually always written in clean, well-factored OO these days?
- masterzora 15y agoI was not one of the downvoters, but I was not surprised to see the downvotes. I can't figure out in what way that comment added to the discussion. "I am assuming he was Doing It Wrong" with no additional commentary on what this affects or the implications therein. Regardless of the truth of the comment, it just doesn't seem to be a very useful one.
- rjbond3rd 15y agoHi masterzora, Thank you for clarifying. I appreciate it. No, not doing it wrong -- he was almost certainly doing it in the predominant style of the language in the 1990's, which was procedural / scripty, e.g., hashes of references to arrays of references etc. Pre-OO. And his remarks are certainly fair for the time period, but isn't it also fair to note that this style of coding is not practiced anymore? I think so but I'm interested in any viewpoint.
- masterzora 15y agoSure, it is fair to note, and I think it's actually a pretty good point now that you've clarified it a bit. (I speak as someone who's currently using Python at work but Perl for my own things.) However, it's a manner of how you present the comment. As you originally stated it, it pretty much sounded like "He's Doing It Wrong", which didn't add very much to the discussion. In my opinion, a much better way to go about it would have been something closer to "I think it's worth contextualising his comments. It is likely that the style in which was coding was more in line with earlier styles that are not used as often in 2011. While Perl is obviously still Perl, more recent styles do help alleviate some of his concerns." Now, this clearly still isn't a perfect comment, but it, or something more like it, would serve both to clarify your position and to allow for discussion based on it, if people were up for such discussions. But, again, I feel the need to reiterate that I was not one of the people who downvoted you, so I'm only guessing as to the most likely reason for the downvotes.
- pavel_lishin 15y ago> So I dived into Programming Python with one question uppermost in my mind: what has this got that Perl does not? Readability.
- zygen 15y agoPerl is perfectly readable, and in many cases elegant. The creator is even a trained linguist. Sure it's possible to write unreadable perl, just like it's possible to make a mess in any language, but I'd say perl is as readable in general as python.