Hacker News new | ask | show | jobs
by AlchemistCamp 2005 days ago
I've been using Phoenix rather than Rails as my go to for web development, but I still use Ruby shell scripting. It's dramatically faster to write than Python, Go or Rust, largely because it's got more convenient Unix interop than anything since Perl.

One example is, I've written a script that I can pass a domain name and an email address to. It will then set up basic nginx blocks, install certbo and add a cron job if needed, run certbot, get an https certificate and reconfigure the nginx blocks to reverse proxy incoming requests and force https.

I have no idea what language would have let me write this faster than Ruby did. Maybe Perl if I knew it well. Definitely not Go or Rust.

2 comments

Ruby started as a shell scripting language so I agree that it is good for that purpose. However the question is how much time one spends writing shell scripting code for personal use. If someone already knows Python and only occasionally writes shell scripting code then in my opinion learning a new language only for that purpose isn't a good investment. I would say Python is good enough for that tasks.

In other words if someone has a good enough tool in their tool-belt for a certain area, then learning another slightly better tool in that area is not a must.

In my opinion it is better to be proficient in a one language than mediocre in two similar languages. If someone is bored and has time to learn both Python and Ruby then why not.

I'd say Ruby's edge for shell scripting is considerable, but I agree with that strategy and recorded a whole video on the idea: https://youtu.be/bIpgUmn5yK8

tldw; Pick tools that complement each other rather than compete with each other.

Also it's interesting that some languages like C or JavaScript make a good complement to almost anything.

As much as I want to learn new languages, it looks like my brain is not cooperating. Either the syntax is hard to read (eg ruby or elixir) or articulating the same solution (eg python) in Javascript much easier.

Any suggestions on which practical language to complement Javascript for web dev? Also, use cases for functional programming language, is it even useful?

This is essentially my situation exactly!

Ruby is a fine application development language, but an incredible scripting language. Can't recommend it enough for that niche. Nothing else is even close.