Live data from Hacker News

Ruby is beautiful (but I'm moving to Python)

wit.io

51–60 of 68 posts

Re: Ruby is beautiful (but I'm moving to Python)

#51
post #6

I never really understood the drama around switching tools. Picking the right one for the job is the first thing you should do.

From "Don't Call Yourself A Programmer..."[0] recently seen on the front page: Many asked how to know what programming language or stack to study. It doesn’t matter. There you go. That's how I feel about this post -- it doesn't matter. The points he raises -- either as complaint or as praise -- seem shallow. It's not a very sophisticated critique of anything. [0]: http://www.kalzumeus.com/2011/10/28/dont-call-yoursel…

> Many asked how to know what programming language or stack to study. It doesn’t matter. There you go.

That relativist thinking is not appropriate. If everything is a matter of personal taste, then constructive discussions are not possible anymore, and become as interesting as small-talks about the weather. It is the end of thinking.

Re: Ruby is beautiful (but I'm moving to Python)

#53
post #41

What he says about higher order functions rings very true for me. I learned Python before Ruby, and while I love using both languages, in Ruby I really learned for the first time the power of higher order functions because they are thrown in your face when using it. They are everywhere in the standard library and the syntax makes them very convenient to read and write. They are idiomatic Ruby. Once I learned Ruby, I…

[deleted]

Re: Ruby is beautiful (but I'm moving to Python)

#55
post #5

The follow up http://wit.io/posts/the-ugliness-of-python is in my opinion, more interesting. I always find it funny how different people think different languages are ugly.

Yeah, I have the opposite reaction. I think python is very elegant, and I really appreciate it's "one and only one way" philosophy, as opposed to ruby's "you are a special snowflake" approach. It really can be just a matter of preference, though. Python and Ruby are so, so, so similar, that ultimately I find flamewars between them to be tiring at best.

My general feeling coincides with yours, I can't see how someone can look at Ruby and say it's consistent, although it's not the up to the insanity of C++ or Perl (people only make it that way with a combination of poor judgement and dynamic metaprogramming). It does have some quirks that are at times convenient, but this whole notion of "consistency" in Ruby makes me suspect whether I can really understand where the author is coming from.

Re: Ruby is beautiful (but I'm moving to Python)

#56
You are right, Python package management is terrible. Even using an OS package manager (on Mac) like Ports or Brew it's still a nightmare.

The other problem is fragmentation. This package requires python 2.5, that one wants python 2.6, and that one wants python 3.1 but might me ok for python 3.2.

It's just a mess. And confusing.

Not to mention, even installing python on Mac can be a nightmare. One piece of advice, if you are going to use python on a mac get py-virtualenv (http://pypi.python.org/pypi/virtualenv). It's as good as rvm (in ruby) and will save your life.

I miss GEM terribly.

But despite the shortcomings (maddness) I still LOVE python. :)

Re: Ruby is beautiful (but I'm moving to Python)

#57
post #19

I wrote this article almost a year ago as a tribute to my favorite language at the time. (That title now belongs to Clojure.) It feels like if you want to do scientific computing in Ruby, you're met with obstacles at every turn, but with Python, you're greeted with open arms and tested libraries. That could change (and I'm beginning work on a stats library for Ruby), but it will take time. This was partially a call t…

have you tried Mathematica? in terms of abstractive power, i haven't found a more powerful language (it's 1 notch more abstract than Lisp) and it comes with a ton of statistics/science stuff and can import infinity different formats

http://reference.wolfram.com/mathematica/guide/Statistics.ht...

http://reference.wolfram.com/mathematica/guide/ImportingAndE...

Re: Ruby is beautiful (but I'm moving to Python)

#58
post #41

What he says about higher order functions rings very true for me. I learned Python before Ruby, and while I love using both languages, in Ruby I really learned for the first time the power of higher order functions because they are thrown in your face when using it. They are everywhere in the standard library and the syntax makes them very convenient to read and write. They are idiomatic Ruby. Once I learned Ruby, I…

> Ruby's metaprogramming facilities are dead simple compared to Python's

I actually have the opposite experience, Ruby's eigenclasses and the self way to handle them to create class methods feels convoluted and shoehorning whereas __metaclass__ and the way you inherit of Class feels straightforward to me. The same goes for modules extending/including behaviors versus sane multiple inheritance combined with metaclasses and the way you manipulate methods and functions just assigning them as attributes, without any need for three handfuls of helper methods. Ruby's approach of development is so pervasive that I (and not only me) always have to check if I won't be tripping on someone else's wires. When I tell that, the Ruby crowd shouts at me that Ruby monkey-patching is safe! So let's make it safer[1]! It honestly feels like needless complexity, over-engineering, or jumping through more hoops.

I know both approaches quite well but I can't help but think that the Python approach just fits in, like a self-solving Tetris, whereas Ruby feels like I constantly need to solve puzzles. Granted it's fun when you learn the language, drawing a picture of where classes, instances and eigenclasses of each fit, but when you want to be productive you just want it to flow, not solve another damn puzzle of how I can do this smartly so that things don't end up making galaxies collide.

PS: don't get me wrong, I actually love both languages, but while it's love-love with Python, it's actually love-hate with Ruby.

[1] http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-pra...

Re: Ruby is beautiful (but I'm moving to Python)

#59

Earlier quoted context omitted.

>Why do we constantly feel the need to wedge objects into everything in existence Because... it's convenient? Do we need a reason?

I fail to see how i.even? is any more convenient than even? i except that even? has now somehow entered into the set of functions worthy to be part of the integer-fake-object while others have not.

Because the former reads more like english.

I would ask "is 2 even?" but I would never ask "does the quality of evenness apply to 2?"

One of the things I dislike about python is the word order you end up with. My eyes have to jump about to work out whats going on. Its like german ;)

Re: Ruby is beautiful (but I'm moving to Python)

#60
Congratulations! The most silly article a read today. Comparing languages by the length of code is something an amateur would do, but not a professional.

Want to filter list with an "ad-hoc" function in Java? Use

Collections2.filter(list, new Predicate() { public boolean apply(Integer i) { return i % 2 == 0; } })

from the Guava library. To read a file I use

Utils.getFileContent("filename")

from my library.

You would say, that the Java verbosity is outsourced to external libraries — but so it is in Ruby as well. The only difference is that Ruby contains more libraries than Java. But does it count in a development of a huge professional project? NO. (You write the libraries once and use the package everywhere.) Does it count in script writing? Yes. But Java wasn't designed for script writing, so please please don't compare a fork and a spoon.

Post reply on HN