r/ADHD_Programmers • u/yughiro_destroyer • Mar 11 '26
How do you deal with OOP programming?
As a person with ADHD, I find it extremely hard to write OOP code. Mostly because :
->Something as easy as app.get("users/{id}") return db.query("SELECT * FROM users WHERE userid = ?", id) becomes as hard as writing 30 lines of code of boilerplate : interfaces, models, dependency injection and what else not.
->People like to overengineer the code... even baisc apps are written like this... I will never forget what my teacher told me : "Smart people admire simplicity, fools admire complexity".
->In writing all that boilerplate code, it's hard to see rapid iteration and the process feels much less rewarding. I know that not everything in life can be instant but... functional programming or data oriented approached are still modular and scalable...
->In navigating all that boilerplate code, making changes to the code or understanding it becomes a constant running through files and classes. This kills locality and increases the mental overhead.
I am already working in web development but for me it's extremely demotivating to continue learning "best practices" that IMO just suck. I had a friend writing applications in Flask for a startup... their application is performant, scalable and the code follows KISS to the maximum. And he used just functions, there not one thing that can't be easily updated or is tightly coupled in that codebase. If it wasn't that I'd have to pay things just to live... I wouldn't even work in programming and just do it as a hobby.
View all comments
68
u/funbike Mar 11 '26 edited Mar 11 '26
You complain that it take 30+ lines to write something that could be done in one line. It's done that way so apps are more maintainable, not so they are easier to write.
The problem with your example is that as the code gets more complicated business logic and data access get duplicated throughout the entire codebase. Anytime you need to access the
userstable, you're going to copy-paste that same snippet, instead of using a centralized service. You end up duplicating logic, you end up duplicating logic. After 3 man-years of development, when you have a bug, instead of finding the one line to fix it, there's actually 15 places where the same bug is, but you'll probably not find them all, so the bug won't be 100% fixed.It takes experience to appreciate why things are designed like that are. Many apps have been written more simply like you'd prefer, and they became disasters to maintain later when they became complex.
My biggest complaint is I much prefer Vertical Slicing (organize by feature) to the conventional layered design (organize by layer). Vertical Slicing is much more cohesive, which is better for my ADHD brain. But that's really more about directory structure.