I created this Khaby Lame meme because I like simplicity. ๐
The code at the top is a redacted version of something I found in a real Salesforce org.
It looks like over-engineered, possibly AI-generated code. I could not confirm that.
Yes, there is a legitimate benefit to using a query builder: you can mock database access in tests and make them run faster.
This was not one of those cases. ๐
๐ง Things to think about:
๐ Over-engineered solutions can survive longer than bugs - people are afraid to touch them.
๐ Complexity added "just in case" usually result in the "case" never occurring and just becoming tech debt.
๐ AI may have a tendency to add abstraction everywhere. I have seen AI pushback heavily in favor of code that is more complicated than it should be. The result is having to navigate to 2, 3, 4 other classes to then try to assemble the puzzle in your head when adding functionality or fixing a bug.
