this post was submitted on 03 Dec 2025
864 points (98.9% liked)
Programmer Humor
27690 readers
489 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I did that myself back in the day. Not overly complicated, but a SQL builder.
I think it's because SQL is sort-of awkward. For basic uses you can take a SQL query string and substitute some parameters in that string. But, that one query isn't going to cover all your use cases. So, then you have at least 2 queries which are fairly similar but not similar enough that it makes sense just to do string substitutions. Two strings that are fairly similar but distinct suggests that you should refactor it. But, maybe you only make a very simple query builder. Then you have 5 queries and your query builder doesn't quite cover the latest version, so you refactor it again.
But, instead of creating a whole query builder, it's often better to have a lot of SQL repetition in the codebase. It looks ugly, but it's probably much more maintainable.