Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> code quality can be measured more objectively

Well, that's a big assumption. Some people quality modular code is some other too much indirect code.



You can write maximally modular code while being minimally indirect. A well-designed interface defines communication barriers between pieces of code, but you don't have to abstract away the business logic. The interface can do exactly what it says on the tin.


> The interface can do exactly what it says on the tin.

In theory.

Do some code maintenance and you'll soon find that many things don't do what it says on the tin. Hence the need for debug and maintenance. And then going through multiple levels of indirection to get to your bug will make you start hating some "good code".


Yes, that's what can means. It's still the developer's responsibility to correctly write and test code such that things do what they say on the tin.

What's worse is trying to navigate an imperatively written 2000-line single-function, untestable module with undocumented, unabstracted routines found in ten other places in the codebase.

This is something I've encountered plenty in my career, always written by people who eschew best practices and misunderstand the benefits of abstraction, or think they're writing good abstractions when it's really just needless indirection without actually reducing coupling.

Understanding the nuance is one of the qualities of a good developer.


And on the other side you see a lot of single implementation interfaces; or 2 lines methods which call perfectly named methods 7 levels deep which could have been a 50 lines method easy to grok on a screen with zero scrolling.

So things are on a spectrum depending on the situation and what you want to accomplish => measuring code quality is not a simple thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: