DEV Community

Discussion on: What do you think about the idea that "there should be only one way of doing a thing" in programming languages?

Collapse
 
lexlohr profile image
Alex Lohr

While there have been many attempts in different programming languages to create the syntax in a way that would lend itself to only one hopefully elegant solution for each problem, those have been doomed from the start by the fact that there are different paradigms (object orientation, functional programming) equally capable of solving problems in an elegant manner, thus the syntax becomes merely opinionated instead of obvious.

It's far more important to allow for consistency inside a single codebase than for uniformity of every code ever written in the language.

So, while a language and its libraries should provide simple and elegant solutions for everyday problems, striving for only one solution should be deemed unhealthy.