Python up, Ruby down: If that runtime don't work, then its bound to drizzown 59
This past week, I switched from programming in Ruby to programming in Python. Why did I do that? Well, that’s a story with a bunch of background.
Coming to bat
I started playing with Ruby in 1999-2000 at Villanova for small stuff. I had read that seminal Dr. Dobb’s article by the PragProg guys. I bought the first edition of the Pickaxe book and then had to buy it again after I destroyed it from reading/referencing it too much. At one point there, I was running the first FTP mirror for the Ruby sources in the Western hemisphere. I also met David Black way back in 2001(2?) at a Ruby Tuesday’s (pun intended) in Trenton back when he was still a Communications professor at Seton Hall and I was still a college student. That was the only meeting of the “East Coast Ruby Users Group” ever held.
I thought Ruby had a lot of really cool concepts in it. (built-in coroutines, true OO, closures, heavy-duty metaprogramming, etc.) I also had little experience with Perl so I didn’t appreciate how similar they were. Villanova was a Java school and Ruby was like a real breath of fresh air compared to the Machiavellian verbosity imposed by that language. I was really just struck with the compactness of the language and how much you could pack into a very short amount of code.
Strike one
After school, I got an internship then real job with a local startup working in the now-hot email reputation/authority space. My boss there was also a Ruby fan and recognized its ability to really pound out some serious stuff in a very short amount of time. This is something you require in a startup situation.
We were using Ruby as a systems administration glue language at first here and there, but when we started building the SpamSquelcher prototype, we decided to use Ruby for its Web interface. We chose what was basically the only option for a Web framework at the time in Ruby, a compact MVC piece called Roach. Now that I go searching for the URL for Roach, I can see that it hasn’t moved even a patch ahead of where it was since we started using it. Funny. I think maybe IOWA was out at the time, too.
Roach was supposed to be MVC, but the “M” part was lacking as it had no integrated database functionality. However, for our purposes (controlling an embedded appliance), this did not matter at all so we had no issue with this limitation. Development went quickly, but there was a nagging issue with a memory leak. Every hit to the app server would irrevocably raise its memory usage and nothing we tried ever made a big difference. We could see no problem with the Ruby code itself, neither ours nor Roach’s, but there were no tools for diagnosing memory problems in Ruby apps. There still aren’t any.
We eventually had to just ship it with a hard memory limit under daemontools so that it would never chew up too much RAM on an appliance where RAM was already at a premium. So, when we became TurnTide the interface was rewritten in PHP and one of the reasons for it was this issue. I never did figure out what the problem was, either.
Strike two
So, later, a while after Symantec had purchased TurnTide, I was looking at ways to process our very large amount of data from the Brightmail and TurnTide streams. While we didn’t require anywhere near the truly massive powers that Google needs, I was (and still am) enamored by their internal architecture and sought to replicate that for our use. I didn’t find out about Nutch and Hadoop until much later. So, I basically rebuilt all of the functionality of Google File System and their Map/Reduce framework in Ruby in about 5 weeks.
However, it never actually worked. The tests passed and the functionality was good, in terms of correct Ruby code, but the “chunkserver” nodes would very rapidly just start using all the RAM on the box and freeze up when the filesystem became even moderately loaded. I was not able to determine the cause of this issue at the time and the project was cancelled. I came to find out later what its cause was but it was too late. This remains my only professional failure to ship to date.
Some light in this tunnel
It wasn’t all bad. Most of the Ruby I was writing was working out fine. It was small scripts to do this or that and the productivity was great. Its especially awesome for text processing because its just as handy as Perl but more readable when you want to reuse a script six months later.
Also, I wrote a small Rails app to manage our PXE installations of appliances in a day that saved us all any more trips to the server room to reinstall a box. That was a big boost. Rails is pretty great framework and I wasn’t even using it for the kind of thing it was designed for. (no RDBMS in my app)
Strike three; you’re out
Segue to this past week. I was writing a internal cross-platform utility to do some HTTPS communication and it had to run on multiple platforms, including Windows. Most of our people run Windows, so supporting this platform is a stone-clad requirement. I had finished the utility in a pretty quick amount of time and was planning on packaging it up for Windows with rubyscript2exe. However, when I started testing on Windows, I found that the program would just hang when it got to the final HTTPS request.
Turns out that the One-Click Installer version of Ruby on Windows has a known (!!) problem with combinations of Ruby threads and I/O. Given that the net/protocol.rb library that underlies all of Ruby’s standard Internet protocol functionality wraps most calls in a Timeout::timeout() call and that call is implemented with a Ruby thread, the problem seemed pretty large. But, I found a post denoting the problem and indicating that Ruby built under MinGW did not exhibit this issue.
I think, if you’ve read this far, that you can probably tell that it, in fact, does exhibit this issue. Both the binary package I downloaded (ruby 1.8.4) and the one I built from source under MinGW/MSYS (ruby 1.8.6). I posted to ruby-talk about it here, citing the hope-rendering link from ruby-talk about MinGW.
Enter the Python
At this point, I was looking at having to do some serious Ruby internals hacking on a platform that I know little to nothing about or rewriting the utility in a different language. I was T minus 2 days to deadline. I chose the latter and was able to rewrite and finish the whole thing in Python in a day and a half without ever having touched Python before.
Obviously, most of the speed of this rewrite was due to the fact that I was merely porting it to Python from an existing Ruby implementation. I am not making any claims of Python having greater productivity than Ruby in the development cycle. I am claiming two things, though:
- Python was very productive, despite having never used it before, and
- The end result actually fucking worked
That last one is kind of big with me.
Python? Really?
I had given some thought to doing the rewrite in Perl but two things stopped me from going that route. I really did not want to have to support any Perl code over any length of time as it really (to me) is a butt-ugly language and is mnemonically taxing. Also, the perl2exe compiler to produce Windows executables costs money. Python has the py2exe package that did the job very nicely and is free. C was obviously out due to time constraints even though I know that language better than any other.
Plus, Python seemed a more natural fit for a port from Ruby as I knew it contained most of the high-level constructs I had come to love in Ruby. There was only one function that I had to truly rewrite due to Python’s lack of “blocks”, or one-way coroutines.
I had heard at some point in the past that Guido was planning on getting rid of the map(), filter() and reduce() functions in Python 3000 and always wondered what he would want to do that for. Now I get it: Python’s list comprehensions can perform all of those jobs in a natural syntax.
The regular expression support is not as natural as Ruby’s or Perl’s but its not significantly more verbose or hard to work with.
My only beef was the lack of YAML support in the Python standard library, but I was using YAML in Ruby for a configuration file and Python’s ConfigParser turned out to work just fine in its stead.
One thing Python has all over Ruby is documentation. I used the Python docs from python.org almost exclusively and that was good enough to get the job done. Their documentation is first-class and this is an area where Ruby knows it needs to catch up.
And, there are a bunch of things available to a Python guy that Ruby just can’t compete with that are of particular interest to me. Two that come to mind immediately are Twisted and Stackless Python. The former was used by others at TurnTide for creating a really powerful SMTP testing tool and the latter was used by TurnTide’s competitor IronPort to build one of the industry’s best MTAs.
Along this same vien, I had previously tried creating a binding for Linux’s epoll(4) facility for Ruby but was stymied by Ruby’s internal workings. A far better programmer than I also fell victim to this same issue.
The Fundamental Issue
In case you somehow missed it, the fundamental issue above in all three of the problems was the Ruby runtime. I have no qualms with the language and I think its got tons of great things going for it. However, the runtime sucks. I’ve said this privately for some time but now I’m going on record.
The community seems to realize this and is moving in a number of different directions, most notably the YARV runtime. However, I fundamentally disagree with this direction. YARV will remove two of the awesome features of the language, continuations and green threads, and it will keep the same GC model. This makes no sense to me, as the GC is clearly one of the weakest parts of the current runtime. As well, Erlang and Stackless draw their powers from NOT supporting native threads as part of the language and they are far better suited to the future of heavy concurrency than Ruby. Rubinius is far more interesting to me, but they have a much longer climb up the hill towards usefulness.
What about the Twitter phenomenon?
Some might say that I should have stepped up and fixed the issues I was having and not just complain about them on my blog. To them, I’d say that in the first two cases I tried and in the third I didn’t have the time. I’m not taking a “wait and hope” attitude like some others, hoping that someone else will fix my problems. I’m circumventing them altogether. Above all other things professional, I have a job to do and employers to report to.
And furthermore, for me, programming languages and their runtimes are tools. I think they are for a lot of us. You wouldn’t continue to use a hammer whose head keeps flying off when you take a swift backswing, would you?
So, no more Ruby? Really?
I will probably still fall back on Ruby for text-processing scripts as its always been stellar for those kinds of tasks. But, I have to say that any real software I write will no longer be in Ruby for the foreseeable future. I am discounting Rails here: I think Rails is great for what it is and I’ve had nothing but good experiences with it precisely because it is so “opinionated”. Its a very productive environment and manages to successfully avoid the runtime problems that I’ve personally hit in the past. I hope that the Ruby community can really bang out a worthwhile runtime in the coming year and if they do, I’m back on board. If I get some time, I might even help out where I can.
For now, though, I am looking forward to using more and more Python and getting to know that language, as well as some Erlang in there somewhere, too. I have the beta of the new Armstrong book and am tearing through it with the same rapaciousness as I did the first edition of the Pickaxe.
A very interesting post, with some excellent links (first I’ve ever heard of Hadoop, I must confess). Thanks!
Toby, thanks for that insightful post.
Could you explain why you consider pure user level threads superior to native threads?
It would interest me most how they are more powerful on multiprocessor and multicore systems. Additionally, I always thought that user level (“green”) threads are a performance bottleneck if you do blocking system calls (such as reading files or blocking network communication).
I’m afraid you were unlucky in finding perl2exe from active state software rather than looking on CPAN – the free (in both senses) pp from the PAR toolkit works fine for win32 executable building (http://search.cpan.org/~smueller/PAR-Packer-0.973/lib/pp.pm)
OTOH, if you find python easier to maintain and you’re the one who’ll be maintaining it then your decision is obviously the right one in spite of pp’s existence – but please don’t mistake active state’s commercial stuff as being the only perl tools available for those purposes :)
I’m not really a Ruby fan myself, but have you thought about JRuby? You’d get a much more reliable garbage collector at least. The threads are not green threads, but IMO green threads are not an advantage.
It’s unfortunate that you had issues with the Ruby runtime – I haven’t heard of too many problems with it. Maybe it’s just bad timing.
It’s also unfortunate that you have such a strong dislike for Perl. I wish I could share with you the pleasure it’s been for me to use it over the years. It’s understandable how someone unfamiliar with its history lacks appreciation for all its gems or finds it ‘mnemonically taxing,’ but snarky comments regarding Perl’s readability “six months later” make me cringe.
Despite the TIMTOWTDI mantra, there is a Right Way to do things… and seasoned programmers know this. Not once have I blamed a language for a program’s maintainability issues. I recommend using Perl, or any other language, as you would a blow torch – wisely.
- sili
I use Python where possible these days – on all platforms. Check out Django for MVC.
Good article.
Ruby’s run-time is immature, but the language itself is a serious improvement over Perl (horrid OOP implementation) and Python (editor-dependent notation, clumsy REGEX implementation).
You made the right choice given your circumstances. That’s what software engineering is all about. A commercial commitment is the antithesis of “open-source evangelism”. Mistake #1 was insisting on your favourite language as the only tool in your kit.
What is “stone-clad”? Things are cast in stone or they are clad in iron. “Clad in stone” is senseless but would probably pass in a marketing meeting. :o)
I appreciate a well stated article such as this. I too came to python but not from Ruby (though I had been writing some simple code in it) but from Perl (after 7 years primarily coding in it professionally.
Without going into great detail I can say that Python, while initially repulsive to me, won me over with its power, speed and design.
Ultimately I ended up contracting for a large retail chain re-writing their point of sale register merchandise returns system in Python. It now runs 365 days a year in over 400 stores and I must say that the development time was minimal with wonderful, reliable results.
The ability to deliver optimised byte code only right out of the box was an especially nice perk. I knew that compatibility over a wide variety of deployed OS arrangements wouldn’t be an issue, nor would the heavy use of the Oracle 10g/Solaris server combinations.
I welcome you to the Python user-base and hope to see more writing on your experiences in the future.
Sincerely,
Eric Elinow Software Engineer
perl is awful
Jython! Do your comprehensions with Java objects! Its oldish (python 2.1 / 2.2… although recent alphas have generators!), but it is simply amazing what you can tie together with the simplicity of Python code. I’ve used it with Processing (P5 or Proce55ing), the Jena RDF libraries, ssh clients, J2EE web servers (creating a full fledged .EAR!) and had lots of fun, too, whilst integrating.
Say it ain’t so, Toby! Say it ain’t so!
Either way, I hope you’ll still come to the PubNites. I’d really miss your company if you stopped.
Great article. Tons of insight and wit as always. Thanks!
“Stone clad” does make sense in the context of concrete buildings with stone cladding. I’ve heard “cast in stone” but it does not make sense now that I think about it. Iron is cast however. I would think iron cladding of battleships went out of style a long time ago :)
A warm welcome from a long-time Pythonista. :-)
> I will probably still fall back on Ruby for text-processing > scripts as its always been stellar for those kinds of tasks.
You probably didn’t bump into PyParsing yet. ;-)
It’s a pity some don’t get the brilliance of significant indentation.
Last but not least, always beware of preemptive multithreading, whether native or user level. There’s a reason why Twisted and Erlang are what they are.
So will Twitter.com be rewritten using Python?
Great article, Toby. Although I love Ruby, I think it’s time to move on to something else myself for very similar reasons.
Great article! I am rather scared to post this on Ruby Inside however ;-)
In any case, it must be good as you have now, for perhaps my fourth or fifth time, got me to take a serious look at Python again.. and this time it’s actually starting to make a lot of sense..
So Ruby is a better language and Python has a better runtime. You probably could say the same for Python vs Java.
Is it likely the Ruby will get a better runtime or Python get a better syntax – while maintaining backward compatibility? I guess we’ll have to wait and see.
I do agree that you should use the best tool for the job but with the caveat that everyone would be using hammers if new tools weren’t invented – stone-age or stone-clad?
I think competition is good but I think on some level it is delaying what I think will become the next popular development platform – dynamic languages. Who really has the time to master 2 or 3 of these things anymore and convince the company that they are working for to use them? So should the Ruby guys all move over to Python to advance Python and leave Ruby for dead?
Ruby for me has made programming “fun” again – I wonder if I will/would have this same experience using Python? Certainly it would be better than Java which after 4 years left a nasty taste in my mouth and sucked the joy out of programming,
Go Nova! Excellent post Toby!
I read this post purely for the Snoop Dogg reference. =)
I’d call myself a python programmer, though I’ve played with Ruby now and again, mostly for text processing. I think you hit the nail on the head when you said its all about choosing good tools. Someone else may have a task that requires the hammer head to fly off…for them its great!
> Roach was supposed to be MVC, > but the “M” part was lacking as > it had no integrated database > functionality
FYI: The M in MVC does not imply ORM.
So Ruby is a broken hammer? I guess that is close to a pick ax.
If it is that broken – it took me 6 months to feel “productive” in Ruby coming from Java – how long will it take in Python?
Very interesting post.
nice name dropping.
this post is riddled with crazed name dropping and technology hopping insanity.
why would you cry foul that a windows .exe that you compiled from a non-standard executable maker (rubyscript2exe) didn’t work the way you expected on a windows system?
Did the original Ruby creators create that tool? NO. So why would you judge your Ruby experience on your lack of knowledge of to make a windows executable? Windows executables no matter where or how they are compiled are far from stable, and you can’t blame Ruby’s language or run-times for a Windows issue you had.
To that, it seems all of your experiences are based on your view that technology should be magical, in that random sites you download random software that is used for simple tasks, should work 100% of the time for complicated concepts you just happen to try out one day on a windows system.
That is some very irrational thought you are analyzing your Ruby experience with.
I see this often with Java aficionados of varying types that expect the world to align perfectly in some rigorous planet alignment where Windows applications always work, and one true messianic language will appear to you.
what bull.
If you are in a JVM environment, check out Groovy. Should solve your cross platforms issues.
Great writeup. I have to say that I agree with a lot of it, but I’m still a Ruby guy. I used python for quite a while, and I can’t stand that whitespacing, lack of ternary operator, lack of ||=, and the lack of a regex type that perl and ruby have. Otherwise, I would probably switch too, but this is ridiculous:
<pre> expression5 = re.compile( r”t[aeiou]”, re.I ) </pre>
Compared to this: <pre> expression5 = /t[aeiou]/i </pre>
Maybe if Python quits forcing spacing on me I’ll switch, but until then, it’s perl, ruby, and PHP for me.
I found this very interesting, considering that I came to Ruby by way of Java, then Python. For me, the expressiveness of the language outweighs the differences in runtime performance, but even a serious Ruby partisan like me can see that the collection of bolted-on chunks of C being used to work around issues in the core runtime (fastthread, mongrel, etc.) is starting to get unweildly.
I think that JRuby and Rubinus are going to drive a lot of innovation in the Ruby runtime space, but Rubinus in particular just isn’t there yet. For the time being, I’m starting to empathize a lot more with those poor Perl folk I’ve heckled so mercilessly over the last five years or so while they waited for Perl 6.
The whitespace complaint is incredibly naive to a Python programmer. Perhaps it’s like a leap of faith, once you trust Python it becomes second nature.
However, it will be interesting to see what happens when PyPy becomes ready for prime time. You’ll be able to program with just about any language and run it with a custom Python runtime.
As someone who’s a big (but objective) Ruby fan who’s taken a look at Python a few times and is now seriously considering using it in several projects.. I see a big gulf between the two and a big opportunity for collaboration.
Python appears to have a significant lead when it comes to integration, low-level stuff, writing network daemons, and the really “tight” programming needed in many situations. It also seems to have a MAJOR advantage when writing GUI apps due to its native threading support and better GUI library integration (even Apple have tutorials on using Python and PyObjC to make OS X apps) compared to Ruby’s nasty GUI libraries.
Ruby, on the other hand, is more flexible, seems to have a cuter, fun-oriented community with a “TMTOWTDI” attitude and a real attitude for getting things done albeit not in the most standard ways possible.
For my part, I think I’m going to get into Python for the low-level daemon stuff and the ability to write decent GUI apps (my attempts in Ruby have been a nightmare), but I’m sticking with Ruby for anything self contained, or for Web apps.
I mean, if both a Ruby app and a Python app are talking to a MySQL database.. who cares what each part is written in, right? There’s a lot of room to use both technologies, particularly in the Web 2.0 sphere where you could write, say, a feed reader in Python, but have a Rails app provide the view, etc.
And.. I finally think I dig the whitespace thing in Python, but for that piece of elegance, of course, you have oodles of verbosity that Ruby doesn’t have (endless use of ‘self’ being one).
@Peter Cooper
I vote this goes on Ruby Inside :)
We can’t fix problems we try to hide.
@asd:
I believe the idioms are “iron-clad” and “set in stone”, meaning respectively armored with metal and embedded in rock.
For web applications, go PHP. Twitter.com will be much more scalable if it is written using PHP. People behind Twitter has chosen a wrong technology. Both Python and Ruby is not good web solutions
Really interesting post and seemed to be very well thought out. I’ve been using Ruby and Rails professionally for just under the last two years and (luckily) haven’t run into the major issues like that yet.
I do think it’s time for me to spend some time learning another language though and i was planning on spending some time at the end of this year to try out Erlang but your post was convincing enough that I think I may add Python back onto the list of possibilities.
As someone who’s worked to some extent in both Python and Ruby, here’s my 2c (not really much related to the points in the original post, just sharing my thoughts …):
Having to use self a lot in Python is a bit of a pain – I agree.
Apart from that, though, the readability of Python code is, IMO, really high – reasonably well-written code reads almost like English. I feel that this is a good benefit, but not one due to which I’d give up Ruby. Ruby’s readability is quite good too, but it trails that of Python to some extent, due to some of the additional special characters it uses (and I don’t mean regex characters).
Vasudev Ram http://www.dancingbison.com http://sourceforge.net/projects/xtopdf
What a bunch of crock. I’m a C++ & PHP (if you could say that) programmer and I know a bit of Java and Perl, who is learning Ruby right now. It’s great. I’m truly in love.
My Python exp. is limited to what I learned in school and I was too impressed with it, but I will not judge based on that.
What I will ask thou:
1) Why do you blame your lack of knowledge on tools? In your own post – you blame ruby for striking out – but then you mention that you didn’t solve <b>your</b> problem till later?
2) You mention that you are using the language and framework (btw you use framework and language interchangeably in a couple of place – and they are not the same) for something that they weren’t designed for. Again how is it Ruby problem.
3) Ruby is known for problems with memory management in certain cases. That is why it is mostly used in a context of web developing and small scripts (ie cron) – why would you use it for a mission critical stand alone application??? There is perl & C++ and pletny of other languages for that. I wouldn’t use python for that – just look at Civ IV if you need reasons.
Nice write-up Toby, but you know I’m gonna have to rewrite your app as an obfuscated Perl one-liner in the shape of your head now.
Ugly? Sheesh.
Seriously though, I’m surprised your interest in GOOG hadn’t turned you on to Python earlier.
Now you’re a Python guy, you should check out Bob Ippolito’s blog: http://bob.pythonmac.org/
He’s the dude behind my favorite Javascript library, MochiKit.
Great post, greater title. I’m new to Python from PHP and I’m loving every minute of it. Love to hear more about your Python experience, especially beyond the web.
Rather than writing a cheap rant that is intended to drive traffic to your blog and start a flame war, why not contribute some code to Rubinius or even some dollars?
You mentioned that Ruby is a better language but has some runtime quirks that can cause problems for cross-platform or high performance uses…
Punchline: Ruby is a great language for 98% of programming tasks.
I have tried to learn Python and found it almost as annoying and counterintuitive as Perl, while I learned Ruby quite well in a few days.
Great run down on the issues Toby, and it was even easy for me to understand – even though I’ve been out of coding for a few years.
Now I’m looking forward to seeing the end results! :)
Thanks for this post! I was playing already a while with the idea to turn away from PHP to Python, because i need more then PHP can provide (even with it’s CMD capabilities). But i was also looking after Java (despiting the fact that i know about the issues you mentioned in the begin of your post) and so i searched for a comparision between Java and Python – so i came here. Ruby was for me never an option because it is for me nothing more then PHP – just in another Language. Now i just need to take my time to change little after little to Python, and like you said, the manuals provided are very good (like i’m used to by PHP). Greetings!
Regarding not wanting to have to support the Perl code long term: Perl code written to today’s best practices looks good. The bad rap Perl gets is because of some of the bad old stuff floating around out there with all package globals and no comments.
As for it being butt-ugly, ... I can only guess you mean mean something about the structure, because the syntax seems nice enough.
One comment I don’t get at all is that it’s mnemonically taxing. The Perl keywords and function names were very carefully chosen, and they seem to make very good sense to me. Maybe there’s a lot of them, but many look like they do on Unix anyway. And besides, you’re either learning top-level function names, or else wads of method names—take your pick.
Whoops. Hope I didn’t sound like a fanboy there. Perl’s got its problems too (ex. I try not to go near typeglobs or ties, and Perl OO takes some work to get used to. Also threading with Perl doesn’t look like a picnic either).
Anyhow, great blog article. Thanks for writing. :)
Great post Toby.
For many people Ruby’s syntax and SmallTalk-ish-ness is the real draw. You can often write code better and faster in a language that feels right.
I don’t like Python’s syntax, especially having to use the word “self” when defining classes. However, a lot more effort has gone into Python over the years and it shows. Python is ready for prime-time in most any area you need it to run.
Ruby isn’t to this point yet. It will take years for it to get there.
So for now, Python is the #1 scripting language for all purposes in all places. It’s combination of being easy to read and it’s efficient vm and libs, make it hard to beat.
PERL is, of course, unacceptable because only a few people on the planet can actually read and understand a PERL script they themself wrote 10 minutes after writing it;-)
<a href=”http://teenwag.com” rel=”nofollow”>Teenwag</a> was first built on Ruby on rails. It took 3.5 months, and then it was ported to python in a mere 2 weeks, RoR is a toy …. :)
http://teenwag.com
@teenwag:
You mean to say it took you 2 weeks to port it after you’d already established the design, functionality and UI in your Rails app.
Porting is distinctly different to starting from scratch.
Many of the languages discussed here are ad hoc, informally specified scripting languages developed by groups on the margins of computing. I guess they’re ok for a quick script but building full on apps out of them verges on the irresponsible. Consider using languages like scheme, haskell, ml or erlang. These all have deep roots and are extremely powerful.
I dont know ruby – but I wasted years on perl (and shell/awk/sed ) then python before I saw the light.
Perl is not unreadable. People can not read it. These statements are not equivalent. Cyrillic script is unreadable to me, but of this does not mean that those languages are not to be used. There is the nauseating stench of dogma that is beginning to permeate the language continuum. ( Rails fanboys, “Perl is unreadable” whiners, i am talking to you ). Unsurprising, since dogma is making a big comeback all over the West. Unecessary. Perl’s problems are it’s internals, and it’s memory usage, understandable given it’s roots. I love using Ruby, and I love this article. I’ll still use ruby ( offloading to Erlang of course to avoid having my bra snapped under heavy load… ) however, it’s good to see intelligent critique of Ruby. I think these problems are fixable, or have workarounds ( Perl/Python better on windows, even though Perl is a distillation of unix mentality for example )
NOOOOOOOOO! I’m about to swing for strike three too! I pray that the issue is only for HTTPS and not HTTP. Otherwise, I will have to switch to Python too :(
A correction to the common misconception repeated in comments 33 & 42: Using ‘self’ to access instance parameters is a standard convention for public code but it is not required. ‘Me’, ‘this’, or any non-English equivalent, or simply a minimal ’s’ works fine. That is a small price for consistency of name reference.
And welcome to Python from an occasional user. One reason the core runtime is pretty solid is that Guido has tried to keep the codebase relatively clean, organized, and maintainable, even if it means rejecting a patch or requiring a rewrite.
“Many of the languages discussed here are ad hoc, informally specified scripting languages developed by groups on the margins of computing. I guess they’re ok for a quick script but building full on apps out of them verges on the irresponsible. Consider using languages like scheme, haskell, ml or erlang. These all have deep roots and are extremely powerful.”
They are, but your main point seems to be either a troll or flamebait to me. You seem to be suggesting that Ruby, Python, PHP and similar languages are little-used fringe languages, when in fact it’s Haskell, ML and Scheme that are rarely used for actual applications.
Academic success and rigor does not equal large uptake. Even Ruby’s tiny ecosystem is like the Western Cwm compared to Haskell’s.
...
And Perl’s problems aren’t just its internals.. its absolutely horrid support for object orientation is the biggest issue. It feels like stepping into the stone age to do things like length($string) rather than $string.length.. and I’m a Perl fan!
I enjoyed your post. I work quite a bit in PHP and have recently been considering playing with Python. Any suggestions on how to get started?
Thanks.
Python for HTTPS? Last I checked, urllib didn’t actually check the server certificates—making the encryption essentially worthless. You might want to check that…
I am also a ruby expat that moved to python. Originally from java, then found rails, then found django! Django just felt like home for me I guess. Keep an open mind!
begun it has!
“Ruby for text processing” ... everybody seems to say that every language is good for text processing: Python, Ruby, Perl, Awk…
> Any suggestions on how to get started?
Start at the beginning: http://docs.python.org/tut/tut.html
Also, as for books, Alex Martelli’s Python in a Nutshell is very good.
I’m wondering where you will head to after Python… ;-)
Teenwag was first built on Ruby on rails. It took 3.5 months, and then it was ported to python in a mere 2 weeks, RoR is a toy …. :)
I’ve never really understood why there are so many out there who flame Python so quickly… it’s always nice to come across someone who recognizes it for the potential gains you can get.
One of the largest benefits, I think you touched on nicely, is the number of libraries available for Python. The Twisted framework is great, and there are so many others too.
Welcome to the world of Python! :)