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
 
tducasse profile image
Thibaud Ducasse

In some languages (I'd say python), the most idiomatic way of doing things will also be the best for performance. And understanding the way the language expects you to write code is a big part of writing good code.

But sometimes, because they optimise the language for the most common 99% of the use cases, you end up having to write something else, more convoluted, but more performant.

I think it's not so much about having just one way, but more about teaching people that this should be the way unless you need X or Y.

Reminds of when eslint starts yelling at you but you add //eslint-disable to the line because "yes I know but in this case I need to".