Hacker News new | ask | show | jobs
by m104 2986 days ago
I'll second that sentiment.

The largest source of your tech debt may in fact be that brilliant one writing volumes of code destined to become the collective headache of future dev teams.

1 comments

Only building what is needed is only part of avoiding writing code. I'd say that during the first half of my career, I was completely ignorant of just how powerful shell scripting was for increasing productivity and reducing the amount of code that I would need to write and then later have to maintain.

One of the best pieces of advice you can give to a young developer is to learn about the tools already available on the operating system and how to build solutions by composing them via scripts.

It was really only after being a few years into a job where the primary development environment was OpenVMS with a crusty old manager that knew DCL inside and out that I fully understood - and boy oh boy did people think I was some sort of freak 10x developer when in fact I was just writing a few hundred lines of C to fill in the gaps between what I could get for free.

I really hate developing on Windows, but PowerShell is an amazing tool (I saw an interview with the creator who said that he started trying to do a UNIX-like shell but gave up when he realized that it just doesn't fit in the Windows paradigm. So he modeled it off of VMS. If you want PowerShell to act like bash, you're doing it wrong). The pipeline is passing around full .Net objects and the feature set is amazing. If you program Windows for a living and don't learn PowerShell, you're missing out on a lot of free productivity.

Lately, I've been using Linux more and am all in on shell scripting. I am following some advice I got to explore man pages more frequently and it is paying off. I even found an old System V printed manual and sometimes flip through it, finding random commands that I had no idea existed and thinking about how I could use them.

This is very dangerous advice. Modern Linux with systemd and mature programming languages require very little shell scripting. I saw people building deployment pipelines in shell and how ugly it was. I worked with a team doing batch processing in the shell and how many people where needed to make simple changes.
I absolutely love the Linux philosophy. Piping outputs means programs are functions. So I can combine programs to get what I want. The only gripe I have is that bash is a pretty hard language to read and write.
I'd highly recommend the xonsh shell for scripting if you're familiar with python: http://xon.sh/tutorial.html

Once you do tutorial and learn the rules for going between shell and python, it's super easy to slice and dice.

I have always disliked that moment of "yes, a shell script is probably the best tool for this job" that then leads me to banging my head against bash syntax for an hour. Python libraries like `sh` are great, but still a little high overhead. Now the twice a month I have to shell script I find to be pretty fun, and I'd highly recommend xonsh.

Great PyCon 2016 talk on it here: https://www.youtube.com/watch?v=uaje5I22kgE

I barf out intermediate state to JSON all the time now that jq is a thing.