TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python is a voluntary language

55 pointsby kracekumarabout 13 years ago

11 comments

postfuturistabout 13 years ago
Programming tastes evolve over time. At one point, and for at least a few years, I believed Python was the one true language revealed mystically to GVR. Up until that point, I'd done most programming in C++, so you can imagine how much fun Python was, in comparison. After further development and discovery of other programming languages, the shortcomings of Python have become obnoxious, much like torturing someone by dripping water on their forehead incessantly. Part of the problem is that I have to use Python for my professional work now. Using a language for your day job is a sure way to reveal all the issues.<p>Here's what rubs me raw day-in and day-out:<p>1. Lack of immutable/persistent data structures. 2. Lack of multi-line anonymous functions/lambda. 3. Variable scoping fail, causing hacks like the new `nonlocal` keyword. 4. worst_possible_variable_name_convention. 5. Python evangelism. (community issue, mostly) 6. Hypocritical "explicit is better" and "flat over nested" values with insane amounts of magic built into language and class system. 7. No switch. 8. GIL. (Actually the CPython runtime in general) 9. No macros. 10. the insane way "unicode" is supported. 11. and on and on...<p>At this point I write Python code, but not generally by choice. Mostly my coworkers can't even imagine writing code in another language, given that we have been allowed to choose our implementation language(s) as a team.
评论 #3978173 未加载
petercooperabout 13 years ago
<i>I wonder whether the increasing popularity of Ruby for web development has created pressure for Ruby to compromise its original philosophy.</i><p>I don't think it has. The original philosophies, as much as they exist, oriented around ease of use, programmer happiness, and pure OO - things Rubyists still enjoy. But Ruby has missed the boat on being a popular, general programming language in the way Python is <i>big time</i>. <i>Most</i> Ruby jobs are related to building Rails apps in some way or another and the majority of the Ruby ecosystem (in the West, at least) orients around Web development (and not gaming, scientific programming, education, or the many niches Python has found a home in).<p>Ruby is an interesting language and one that's worth learning and using IMHO, but in the West, Ruby has become "typecast" as a life support system for Rails essentially. (Before people note the non-Rails things they're doing with Ruby, I said <i>most</i> Ruby jobs and the <i>majority</i> of the Ruby ecosystem. Reporting on Ruby developments has been much of my job for the last 6 years but I am more than happy to be swayed :-))
评论 #3977582 未加载
评论 #3977495 未加载
评论 #3977615 未加载
评论 #3977842 未加载
评论 #3977863 未加载
评论 #3977593 未加载
yummyfajitasabout 13 years ago
I definitely wish I was writing something other than python. I did choose it, but it's not the language I want to be writing in. It's just the language that happens to have numpy, django, etc.<p>While writing it, I often wish it were statically typed with pattern matching. The write/test/type error or undefined variable cycle is very frustrating to me. The lack of pattern matching makes my code verbose and also makes it harder to spot edge cases I missed.<p>I also wish functional programming in it were as easy as in Javascript. I often find myself writing a bunch of front end code, finding it elegant, then thinking "damn, back to python to update the api". (This includes multiline lambdas.)<p>It's still my go-to language for most purposes, but I constantly feel that it could be a lot better. I'm looking forward to the day when javascript completely subsumes the niche python occupies.
评论 #3977543 未加载
评论 #3977454 未加载
评论 #3977436 未加载
plessthanpt05about 13 years ago
Nice point, and really, how many folks actually find writing code in Python cumbersome or "work" like some languages? It's not perfect and of course if you need really fast computing, it's obviously not (even close to) the best for speed, but it's expressiveness &#38; readability are a pretty big step up from most other languages.<p>Also, I hadn't seen this essay by PG before (from the comments); a bit old, but interesting take:<p><a href="http://www.paulgraham.com/pypar.html" rel="nofollow">http://www.paulgraham.com/pypar.html</a>
评论 #3977359 未加载
brosephabout 13 years ago
Just for the record: I used Python at work because I had to; I'd rather have been writing Java.<p>The titanic investment bank that I used to work for started a major rewrite of its entire set of booking and risk systems in which everything was to be written in Python. It immediately assigned hundreds of programmers to the task, shepherded by a "core team" eager to use every feature of the language. The result was a perfect example of the problems with Python in the large. Enormous type hierarchies mingled with copious use of eval; there was no structure at all to much of the code.<p>It's possible to write terrible code in any language, of course, but using Java would have been one way to curb some of the worst impulses of the low-quality programmers.
评论 #3979221 未加载
swangabout 13 years ago
In terms of imperative languages, python is #2 for me. And really I haven't done much python in the last couple of years mainly because anything I would want to do in python I'd rather do in ruby. Of course you will definitely hear me say, "I'd rather use python than Y" but I'd also say, "I'd rather use ruby than python"<p>I don't even get what he's trying to get at in paragraph three. From looking at jobs for startups and jobs in the Bay Area I can see that a large majority of them are using python over ruby. So python compared to ruby is relatively more popular at least from a job-seekers perspective.<p>So even though this is true, he singles out that ruby may possibly have compromised it's original philosophy with rails because of its popularity but yet python hasn't been affected at all by its mass popularity from most startups and science/academia companies using it? Python also has a pretty popular framework in django yet I don't really see any pressure by Guido to change python because of it.<p>Really this article is a pretty ignorant view of ruby since he himself admits he does not know much about ruby. So why bother writing that last paragraph other than for the sole purpose of putting down ruby? The last paragraph feels pretty tacked on and seems to be a nice jab at ruby for no reason other than he likes python.<p>Let me just end by saying, I love python, but I love ruby more. I don't have any ill-will towards python. But consider if this article was written about ruby and dhh wrote it. How much vitriol do you think dhh would get from writing an article like that?
knowtheoryabout 13 years ago
&#62; I don’t know much about the Ruby world, but I wonder whether the increasing popularity of Ruby for web development has created pressure for Ruby to compromise its original philosophy. And I wonder whether Ruby’s creator Yukihiro Matsumoto has “dictatorial” control over his language analogous to the control Guido van Rossum has over Python.<p>This is a some what irritating speculative musing, given the fact that it is a question that could easily be answered by talking to any number of Rubyists who are available and interested in answering such a question.<p>One of the major points of tension in the Ruby community is the extent to which the non-Japanese Ruby community has input and control over the destiny of Ruby as a language. Given a number of alternative implementations of Ruby (JRuby, Rubinius, MacRuby just to name the popular ones), alternative implementors have gone well out of their way to ensure conformance with the mainline Ruby implementation.<p>In fact they went so far out of their way to build a spec suite to characterize the behavior of Ruby the programming language from it's actual implementation. And on top of that there's even a new ISO spec for Ruby.<p>So, yeah. Matz does have control of Ruby, and Ruby does resemble Python in its voluntariness.
评论 #3977411 未加载
sasha-dvabout 13 years ago
&#62;People who write Python choose to write Python.<p>People who write X choose to write X.<p>There's virtually no language that can't fit the bill. It may surprise some, but there are people who choose to write Java, Perl, C, and even C++.<p>edit: Didn't realize that people who choose a language different than Python aren't actually people.
评论 #3977823 未加载
评论 #3977710 未加载
评论 #3977600 未加载
gordianknotabout 13 years ago
I use Python at work because I have to, but I'd rather be writing JavaScript.
jsofraabout 13 years ago
I use Python at work because I have to, I would really rather not.
its_so_onabout 13 years ago
EDIT: Python is my favorite language. But I wish a LOT more very lazy people or people who can't apply algorithms to solve their own problems (and hopefully in all the same domains that I work in) used it, discussed and asked questions, etc.<p>It is in this vein that I write...<p>"Python is popular enough to have a critical mass of users" - on this point unfortunately I have to disagree.<p>Often the way I write a script is to put in a little extra effort up-front: I do three or four Google searches with the hard part of the task + Python, Perl, PHP, etc -- just to see if someone has already done this for me. I must say that if it's something hard and remotely web-related, the Python part is usually not even worth trying. Either I can do it off of the top of my head, or some fool is asking how to do this thing they can do in PHP in Python and, well, not really getting an answer. (It's not that it's wrong to code things up the long way, it's just that, like I said, it's not even worth doing the Google search).<p>In this sense there is not a 'critical mass' of users. Let me give you a simple example. Say you want to do fancy appointment-matching like people saying "next friday"...you want to try to pick up on that and offer to set an appointment. So, Google "appointment regular expression next friday php" "apppointment regular expression next friday python" "appointment regular expression next friday perl". You can go ahead and do it, I don't even have to check. If you don't find anything, play around for less than 15 seconds with alternate search terms (more general, more specific, or just different.)<p>I did the above search just now, and in my case I went off on this tangent and within a couple of minutes had an answer that was satisfactory for me.<p>I would say, well, there are simply lots of fast scripts that you KNOW can take you 2-3 days of head-scratching to get right <i>OR</i> that the community already has bumped their heads against. Which do you do? If you're NASA, of course you go through scratching your head and getting the RIGHT answer. If you're trying to get a demo out the door, then you go for the low-hanging fruit, with as much leaning on the community as possible. Of course, if its creation, trajectory calculations, whatever, involve a scripting language in any way, would I want a <i>rocket</i> to use Python over PHP. But if I need a script that creates a GIF file of a rocket blasting off off-screen, based on a static image of the rocket that I have? (Forget whether the gif is the correct solution, I just want to see what it looks like, maybe as part of investigating lots of possible ways to do this). Well, then I would do a couple of minutes of Googling first... (As above, though I didn't try this one). Usually, I'm sorry to say, Python doesn't win.<p>If this get smore downvotes I'll try the Python search on creating a gif file programmatically.
评论 #3977683 未加载