3 ms·
You're probably right, in that there is a useful role for pure "assign value X" languages. But also bear in mind that simple INI style files can be represented
by jbert 15y ago
You're probably right, in that there is a useful role for pure "assign value X" languages.
But also bear in mind that simple INI style files can be represented as data structure literals in the language. So you could replace your ini-style file:
searchdir="/etc/foo"
with (python syntax):
searchdir="/etc/foo"
and then load your cfg file with 'import' from python.
This approach isn't perhaps suitable for all cases, but it also allows users to do "clever" things, e.g. replacing:
server_host_1="foo"
server_port_1=8000
server_host_1="foo"
server_port_2=8010
server_host_1="foo"
server_port_3=8020
server_host_1="foo"
server_port_4=8030
with code.
Basically, I'd urge anyone considering adding anything beyond simple assignement to use a real language, and even in the case of simple assignment, I think you can use a real language without scaring the users too much.
- gte910h 15y agoYou would be causing some nasty security issues with that approach I think.