(no title)
Crazyontap | 1 year ago
This might be an apples-to-oranges comparison, but I've noticed that writing vanilla PHP or JavaScript code, while harder at first, results in more robust and easier-to-debug applications. On the other hand, using frameworks, ORMs, and other abstractions can make the codebase feel brittle and harder to maintain.
ajuc|1 year ago
Frameworks encourage learning stuff on "as-needed" basis, and you often don't know what you should know. So you do stuff on layer 3 because you can (and you already worked nearby), when it's already handled by layer 1 and reprocessed in layer 5. So you debug to see why you can't see changes and "fix" it on layer 7. And it seems to work.
Repeat this over 100 changes and you create crazy mess.
I've seen code that gets a list from the framework (already can't be null), checks if it's null, checks if it's empty. Makes it null if it's empty, then passes it through several more layers with null and emptiness checks on some of them, and then fails with NPE because there was no null check at n-th layer :)
The person writting this code was in the proccess of adding another null check at the NPE line to "fix the problem" :) The solution was to remove all the custom code except for the final destination of that list :)
I've written similarly bad code in some more complicated scenarios without realizing.
rbanffy|1 year ago
lores|1 year ago