|
|
|
|
|
by amelius
3991 days ago
|
|
I don't understand why we should use JSON to configure a server, when a much more powerful language exists: Javascript. For example, instead of hardcoding some setting in JSON, a Javascript configuration file could perform queries before configuring, or it could install callback functions as part of the configuration. |
|
Because it's more powerful. More powerful, in many cases, is a worse thing. Executable imperative code isn't as flexible as a data file because all you can really do with it is execute it and take the output, rather than process it as you see fit.
See:
Rule of Least Power – https://en.wikipedia.org/wiki/Rule_of_least_power
Principle of Least Power – http://c2.com/cgi/wiki?PrincipleOfLeastPower