-2

I have been reading a bit about code readibility and found conflicting information about the following: some say that flexibility (and-or extensibility) actually increase readability, while some others claim it decreases. Is there any generally accepted opinion about that?

3

There is one relationship: Code that is not readable is inflexible and hard to extend. It may in theory be flexible and extendible, but since it's not readable you won't be able to figure out how.

2

There is no generally accepted truth about these trade offs because that would be like boiling down the entire art of software into a meme. Software is a living, growing thing that has these trade offs being made constantly during development.

There are cases where readability and extensibility go together. For example, breaking out a small bit of code into a subroutine function. Hiding the nested loops and if statements as a named subroutine is readable. It also makes the code flexible for reuse.

In the other extreme, code that is engineered to be hyper extensible can be seen as overly complex due to the many layers of abstractions required to achieve that level of extensibility. A programming language compiler is a good example of this. I doubt there is any compiler code which is famously readable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.