6 ms·
One story that comes to mind was when I was still relatively early in my career and the COO of the company came to me asking for some help getting some jquery u
by lhorie 4y ago
One story that comes to mind was when I was still relatively early in my career and the COO of the company came to me asking for some help getting some jquery ui tab widget thingie to work.
And as if the words "COO" and "jquery ui" in the same sentence weren't enough to raise eyebrows, what came next was probably one of the most mind bending software engineering episodes I'd ever witness. It turned out he was trying to put together a web UI for displaying a number of reports from some computationally intensive data warehouse query crunching. We're talking visualization of tables and tables full of data. Conventional wisdom would dictate that implementing this the traditional way would involve query optimizations, various layers of caching, separation of concerns, a framework to manage all the complexity, etc, etc, etc. His approach? Just do the naive queries (slow as they were), print directly to HTML old school PHP style, then save the HTML file to disk.
He was a bubbly happy type of guy and you could see the child-like joy on his face when he showed me how lightning fast the thing would load from navigating from one page to another because it was effectively looking at a static website once the pages had been generated once. I distinctly recall feeling a mix of confused feelings at seeing the guy break every rule in the "programming best practices" book and the undeniably good performance results from the sheer dumb simplicity of the solution.
- dntrkv 4y agoThe purpose of the more complicated solutions is to build something that will be maintained for a long time where complexity will grow, and usually, require multiple contributors. I can bang out a basic landing page site in a few hours that will be extremely performant while pulling in zero libraries. But I would never want to maintain that over any extended period of time or added complexity.
- anotheracctfo 4y agoThe purpose of more complicated solutions is to prevent devs from becoming bored and leaving. In my experience, KISS results in the easiest solution to maintain. Then I get a litany of complaints from devs that "this isn't programming" or "this is a dead end to my career" and then they leave. Which paradoxically makes it more difficult to maintain, as I have no maintainers lol.
- dntrkv 4y agoWhat are you working on? Without knowing your use-case or what your codebase looks like, I have no idea if the problem is with other devs, or you are just blind to the insanity that is your codebase. Not saying that latter is the case here, but I've ran into devs maintaining some monstrosity and then complaining about others pushing for off-the-shelf solutions not realizing that nobody wants to spend time learning some bespoke system they created that's not actually as great as they think it is.
- irrational 4y agoYou just need to hire older people. I’ve been doing web development for nearly 25 years. I’m at the point where I would love to just babysit some sites while spending more time on my hobbies and more time with my family.
- pdimitar 4y agoAnother poster beat me to it: hire older devs! I'm 42 and my ideal work is maintaining several systems that move rather slowly. It's chill, still responsible, and allows for creativity and inventive solutions when the need calls for it. Not going to bash younger devs in general but the fact is that getting the job done without thinking of their future career... is usually not high in their list of priorities.
- Dylan16807 4y agoIt shouldn't be hard to make a static site generator for a small pile of queries that's very easy to maintain. You can only anticipate so much up front. You're always going to have to rewrite things after enough growth, so make it easy to add complexity later.
- danielvaughn 4y agoYep, my personal webpage probably has like a 10/10 score on any performance tracking thing you could find. Because I literally just wrote some html and css, and dropped it into github pages.
- saurik 4y agoI mean, if it really took you a few hours, maybe you actually could throw it away and start again later? Meanwhile, if you have to keep rewriting your setup anyway to account for the new shiny toy everyone insists you use every year, have you really made something that requires less effort to maintain?
- jollyllama 4y agoCOO invents caching. Relatively harmless in the grand scheme of things.
- teaearlgraycold 4y agoRewritten as a horror story: > COO invents cache invalidation
- buzzwordninja 4y agoCIO - Cache Invalidation Officer
- cultofmetatron 4y agoIf the data doesn't change often and there's no further changes on the data after its created, seems perfectly valid. Optimizing queries takes time; in some cases, building new tables for amortizing parts of the computation. And of often you don't know whats worth optimizing till later so its easy to spend a lot of time optimizing the wrong thing. I mean he basically cached the results for viewing later. As cringy as it seems, it was probably the optimal solution. personally, I would have probably built out a materialized view and added memcache to generate json to make it easier to refactor additional output formats over time but that's just me. It still wouldn't have loaded as fast as sending a pre-generated html file.
- deleted 4y ago[deleted]
- solardev 4y agoHey, he basically invented pre-Cloudflare Cloudflare! (one of their caching solutions -- which works very well, actually -- is to just cache the slow PHP output of many sites and serve the HTML directly)