Ask HN: What overlooked class of tools should a self-taught programmer look into
927 pointsThe books went into detail and since reading them I've felt confident writing scripts I needed to scratch an itch. Over time, I grew comfortable believing I had a strong grasp of the practical details and anything I hadn't seen was likely either minor quibble, domain specific, or impractically theoretic.
This was until last year when I started working on a trading bot. I felt there should be two distinct parts to the bot, one script getting data then passing that data along to the other script for action. This seemed correct as later I might want multiple scripts serving both roles and passing data all around. Realizing the scripts would need to communicate over a network with minimal latency, I considered named pipes, Unix domain sockets, even writing files to /dev/shm but none of these solutions really fit.
Googling, I encountered something I hadn't heard of called a message queue. More specifically, the ZMQ messaging library. Seeing some examples I realized this was important. The step of then plowing through the docs was nothing short of revelatory. Every next chapter introduced another brilliant pattern. While grokking Pub/Sub, Req/Res, Push/Pull and the rest I couldn't help breaking away, staring in space, struck by how this new thing I had just read could have deftly solved some fiendish memorable problem I'd previously struggled against.
Later, I pondered the meaning of only now stumbling on something so powerful, so fundamental, so hidden in plain sight, as messaging middleware? What other great tools remain invisible to me for lack of even knowing what to look for?
My question: In the spirit of generally yet ridiculously useful things like messaging middleware, what non-obvious tools and classes of tools would you suggest a hobbyist investigate that they otherwise may never encounter?
Comments (401) 109 threads
Earlier comments- https://dataintensive.net - Really deep dives into different types of data storage solutions, their history, and how they actually work.
- http://www.cattell.net/datastores/Datastores.pdf - Good paper that helps differentiate similar but different datastores. Really helpful when you're trying to pick a modern data solution.
https://philip.greenspun.com/seia/
It goes pedagogically through the way things are typically done in a relational database in such a clear way that word-for-word it's one of the best tutorials I've seen... but it also weaves a narrative of "how can this be done better/more scalably/more reliably/more flexibly-to-business-needs" in pointing to a streaming/event-sourcing architecture. You may or not need the latter right away, but it's a fantastic tool to have in your toolbox to be able to say "ah, this new requirement feels like it would benefit hugely from this architecture."
Especially for OP who's starting to think about the "why" of messaging queues, this could be a fantastically valuable first step.
[0] https://www.youtube.com/watch?v=fU9hR3kiOK0
[1] https://www.confluent.io/blog/turning-the-database-inside-ou...
There are some really cool data structures out there you might not know about. One of my favorite basic ones that I get a lot of use out of is the trie [1] (a.k.a. prefix tree). Very useful for IP calculations.
Also look into probabilistic data structures [2], very amazing things can be done with them.
[0] https://en.wikipedia.org/wiki/DTrace
[1] https://en.wikipedia.org/wiki/Trie
[2] https://en.wikipedia.org/wiki/Category:Probabilistic_data_st...
I keep hoping that someone will build a dtrace(1) CLI that transpiles to bpftrace.
[0] https://techcommunity.microsoft.com/t5/Windows-Kernel-Intern...
Also on a semi-related note, I think as a self taught programmer, it's easy to get stuck on things that seem cool but are just procrastination enablers (I know, I've been guilty of it for 20 years). Like, if you're about to start a new project and you want to flesh out what it's about, you really don't need to spend 5 hours researching which mind map tool to use. Just open a text document and start writing, or get a piece of paper and a pen. It won't even take that long.
I spent about 1.5 hours the other day planning a substantially sized web app. All I did was open a text file and type what came into my head. For fun I decided to record the whole process too[0]. I wish more people recorded their process for things like that because I find the journey more interesting than the destination most of the time. Like your journey of eventually finding message queues must have been quite fun and you probably learned a ton (after all, it lead you to message queues, so it was certainly time well spent).
[0]: https://nickjanetakis.com/blog/live-demo-of-planning-a-real-...
A good series of piped commands with tools available basically everywhere can solve problems you had no idea could be so simple to solve.
awk: - GNU Awk User Guide - https://www.gnu.org/software/gawk/manual/gawk.html#Getting-S...
- Grymoire guide - http://www.grymoire.com/Unix/Awk.html
sed: - Grymoire guide - https://www.grymoire.com/Unix/Sed.html - Official docs - http://sed.sourceforge.net/#docs
sed + awk - https://www.amazon.com/sed-awk-Dale-Dougherty/dp/1565922255
awk - https://ia802309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoI...
general *nix text processing - https://www.tldp.org/LDP/abs/html/textproc.html
awk is pure magic.
https://www.ibm.com/developerworks/library/l-sed1/index.html https://developer.ibm.com/tutorials/l-awk1/
big timesaver: control-r
etc...basic but useful all over:
Continue this thread — 1 reply
Quoting and expansion issues are a pain in shell languages...
You should almost always quote your Bash variables too. Here's why: https://nickjanetakis.com/blog/here-is-why-you-should-quote-...
Inevitably someone will read these arguments and think “those are just bad programmers”, but your point was that you “don't see the value of learning shell scripting”. The value is in not spewing absurd code like that. Shell commands are fast and efficient. There isn’t an emphasis on libraries because instead you use tools. Is `grep` not enough? Try `the silver searcher`[1] or `ripgrep`[2].
Are shell scripts the best instrument for every job? No, but no tool is.
[1]: https://github.com/ggreer/the_silver_searcher
[2]: https://github.com/BurntSushi/ripgrep
Continue this thread — 1 reply
If I want to search a text file for a specific string, why wouldn't I just use `grep "hello" myfile.text`, or if I wanted to do it on a directory of text it's a minor change of `grep -R "hello" .`.
Why would I go through the trouble of opening a Python interpreter, or writing out a Python script to do the equivalent in Python?
Or if I wanted to grab the third column of a CSV, I would for sure just use the `cut` command or maybe `awk` (depending on what I'm doing).
For more complex parsing you can often pipe together a few commands and maybe convert it into a 5 line Bash script to make it a little easier to create variables, etc.. It becomes something you can whip up in 1 minute.
Then there's also more involved text parsing that doesn't require piping a bunch of commands together or shell script glue, in which case it comes back to using grep with its various flags and potentially a regexp. It's a natural fit for the problem and you can iterate on it so quickly.
- Shell scripting for running commands and managing files
- Unix utilities for processing text
These happen to complement each other nicely. It's not that bash is better at manipulating text than Python, it's that Python makes it painful to invoke commands (like those Unix utilities) and pipe data between them (e.g. https://news.ycombinator.com/item?id=17733865 ).
I can't recommend this book enough. I have a CS background, and still had quite a few "I can't believe this thing has been hiding in plain sight!" moments while reading it.
Continue this thread — 1 reply
Are there good books for data intensive desktop apps? Like games or CAD design tools?
All comments shown.
Couldn't load more comments. Check your connection and try again.