[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

function name prefixes

From: Ben Pfaff
Subject: function name prefixes
Date: Wed, 31 Jan 2007 21:56:12 -0800
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

The convention we've been using in PSPP, which is a common one
across much free and non-free software, is that each function's
name should begin with a prefix that is common across every
function in the given module (typically a single source file).  I
like this.

However, there's one technical detail about it that's been
bugging me lately.  When a module name is more than one word,
sometimes we'll use an underscore in the prefix, e.g. val_labs,
any_reader, case_source.  Other times, we'll just smash the words
together, e.g. casereader, casefile, casefilter.

I can see an argument for each choice.  Underscores make it
easier to pick out the words in the module name.  However,
underscores make the full name longer and, worse (in my opinion),
underscores can make it hard to visually distinguish the prefix
from the rest of the function name.

What do you guys like better?

As another scheme I've seen, one place I've worked uses
capitalization to separate words, with a single underscore
between module name and function name,
e.g. ModuleName_FunctionName.  This style would clash badly with
GNU code, though, so I wouldn't want to use it in PSPP.
"doe not call up Any that you can not put downe."
--H. P. Lovecraft

reply via email to

[Prev in Thread] Current Thread [Next in Thread]