Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a cultural issue. In the Ruby (or Perl) community, if you use obscure language features to do a common task in a single line of code, you will be worshipped as a god. In the Python (or Tcl) community, you will be viewed with suspicion. Not that Python doesn't have one-liners (e.g. comprehensions) - just that everyone agrees which ones and when and how to use them.


I've been working in Ruby for 3 years now, and i can promise you that unclear code is very much not appreciated by not only the people i work with, but all of the open source projects i'm involved with.

It is true that Ruby gives you a lot of rope. People with good design sense appreciate that your code should not be too clever.


Agreed. The ultimate goal is clarity. Everything else is subservient to it.


"This is a cultural issue. In the Ruby (or Perl) community, if you use obscure language features to do a common task in a single line of code, you will be worshipped as a god."

Just which Ruby community is this? None that I associate with, that's for sure.

To the people who voted the OP up; is it because of your own first-hand experience with other Rubyists? For all I know there are clusters of Ruby coders who encourage obscurantism, but I've not encountered them (though I've been part of debates over just what constitutes "obscure").


In Perl you have "wizards" and in Ruby you have "rockstar ninjas"... No other language communities do this.



Here are some stats from google on the relative use of obfuscation for perl, python and ruby:

<pre> Weighted use of Search Term Hits Search Term Hits obfuscation

"obfuscated perl" 1390 "perl programming" 164000 0.85% "obfuscated python" 234 "python programming" 157000 0.15% "obfuscated ruby" 269 "ruby programming" 133000 0.20% </pre>

If I use the word golf, I get: <pre> Weighted use of Search Term Hits Search Term Hits golf

"perl golf" 1780 "perl programming" 164000 1.09% "python golf" 171 "python programming" 157000 0.11% "ruby golf" 547 "ruby programming" 133000 0.41% </pre>

This is of ccourse, the same statistics that fueled the last financial meltdown :-)


You'll get that in a Perl Golf competition but the trend these days it towards much more readable and maintainable code. Which is why we have things like Moose (a better way to do objects).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: