6 ms·
Am I missing something? Opening files is not my most intensive work as a developer.
by Exoristos 3y ago
Am I missing something? Opening files is not my most intensive work as a developer.
- __loam 3y agoAdding indirection makes code less maintainable.
- Jtsummers 3y ago> Adding indirection makes code less maintainable. This is why I hated Fortran (77 in particular) as an applications language (for tasks like scientific computing people seemed to use saner portions of it). Computed go tos were the bane of my existence.
- naasking 3y agoThat's not correct as an unqualified statement. Sometimes indirection adds exactly the flexibility you need and that would otherwise require duplication (like generic collections/containers). The more correct statement is that using more or less indirection than you need makes code less maintainable.
- querez 3y agoIt's a decent measure of complexity: It's not that "opening files" themselves is work-intensive. But having a lot of files smells of overengineered code. One long, yet simple function has less cognitive overhead than spreading the function across multiple classes or functions or call hierarchies (themselves spread over multiple files).
- bobmaxup 3y ago> One long, yet simple function has less cognitive overhead than spreading the function across multiple classes or functions or call hierarchies Not if you are encapsulating and naming effectively... Why read 100 lines when you can read 20 and find concerns in one routine you are concerned with? Function calls can be expensive. However, optimization can come whenever you need it, and if what you need is one call vs 5, it is trivial to move that code back into a single routine.
- thorncorona 3y agoI like long simple functions because it makes them easy to reason about when debugging. Rarely does having more functions solve “does this do what I expect.”
- bobmaxup 3y agoMaybe it boils down to how well you are able to navigate a code base. With a full-featured language specific IDE, it is very easy to navigate through even complicated spaghetti. It makes debugging call traces simple, with a GUI. However, many other file viewers and editors make this much more complicated, and it can be frustrating to follow code that is making heavy use of modularization. If you are grepping your way through a deeply modular code base it can quickly become difficult to keep track of anything.
- phkahler 3y ago>> With a full-featured language specific IDE, it is very easy to navigate through even complicated spaghetti. If you need a fancy IDE to navigate around code in order to understand it, that might be crappy or poorly organized code. Not a dig at nice IDEs, just code that requires one to navigate and understand.
- chongli 3y agoYeah. This is one of those hammer cases. If you’ve got a fancy IDE then the temptation is to use it. Similar to the issue of game programmers being given top of the line gaming PCs with frequent upgrades. They then struggle to understand why the game they just released runs like crap on most people’s modest computers.
- bobmaxup 3y agoNot many people can understand a very large code base without taking notes, using an IDE, or similar tooling. > Not a dig at nice IDEs, just code that requires one to navigate and understand A nice IDE helps you reason about code, no matter what the underlying architecture is. That is why there is a market for them.
- deleted 3y ago[deleted]