Live data from Hacker News

How Ruby is beating Python in the battle for the Soul of System Administration

devopsanywhere.blogspot.com

1–10 of 47 posts

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#2
I'm not persuaded that the arrow of causality has been drawn correctly here.

I.e., it seems rather that Ruby has gained a high profile in system administration, not due to any inherent characteristics of the language or library, but because Puppet and subsequently Chef happened to be written by people who wanted to use Ruby.

Based on TFA, this was a matter of taste. I can't, for example, see why it should particularly matter for system administration whether "‘len’ was a function instead of a method)." It doesn't. But the fact that the guy who went on to write a reasonably important tool preferred to do so in Ruby on the basis of such personal prejudices made Ruby important just insofar as the tool was important, and probably contributed to Chef being written in Ruby as well.

Most of the reasoning in this article is no better than complaining that len() is a builtin. I fail to see how Perl-golf style conciseness is inherently more "productive" (particularly when it makes it harder to understand and maintain operationally important software). I fail to see how the crushing burden of spelling out 'import re' makes regex unacceptably distant in Python. I fail to see how Ruby is inherently stress-relieving or better for people who use vi, and if you don't think there is magic in Python that is probably because you have not gotten that deeply into the language. All this is pretty spurious, I think.

And if I wanted Perl, then Perl is the best possible Perl, already familiar to tons of sysadmins; and lots of good things are happening in Perl development.

What isn't spurious is if you happen to like Ruby, even if only for stupid reasons like Luke's; or if you really want to work with a tool like Chef that requires you to write Ruby. Those are perfectly good reasons for using Ruby.

But multiple languages will be used into the far future. In reality, the reason that Ruby and Python (and for that matter Perl) are so frequently put head-to-head is because they are so very similar in their abilities. That's okay. Write what you like.

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#3
Neither Python nor Ruby are best suited for one-liners that the author is emphasising. One liners are bash-fu or commandline-fu. Anything above 100 lines (just a figure from the article) is what Python or Ruby should be used for.

Last 10 lines in a file? 'tail -10 filename.txt'

Right tools for the right job.

As to Python vs Ruby? I believe the argument isn't about the language (although I think Python is more 'sane' :) ), but the community that surrounds it. And I like the Python community.

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#4

I'm not persuaded that the arrow of causality has been drawn correctly here. I.e., it seems rather that Ruby has gained a high profile in system administration, not due to any inherent characteristics of the language or library, but because Puppet and subsequently Chef happened to be written by people who wanted to use Ruby. Based on TFA, this was a matter of taste. I can't, for example, see why it should particularl…

see my summary at the end. The real cause of ruby's rise is that puppet was written in it and that you use ruby-based dsl to configure puppet. This factor is more significant than language differences.

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#5
This article should have the following title: "How Ruby is Beating Python in the Battle for my Soul as System Administration". The summary shows that the person has not been working in a team to manage many components:

> Ruby's greatest strength is its amazing flexibility. There is a lot of "magic" in ruby and sometimes it is dark magic. Python intentionally has minimal magic. It's greatest strengths are the best practices it enforces across its community. These practices make Python very readable across different projects; they ensure high quality documentation; they make the standard library kick ass. But the fact is that we sysadmins need flexibility more than we need raw power or consistency.

As a sysadmin you insanely need consistency all over the place or you cannot scale. This is in fact why Fabric, Puppet and Chef were created in the first place, to have consistent and automatic ways to deploy on and maintain your systems.

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#6
post #3

Neither Python nor Ruby are best suited for one-liners that the author is emphasising. One liners are bash-fu or commandline-fu. Anything above 100 lines (just a figure from the article) is what Python or Ruby should be used for. Last 10 lines in a file? 'tail -10 filename.txt' Right tools for the right job. As to Python vs Ruby? I believe the argument isn't about the language (although I think Python is more 'sane'…

     Last 10 lines in a file? 'tail -10 filename.txt'
A lot uglier, but you can do a one liner ...

     ruby -e 'lines=[]; while gets(); lines 
The problem with using "the right tool for the right job" is that there are many tools and many jobs, and a general purpose language helps you get things done in case you're stuck. In general I use Ruby for doing string manipulation before piping to other commands.

Here's an (ugly) one liner that shows the biggest tables in a MySQL database:

     mysql -u root godzilla -s -e 'show tables' \
     | ruby -ne '$_.strip!; puts %Q{SELECT count(*) \
       as cnt, "#$_" as tbl FROM #$_; }' \
     | mysql -u root godzilla -s \
     | sort -nr \
     | ruby -ne 'parts = $_.split /\s+/; \
       puts "%40s : %s" % parts.reverse' \
     | head -10
You can probably come up with something more clever, but I barely gave that one any thought.

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#7
post #5

This article should have the following title: "How Ruby is Beating Python in the Battle for my Soul as System Administration". The summary shows that the person has not been working in a team to manage many components: > Ruby's greatest strength is its amazing flexibility. There is a lot of "magic" in ruby and sometimes it is dark magic. Python intentionally has minimal magic. It's greatest strengths are the best pra…

> As a sysadmin you insanely need consistency all over the place or you cannot scale.

This is exactly what ran through my had reading the bit you quoted above: consistency is king! Try scaling magic. Maybe some people are able to do this. I, personally, am a mere mortal, and that means consistent, clear code is a very powerful tool to me. More so than this "flexibility" the article's author is citing. In fact I would argue that consistency and clarity lend flexibility if you understand what you're doing.

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#8
post #3

Neither Python nor Ruby are best suited for one-liners that the author is emphasising. One liners are bash-fu or commandline-fu. Anything above 100 lines (just a figure from the article) is what Python or Ruby should be used for. Last 10 lines in a file? 'tail -10 filename.txt' Right tools for the right job. As to Python vs Ruby? I believe the argument isn't about the language (although I think Python is more 'sane'…

tac filename.txt | sed 10q | tac

Re: How Ruby is beating Python in the battle for the Soul of System Administration

#10
The short/one-liner examples are more likely to be done from command-line shell, where they would be much easier:

  head -10 /path/to/file

  dmidecode | grep -iq vmware && echo "is vmware" || echo "is not vmware"
The list of projects written in each language has more to do with what else you use than the languages, e.g., if you are working with Ruby web apps you may use Rake and Capistrano. SCons, Mercurial, Bazaar, and YUM are all written in Python.
Post reply on HN