3 ms·
Kinda side-topic, but: why do most "hacker advice" tend to recommend Python over Ruby or Perl (ok, Perl is "just old") as a beginner's scripting language? I lov
by nnq 14y ago
Kinda side-topic, but: why do most "hacker advice" tend to recommend Python over Ruby or Perl (ok, Perl is "just old") as a beginner's scripting language? I love Python and I like using it in production better than Ruby, but Ruby is much more of a "hacker's language" and pushes you to more "lispyness" in spirit and practice! (I admit I'am a bit of a Python ecosystem fanboy, with all the cool and easy to use machine learning tools and libs, but this state of affairs is a bit unintuitive - and I'm looking at this types of questions from a language designer's perspective too as I'm working on a language that has 99.9% chances of not tacking over the world, but that 0.1% is enough to "make me high" and keeps me banging my hammers on until I get to something that I can show to the world).
- wuest 14y agoMost "hacker advice" articles are old. Ruby hasn't been popular for all that long (I started hacking in it circa 2004, and I was a very early adopter, on the broader scale).
- Xion 14y ago> (...) but Ruby is much more of a "hacker's language" and pushes you to more "lispyness" in spirit and practice! Which, I think, is one of the main reasons why Python is recommended more: it's simpler and has less sharp corners. The other thing is that Ruby is significantly slanted towards the object-oriented paradigm while Python remains much more neutral in this regard.
- 3pt14159 14y agoPython is more powerful than Ruby. You have more meta-programming options available to you and a far, far wider scope of tools (scipy, etc). Python also naturally can lead you to c/c++ through cython as well as idiomatically functional programming (partials, function passing, decorators) far easier than Ruby (since in ruby parans are optional).
- nnq 14y ago> as well as idiomatically functional programming Intuitive as this may seem, it ends up being the opposite: you'll see more "functional-like" code in Ruby codebases. A simple think like Guido considering multi-line lambdas "a Rube Goldberg language feature" [1] and rejecting them was sort of a butterfly effect that pushed real-world ruby codebases away from functional programming. Same as the nice-looking block passing syntax pushed Ruby in the opposite direction! And makes Ruby DSLs easy as pie (though I find DSLs a bit against the "hacker spirit" - any tool that's less "general purposes" ends up "limiting your mind" - take Rails which is a giant "meta-DSL for web apps" imho). ...though I still recommend Python to wannabe "hackers" for the same reasons you said above, I find myself, as a "real-world hacker", enjoying Ruby more. [1] http://www.artima.com/weblogs/viewpost.jsp?thread=147358 http://www.artima.com/weblogs/viewpost.jsp?thread=147358
- nnq 14y agoBUG: it's "python" not "ruby" in "pushed real-world ruby codebases"