Live data from Hacker News

Let's Write Some Bad Ruby

hashrocket.com

1–10 of 37 posts

Re: Let's Write Some Bad Ruby

#2
I have a scratch folder full of stuff like this written in whatever scripting language is closest at hand, ruby, perl, python, etc. I'd wager most people here would have something similar.

I wonder if it would be an interesting project to comb though it all and see if any useful tools could be extracted. Probably not, like the code in this blog most of my one-offs are unashamedly terrible.

Re: Let's Write Some Bad Ruby

#4

This is the sort of thing a combination of bash/grep/awk/sed is good for also.

True, but if you write Ruby all day and are most familiar with it, a script like this takes a matter of minutes to write compared to trawling the man pages of grep/awk/sed to implement the same thing you're only going to throw away after execution anyway.

Re: Let's Write Some Bad Ruby

#5
post #4

This is the sort of thing a combination of bash/grep/awk/sed is good for also.

True, but if you write Ruby all day and are most familiar with it, a script like this takes a matter of minutes to write compared to trawling the man pages of grep/awk/sed to implement the same thing you're only going to throw away after execution anyway.

Sure if you control the environment and can install Ruby. grep/sed/awk are always installed.

Re: Let's Write Some Bad Ruby

#6
post #5
post #4

Earlier quoted context omitted.

True, but if you write Ruby all day and are most familiar with it, a script like this takes a matter of minutes to write compared to trawling the man pages of grep/awk/sed to implement the same thing you're only going to throw away after execution anyway.

Sure if you control the environment and can install Ruby. grep/sed/awk are always installed.

Portability becomes a problem though. GNU vs BSD sed/grep :(

Re: Let's Write Some Bad Ruby

#7
post #5
post #4

Earlier quoted context omitted.

True, but if you write Ruby all day and are most familiar with it, a script like this takes a matter of minutes to write compared to trawling the man pages of grep/awk/sed to implement the same thing you're only going to throw away after execution anyway.

Sure if you control the environment and can install Ruby. grep/sed/awk are always installed.

Presumably, if you write ruby all day, there is a good chance that the environments you encounter have ruby installed, as well (and they might be even be Windows environments, in which case grep/sed/awk are not "always installed.")

Re: Let's Write Some Bad Ruby

#8
post #5

Earlier quoted context omitted.

Sure if you control the environment and can install Ruby. grep/sed/awk are always installed.

Portability becomes a problem though. GNU vs BSD sed/grep :(

They do have a shared subset of features defined by POSIX. It's limiting and takes discipline, but it's not really impractical.
Post reply on HN