[Development] Naming of path/directory-related environment variables in Qt

Jake Petroules Jake.Petroules at qt.io
Wed Nov 16 20:06:46 CET 2016


> On Nov 16, 2016, at 4:06 AM, J-P Nurmi <jpnurmi at qt.io> wrote:
> 
>> On 11 Nov 2016, at 17:10, Matthew Woehlke <mwoehlke.floss at gmail.com> wrote:
>> 
>> On 2016-11-11 10:13, Mitch Curtis wrote:
>>> I'd like to establish some kind of convention for naming
>>> path/directory-related environment variables in Qt, with the hope
>>> that it could be set in stone with e.g. one of these newfangled
>>> QUIPs. [...] So, can we all agree on using "PATH" when naming
>>> environment variables that refer to paths?
>> 
>> I believe that `FOO_DIR` is typical for variables that name a *single*
>> directory. For multiple directories, XDG prefers `FOO_DIRS`, but
>> otherwise `FOO_PATH` seems most common.
>> 
>> Examples:
>> PATH (duh)
>> LD_LIBRARY_PATH
>> PYTHONPATH
>> LUA_PATH
>> QT_PLUGIN_PATH
>> LIBPATH
>> COMPILER_PATH
>> LIBRARY_PATH
>> CPATH
>> C_INCLUDE_PATH
>> CPLUS_INCLUDE_PATH
>> 
>> TMPDIR
>> KDEDIRS
>> XDG_DATA_DIRS
>> XDG_RUNTIME_DIR
>> 
>> I think a good rule would be single directories should use _DIR if
>> anything (some cases e.g. HOME may be exceptions), and list of
>> directories should use _PATH.
>> 
>> Please don't use `FOO_FOLDER` :-).
> 
> +1 for _DIR for single directories, and _PATH for list of directories.

Also +1

> 
> --
> J-P Nurmi
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

-- 
Jake Petroules - jake.petroules at qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io




More information about the Development mailing list