Rule of Least Power

Recently came across the Rule of Tw…. I mean the Rule of Unlimited Pow… I mean the Rule of Least Power!

Within the framework of choosing a programming language to accomplish a certain goal: pick the language that has the least power and will still get the job done.

In other words, don’t use a amphibious crawler excavator when you want to dig a small hole in your garden. Use a shovel instead.

Another computer-related example might be to pick .ini instead of .py when the goal is storing configuration data.

The .py extension means that the file is a Python module that runs code. The .ini extension means that the file is a configuration file that contains plain text with configuration data. The .ini file can be used by more applications than the .py file and still serves the purpose of containing the necessary configuration data.

As an example, when the goal is storing configuration data you could create a .py file like below:

host = dunnoifthissiteexists.com

port = 80

However, due to the reasons listed above, you could increase the applicability by saving the data in a .ini file like below:

[parameters]

# Host

host = dunnoifthissiteexists.com

port = 80 Wiki: https://en.wikipedia.org/wiki/Rule_of_least_power

Leave Comment