26 ms·
This is not just about writing "useless" software, but also advocating for avoiding so-called "best practices" in small projects I made a static site generator
by Minor49er 3y ago
This is not just about writing "useless" software, but also advocating for avoiding so-called "best practices" in small projects
I made a static site generator for an item catalog. The catalog is simple and doesn't change much. I was debating on which database system to employ and ultimately just decided that I'll drop everything into a static array right in the codebase. It's one less dependency to think about and works perfectly fine for my purposes
- runeks 3y agoI just made the same decision for a hobby project. The current version basically just queries a dataset, ie. no modification of the data (no create/delete/update). I realized it makes almost no sense to store read-only data in a database when I just pull out all the data anyway into memory to run a graph algorithm on it (no way I'm implementing Bellman-Ford in SQL!).
- barryrandall 3y ago"Appropriate practices" beat "best practices" every time.
- donglitao 3y agoI have a friend who incorporates everything he learns into his open-source projects. Initially, it was a showcase of his best practices, and now his open-source projects have gained significant popularity.
- sanderjd 3y agoHonestly, I quite strongly believe it is a "best practice" to use static data in code (or a file packaged along with the code and read in at startup or package compilation time) up until the moment it no longer works. It doesn't seem to be a widely agreed upon one in my experience though, which is a shame.
- penjelly 3y agoi dont consider "not using a database" as a "best practice". a best practice is more like: use the best tool for the task at hand. What you describe would be in-line with this example.
- opportune 3y agoI mean, I completely agree that you should always use the best tool to get the job done and should skip a lot of best practices if the payoff isn’t there. It’s good advice that trumps “best practices” but it’s not really what people mean when they refer to “best practices” and I think you know that. The problem really is just that people don’t understand that “best practices” are not unconditional rules, but simplified advice representing the common experiences of thousands of people doing the same thing as you. Also, more experienced people like you and me know when it’s safe to break them but that’s a lot less obvious to less experienced people.
- Minor49er 3y agoFair point. But what if there suddenly needs to be a huge expansion in the catalog? What if I need to change or modify several attributes suddenly? How can this thing scale? Ack!
- NoGravitas 3y agoStop scaling! 30 years of public use of the Internet, and still no use found for making sites scale to millions of people!
- sanderjd 3y agoThen you add a database.
- tommychillfiger 3y agoSeems like you're agreeing with the person you're replying to. They said the article advocates for avoiding best practices for small projects, and then they provided an example of when they did that - they avoided a "best practice" because it wasn't really practical or important for the task.
- penjelly 3y agono i dont think i am, my original comment says exactly what i meant
- eichin 3y agoOoh, you figured this out early. I had a project back around 1998 where we were using Oracle "because it was there" for a content store... I was doing a performance review and concluded that "we shipped new software more often than we changed any of the data, and should have just compiled it in to the product". (Never did find out if that got done - it was a "we're out of interesting problems" thing and I moved on - but after that it was always my first question when "we need a database" reared its head :-)