Talk:Read a configuration file: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with "== current task == Ok, so we currently have a task here without any implementation. But I find it odd that we are supposed to set a value based on the contents of a comment in ...")
 
(What about .properties or INI? They're at least clearly defined…)
Line 2: Line 2:


Ok, so we currently have a task here without any implementation. But I find it odd that we are supposed to set a value based on the contents of a comment in a config file. In properly factored code I would imagine that either [a] you set the defaults before the config file is read, and/or [b] you explicitly declare non-false boolean values. (I am also a bit wary about the use of the term "standard" in that config file's comment.) --[[User:Rdm|Rdm]] 22:28, 10 February 2011 (UTC)
Ok, so we currently have a task here without any implementation. But I find it odd that we are supposed to set a value based on the contents of a comment in a config file. In properly factored code I would imagine that either [a] you set the defaults before the config file is read, and/or [b] you explicitly declare non-false boolean values. (I am also a bit wary about the use of the term "standard" in that config file's comment.) --[[User:Rdm|Rdm]] 22:28, 10 February 2011 (UTC)
: [[Java]] [[wp:.properties|properties files]] are closer to a ''de facto'' "standard", especially if you ignore the property substitution feature. Failing that, there's the old [[wp:INI file|INI format]]. –[[User:Dkf|Donal Fellows]] 22:59, 10 February 2011 (UTC)

Revision as of 22:59, 10 February 2011

current task

Ok, so we currently have a task here without any implementation. But I find it odd that we are supposed to set a value based on the contents of a comment in a config file. In properly factored code I would imagine that either [a] you set the defaults before the config file is read, and/or [b] you explicitly declare non-false boolean values. (I am also a bit wary about the use of the term "standard" in that config file's comment.) --Rdm 22:28, 10 February 2011 (UTC)

Java properties files are closer to a de facto "standard", especially if you ignore the property substitution feature. Failing that, there's the old INI format. –Donal Fellows 22:59, 10 February 2011 (UTC)