Domanda

What is the official name of the principle, in language design, where the language tries to offer one way of accomplishing a particular task (as opposed to have multiple ways of accomplishing the exact same thing)?

È stato utile?

Soluzione

There is none. Mind that having different ways to yield the same result may be useful. You may want it fast, safe, with little code or just compliant, using a particular infrastructure. Languages that only offer one way are not likely to be popular.

Edit

Assuming the one-way idea is supposed to make it easier for programmers to succeed, there is a more common design principle (that does have a name) which makes it easy to succeed when trying to achieve something. Rather than forcing us to do something a certain way, we are guided to proper usage.

This is sometimes referred to as making people fall into the pit of success, meaning it will be harder to misunderstand a system and use it the wrong way than it is to use it the right way. This can be achieved by allowing only one way, because that would automatically be the right way. But it may also be due to prior art that people are familiar with, closely related to POLA (the principle of least astonishment).

Falling into the pit of success however is more commonly mentioned in relation to code libraries or classes than entire programming languages.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
scroll top