5 ms·
This is exactly the kind of stuff I'm most interested in finding on HN. How do other developers work, and how can I get better at my work from it? What's alway
by soiltype 1y ago
This is exactly the kind of stuff I'm most interested in finding on HN. How do other developers work, and how can I get better at my work from it?
What's always interesting to me is how many of these I'll see and initially think, "I don't really need that." Because I'm well aware of the effect (which I'm sure has a name - I suppose it's similar to induced demand) of "make $uncommon_task much cheaper" -> "$uncommon_task becomes the basis of an entirely new workflow/skill". So I'm going to try out most of them and see what sticks!
Also: really love the style of the post. It's very clear but also includes super valuable information about how often the author actually uses each script, to get a sense ahead of time for which ones are more likely to trigger the effect described above.
A final aside about my own workflows which betrays my origins... for some of these operations and for others i occasionally need, I'll just open a browser dev tools window and use JS to do it, for example lowercasing a string :)
- chipsrafferty 1y agoI'd love to see a cost benefit analysis of the author's approach vs yours, which includes the time it took the author to create the scripts, remember/learn to use them/reference them when forgetting syntax, plus time spent migrating whenever changing systems.
- te_cima 1y agowhy is this interesting to you? the whole point of doing all of this is to be more efficient in the long run. of course there is an initial setup cost and learning curve after which you will hopefully feel quite efficient with your development environment. you are making it sound like it is not worth the effort because you have to potentially spend time learning "it"? i do not believe that it takes long to "learning" it, but of course it can differ a lot from person to person. your remarks seem like non-issues to me.
- akersten 1y agoIt's interesting because there's a significant chance one wastes more time tinkering around with custom scripts than saving in the long run. See https://xkcd.com/1205/ https://xkcd.com/1205/ For example. The "saves 5 seconds task that I do once a month" from the blog post. Hopefully the author did not spend more than 5 minutes writing said script and maintaining it, or they're losing time in the long run.
- kelvinjps10 1y agoI find that now with AI, you can make scripts very quickly, reducing the time to write them by a lot. There is still some time needed for prompting and testing but still.
- skydhash 1y agoSometimes, you explore to have ideas. By fixing a few problems like these, you learn about technologies that can help you in another situation.
- duskdozer 1y agoMaybe, but 1. even if it costs more time, it could also save more annoyance which could be a benefit 2. by publishing the scripts, anyone else who comes across them can use them and save time without the initial cost. similarly, making and sharing these can encourage others to share their own scripts, some of which the author could save time with
- chipsrafferty 1y agoIn my experience, it's not "maybe" but "almost certainly" which is why I stopped doing this. Every time I get a new system I would have to set everything up again, it's not cross platform, doesn't work when using someone else's computer, suddenly breaks for some reason or another, or you forget it exists... The annoyance of all these factors for outweighs the benefits, in my experience. It's just that the scripts feel good at first and the annoyance doesn't come until later and eventually you abandon them.
- 1y ago
- chipsrafferty 1y agoBecause some of them OP said they use a few times a year. This means they'll probably use it like 150 times in their life. If it saves a minute each time, but it takes 5 hours to create it and 5 hours to maintain it over the years, then it's not really a win.
- karczex 1y agoSometimes it's rather matter of sanity than time management. I once created systemd service which goes to company web page and downloads some files which I sometimes need. This script was pretty hacky, and writing it took me a lot of time - probably more than clicking manually on this page in the long run. But clicking it so annoying, that I feel it was totally worth.
- taejavu 1y agoNot all time is created equal. I’ll happily invest more time than I’ll ever get back in refining a script or vim config or whatever, so that later, when I’m busy and don’t have time to muck around, I can stay in the flow and not be annoyed by distractions.
- latexr 1y ago> reference them when forgetting syntax If you have to do that, the script needs improvement. Always add a `--help` which explains what it does and what arguments it takes.
- tom_ 1y agoIf you write these sorts of things in Python, argparse is worth investigating: https://docs.python.org/3/library/argparse.html https://docs.python.org/3/library/argparse.html - it's pretty easy to use, makes it easy to separate the command line handling from the rest of the code, and, importantly, will generate a --help page for you. And if you want something it can't do, you can still always write the code yourself!
- latexr 1y agoI don’t like Python in general, but even so I’ll say that argparse is indeed very nice. When I was writing ruby, I always felt that OptionParser¹ wasn’t as good. Swift has Argument Parser², officially from Apple, which is quite featureful. For shell, I have a a couple of bespoke patterns I have been reusing in every script for many years. ¹ https://github.com/ruby/optparse https://github.com/ruby/optparse ² https://github.com/apple/swift-argument-parser https://github.com/apple/swift-argument-parser
- yellowapple 1y agoMany years ago I wrote a library I called “Ruby on Bales”¹ specifically due to my frustrations with the state of command-line argument parsing for Ruby scripts. I haven't touched it in a long while; maybe I should revisit it. ---- ¹ https://github.com/YellowApple/bales https://github.com/YellowApple/bales
- tom_ 1y agoRegarding other ports, I've also been pretty happy with https://github.com/nodeca/argparse https://github.com/nodeca/argparse, which works nicely from Typescript. Looks like it hasn't been updated for a while, but it's not like there's a great deal wrong with it. https://github.com/p-ranav/argparse https://github.com/p-ranav/argparse is a single-file argparse for Modern C++, which means it's typically straightforward, if baffling in places and a bit annoying to step through in the debugger. The nice thing about the argparse ports is that provided they take their job seriously, your programs will all end up with a vaguely consistent command line UX in terms of longopt syntax, and, importantly, a --help page.
- fragmede 1y agohttps://raw.githubusercontent.com/fliptheweb/bash-shortcuts-cheat-sheet/master/moving_cli.png https://raw.githubusercontent.com/fliptheweb/bash-shortcuts-... has served me very well.
- mlrtime 1y agoWow thanks, I'm tattooing this on my right hand now. :)
- kevinrineer 1y agoNo one tell him about `set editing-mode vi` or `info readline`
- mlrtime 1y agoI use emacs
- yellowapple 1y agoOne of the very few things I like about macOS is that it rebinds the CUA key from Ctrl to Cmd, freeing up Ctrl for these Emacs-style text navigation keybinds. It's odd to me that seemingly zero Linux distros/DEs do this by default.
- klaussilveira 1y agoThis is one of the things I miss the most about hacker conferences. The sharing of tools, scripts, tips and tricks. It was, and still is, just as fun as trading cards.
- bawis 1y agoWhat's a hacker conference?
- yellowapple 1y agoA conference in which hackers congregate. My favorite recent one was Handmade Seattle, but that one's kaput as of this year, and it seems everything else along similar lines is overseas and/or invite-only.
- freedomben 1y agoI love this kind of stuff too, but too many times over the years I've found myself in environments without some of these higher level and more niche tools (including my own dot files), or the tool ends up abandoned, and I struggle to remember how to use the basics/builtins. I've gotten a lot more conservative about adopting them because of that.
- bityard 1y agoPretty much my take as well. I imagine spending a few hours a month customizing your shell and text editor (hello vim/Emacs folks) to be more efficient and powerful is _great_ for developers who rarely leave their own workstation. But I spend much of my day logging into random hosts that don't have my custom shell scripts and aliases, so I'm actively careful not to fill my muscle memory with custom shortcuts and the like. Of course, I _do_ have some custom shell scripts and aliases, but these are only for things I will ever do locally.
- djtriptych 1y agoLoved it too. Made me want to write a schema for other developers to add (tool, frequency_of_use, category, description) tuples.