I’m mostly a hardware engineer. I needed to test pumping water through a special tube, but didn’t have access to a pump. I spent days searching how to rig a pump to this thing. Then I remembered I could just hang a bucket of water up high to generate enough head pressure. Free instant solution!
Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
31–40 of 73 posts
Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#32Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#33When working at an influencer marketing company a while ago, back when Instagram still allowed pretty much complete access through their API. As we were indexing the entire Instagram universe for our internal tooling, we had this graph traversal setup to crawl Instagram profiles, then each of their followers etc. We’d need to keep track of visited profiles to not loop and had an Apache Storm cluster for the entire sc…
Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#34Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#35I recently wrote a command-line full-text search engine [1]. I needed to implement an inverted index. I choose what seems like the "dumb" solution at first glance: a trie (prefix tree). There are "smarter" solutions like radix tries, hash tables, or even skip lists, but for any design choice, you also have to examine the tradeoffs. A goal of my project is to make the code simpler to understand and less of a black box…
And it goes the ChatGPT comes back with and runs the appropriate command.
Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#36----
For storage, people often overcomplicate things. Maybe you do need RAID 5 in a NAS, etc. Maybe what you need is a simple server with a single disk and an offsite backup that rsyncs every night. That RAID 5 doesn't stop 'rm -rf' from destroying everything.
For databases, people often shove a database into an app or product much too early. The rule of thumb that I use is that you should switch to a database (from flat files) when you would have to implement foreign keys, or when data won't fit in memory anymore and memory-mapped files aren't sufficient. Using a database before that just complicates your data model, introducing ORM too early seriously complicates your code.
For algorithms, there are an awful lot of O(nLogn) solutions deployed for problems with small n. An O(n) solution is often faster to write, and still solves the problem. O(n) is often actually faster when things fit in L1 or L2 cache.
For software architecture, we often forget that the client has CPU and storage (and network) that we can use. Even if you don't trust the client, you can sign a cache entry to be saved on the client, and let the client forward it later. Greatly reduces the need for consistency on the backend. If you don't trust the client to compute, you can have the server compute a spot check at lower resolution, a subset, etc.
Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#37Re: Ask HN: When has a "dumb" solution beaten a sophisticated one for you?
#38I think a lot of people would have used a database at this point, but the site didn't need to be updated once built so serving a load of static files via S3 makes ongoing maintenance very low.
Also feel a slight sense of superiority when I see colleagues write a load of pandas scripts to generate some basic summary stats Vs my usual throw away approach based around awk.