Hacker News new | past | comments | ask | show | jobs | submit login

Want to hammer a nail into a wall? Build a robot to do it! If you have lots of spare time, of course...



I've actually come to the conclusion over the years that automation is a form of optimisation, and that all of the rules of optimisation apply in full force.

Do you need to process a list of 10,000 things, once a day, forever? Then you do need to automate.

Do you need to process a list of 100 things, once? Just roll up your sleeves and start typing (or get someone else to do it). The chances that you could come up with something remotely reusable in less than the two minutes it'd take to do manually are slim to none, yet I have often seen people spend a couple of hours coding up a script to do a 15 minute non-recurring job.


Sometimes it helps to automate small things anyway, as practice. I've noticed that as I become more practiced with automation, even the small things take less time (and are less prone to error) than doing things manually.

It's also possible to do partial automation, where you just automate what's easy and finish up manually.


On the flip-side, people who rarely automate things, become accustomed to manually doing things and increasingly miss opportunities to automate/script their workflow...


I get your point, but a benefit of coding the script is it's frequently easier to verify the script is correct then to verify that the repeated operation you did by hand on the large list was done correctly for every entry.


100% agree. Also, if you need to add additional steps to your processing or make small changes to what you're doing then processing the 100 items again will be pretty fast compared to if you had done it manually.


Macros, regex, awk are the tools to quickly automate text processing. It literally takes less than two minutes in most cases once you’re proficient.


Honestly the amount of time I've saved just by throwing stuff into a text editor with multi-cursor support is kinda unbelievable.


Yes, this is the right thing to do very often, especially for one time tasks.

It’s not the thing you should do if you need to do it repeatedly, like once a day or even once a month.

This all depends on a lot of circumstances, and its hard to calculate time for implementing a script vs doing it by hand for a future you don’t know yet.


I often do a similar thing using emacs macros (I assume most good editors have a similar feature)


Step 1 - Let me try using command line magic to transform this data Step 2 - ?? Step 3 - Create a scratch file in IDEA and some cursor + regex magic and I am done!


And those regexes are the first part of an awk script or something similar which will save time when you want to do this repeatedly.

And when your awk script grows into something that doesn’t produce the final output, but has to be run in another interpreter first in order to produce the final result, then you created your custom language.


Oh sure, if it's absolutely trivial then bash it (hah) through some shell scripts or even just do it on the command line. I'm talking more about things that are slightly more complicated and will need a bit more effort than find & replace.


I was consulting with a customer, and we hit a point where they needed to check a change into source-control. They were using a VCS that I'd not used before, so I asked how to do it. The answer was "Oh, let me get Tim, he's the one who knows how to check stuff in." It took 5 minutes or so to find Tim, and then a few minutes of him moving through the "interestingly designed" GUI of their VCS he was able to get it checked in, and then another couple of minutes he was able to enter a description into their change-tracking system to pend for code review (required to merge into their mainline branch).

I overnighted a book from amazon on the VCS and process management tools they were using, read it the following night, and the next day took about 15 minutes to talk to Tim and then another 30 minutes writing a perl script that prompted for the 4 bits of information they needed and automated the check-in and change-review request. Total billable time spent on this 45 minutes. Time saved by having this script around the 2 weeks I was with the customer at least 2 hours (10 minutes of my time were wasted every time a change needed to be submitted previously!).

Every time I visited that customer in the future, the group was still using that script I wrote. Also every time the manager wanted me to assure him I wouldn't waste time by writing a script like that because that's not what they were paying me for.


> Also every time the manager wanted me to assure him I wouldn't waste time by writing a script like that because that's not what they were paying me for.

It eternally baffles me (although no longer, sadly, surprises me) how often this happens. Clear evidence of a simple change which dramatically improves efficiency and therefore profits, and someone complains and tries to prevent it ever happening again because "that wasn't what I specifically wanted to do right then."


> Total billable time spent on this 45 minutes.

Should've added the time spent on book to billable time (though I guess your manager would approve of that even less than they approve of scripts, given the description). In a few similar situations I've managed to get approval of my manager to bill the time I spent on such emergency learning, because let's be honest, I'm not speed-reading a book on an obscure piece of tech for fun.


Or just wait till we have a distributed problem recognizer or single-conscience general AI: solved and automated once, replicated and reused forever.


As usual Randall Munroe has the answer: https://xkcd.com/1205/


"Tell me, Gaston, this machine, how do you attach it to the wall?"

https://twitter.com/joel_kienast/status/859412383650938880


Might still be useful if you're placing enough nails in the right arrangement, sort of like railroad track laying machines.


this is brilliant


Want to hammer _a_ nail on your wall? Do it yourself. Want to hammer nails on your wall all day everyday? Build a robot to do it, and do something else


If you build a robot you'll be better at building robots. Personal growth vs product.




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

Search: