6 ms·
Python is a voluntary language
- plessthanpt05 14y agoNice 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 & readability are a pretty big step up from most other languages. Also, I hadn't seen this essay by PG before (from the comments); a bit old, but interesting take: http://www.paulgraham.com/pypar.html http://www.paulgraham.com/pypar.html
- deleted 14y ago[deleted]
- knowtheory 14y ago> 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. 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. 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. 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. So, yeah. Matz does have control of Ruby, and Ruby does resemble Python in its voluntariness.
- kibwen 14y agoAgreed, but I confess that I'm also a bit unclear as to Matz's active involvement with the language. Every "Ruby expert" post on HN seems to originate from either Yehuda Katz or DHH... is it just that Matz prefers to communicate in Japanese, on Japanese mailing lists?
- petercooper 14y agoMatz is deeply involved with the language's design and a couple of its implementations but as a community leader, in the West, at least, he doesn't do much or have much impact IMHO. This is part of the reason people, rightly or wrongly, have seen the well known Rails developers as figureheads for both Ruby and Rails and then poured scorn on Ruby for their actions.
- yummyfajitas 14y agoI 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. 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. 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.) 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.
- tmhedberg 14y agoI agree with you on static typing and functional style being strongly preferable, and that Python makes that style of programming irritatingly difficult, but it's not like JavaScript has static typing or pattern matching either, so it seems odd that it would be your preferred replacement. Why not wish for a replacement that actually has all of the features you want?
- yummyfajitas 14y agoHaskell is my preferred replacement, but I don't really expect Haskell to replace Python. It might replace C++ or Java, however, or form it's own new niche. People seem to want a simple, dynamically typed scripting language. Javascript can fill that niche while being a big improvement on Python. (Particularly if we accept some breakage of backwards compatibility, add a module system, and clean up the warts.)
- tmhedberg 14y agoHow likely is this hypothetical cleanup of JavaScript to happen, though? It seems about as likely to me as the likelihood of Haskell replacing C++ or Java; i.e. not very likely at all (even though I share your opinion that it would be a wonderful thing if Haskell were more popular). The main advantage that JavaScript seems to have over Python is multi-statement lambdas. In other respects it seems no more Haskell-esque than Python is. Python at least lets you do a very limited form of pattern matching on tuples. And JavaScript brings along so much hastily-designed ugliness that it seems like it would take ages to break free of its historical warts. I'd personally be happy if some flavor of Scheme became the dynamic language du jour, though I realize I'm living in a fantasy world there.
- petercooper 14y agoI wonder whether the increasing popularity of Ruby for web development has created pressure for Ruby to compromise its original philosophy. 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 big time. Most 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). 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 most Ruby jobs and the majority 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 :-))
- jamesgeck0 14y ago> But Ruby has missed the boat on being a popular, general programming language in the way Python is big time. Why do you think this is? My biggest hurdles were documentation quality, frequently flaky Windows compatibility (not necessarily in core, but definitely in a ton of gems), and figuring out to deal with the volatile nature of many gems (New Ruby versions are awesome! Monkey patching is awesome! API compatibility between versions is lame). It seems like it's almost a cultural issue.
- webjprgm 14y agoI originally avoided Ruby, back at the beginning of Rails's popularity, simply because Matz admitted it was slow and he had no intention of making it faster. It has improved now of course, but I still have something lurking in the back of my mind that says Python is faster than Ruby. Documentation is a huge thing. I found the docs difficult to navigate, and only in the last few months (whenever the latest change was) are they easier to navigate. But the descriptions are still pretty spartan and it's hard to find what function your looking for if you don't know what it's called. The way names are chosen doesn't match with my experience from other languages (Java, C, PHP, Scheme). So I tend to use Stack Overflow a lot more than the Ruby docs themselves. A good book helps get past the hurdles of knowing what function to use for what. However, the only real examples in the Ruby books I've read are in Rails books. So that might be part of the cultural issue jamesgeck refers to. Poor docs + book focus on Rails means you can only learn Ruby for the purpose of Rails, and that typecasts it as a web language. Note that PHP is stuck as a web language even more than Ruby. PHP is meant to be one, of course, but it's still usable as a general systems scripting language. I've written a nightly cronjob billing system in PHP since then the web frontend, which was PHP, and the cron job back end could all share the same billing libraries. I've also written small compilers and other scripts in PHP. That was before I was very comfortable with Python and Ruby (and had most of PHP's standard lib memorized), but PHP still worked fine. I tend to use Ruby now for most scripts, except where other people require me to use Python, like where some shared team library I need only works with Python. So, there are at least SOME cases where Python is mandatory and not voluntary.
- broseph 14y agoJust for the record: I used Python at work because I had to; I'd rather have been writing Java. 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. 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.
- lucian1900 14y agoIt seems that it would be much better to hire less and better programmers.
- sasha-dv 14y ago>People who write Python choose to write Python. People who write X choose to write X. 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++. edit: Didn't realize that people who choose a language different than Python aren't actually people.
- bryze 14y agoReally? Name high-performance systems programming languages besides C and C++ because I'd really love to switch.
- sasha-dv 14y agoDo you read English? edit: I can't reply to your reply so here it is: My point is that People who write Python choose to write Python. is as true as People who write X choose to write X. My claim is not that "Everybody who writes X chooses to write X"
- johndcook 14y agoI suppose there are degrees of how free your choices are. Do people choose to use JavaScript for client-side scripting? Technically you have other options, but most people write JavaScript whether they like it or not. I often write R, not because I want to, but because I'm working with people who don't know any other language. In that case I choose to write R, but that doesn't mean I'm happy about it.
- its_so_on 14y agoEDIT: 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. It is in this vein that I write... "Python is popular enough to have a critical mass of users" - on this point unfortunately I have to disagree. 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). 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.) 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. 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 OR 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 rocket 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. If this get smore downvotes I'll try the Python search on creating a gif file programmatically.
- gordianknot 14y agoI use Python at work because I have to, but I'd rather be writing JavaScript.
- swang 14y agoIn 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" 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. 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. 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. 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?
- postfuturist 14y agoProgramming 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. Here's what rubs me raw day-in and day-out: 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... 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.
- sausagefeet 14y agoI went through a similar progressions, or I guess I'm still in it. I have found multiple languages to replace aspect sof what I liked about Python but not one that addresses all of it. I think if F# existed on *nix in strong way I'd consider it a Python replacement.
- Jtsummers 14y agoWhat about OCaml/SML, or is .NET/Mono the thing that really sells it for you?
- sausagefeet 14y agoOcaml, as a language, is amazing. But it's implementation isn't much better than Python's. No parallelism for example. And its ecosystem is worse than Python's in many ways, such as building code. I love the language, it's just the implementation that makes it an incomplete solution for me.
- jsofra 14y agoI use Python at work because I have to, I would really rather not.