DEV Community

Discussion on: What is your best quality as a programmer?

Collapse
 
ben profile image
Ben Halpern

If I've decided on a specific way for how I want to build something, I'll probably get the dang thing working eventually.

What's your most brutal example?

Collapse
 
deciduously profile image
Ben Lovy

Good question! I don't know if it's the most brutal, but a recent one that comes to mind culminated in this recent post:

In a nutshell, the project is a backend for a static website hosting a blog. I had selected a compile-time HTML templating tool, largely because I thought it was cool, not at all to address an actual unmet need with more standard tools.

The problem was that in order to compile all my templates into the server executable, they needed to exist before the program starts running, but that very program is also responsible for generating the templates.

The sensible choice would have been to switch to a run-time tool, like most HTML templating solutions are. The code I'd already written would have sufficed with little modification, and it would be a lot easier to dynamically generate the content I need to serve.

Instead, I spent two days learning how to auto-generate Rust code ahead of the actual compilation process, and built a script that generates the templates I want on disk, so that this compile-time templating process could still work as intended.

For all that extra effort, I didn't really gain much except some extra knowledge about Rust's build process. The final product is virtually identical to what I would have ended up with if I had accepted the compromise. It may technically eke out a win in a benchmark, but nothing that comes even close to mattering in any practical sense.

Oh well.