[Bro-Dev] #484: Capitalization standardization

Bro Tracker bro at tracker.bro-ids.org
Sat Jun 25 16:50:42 PDT 2011


#484: Capitalization standardization
---------------------+-------------------
 Reporter:  robin    |      Type:  Task
   Status:  new      |  Priority:  Normal
Component:  Website  |
---------------------+-------------------
 We need to document these on the development pages.

 ----- Forwarded message from Seth Hall <seth at icir.org> -----

 Date: Mon, 7 Mar 2011 16:02:32 -0500
 From: Seth Hall <seth at icir.org>
 Subject: [Bro-Dev] capitalization standardization
 Message-Id: <61A16165-5B99-4348-9604-ED432251E988 at icir.org>

 Now that I'm *finally* digging into these scripts, I've noticed that there
 isn't a lot of standardization across scripts with regard to
 capitalization.  I want to propose the following style for scripts (keep
 in mind this won't be enforced by the language, just a common practice).

 Module names: Camel cased, no underscores (all uppercase for
 abbreviations)
         Examples: FTP, SSH, Notice, Remote, Signatures

 Types: Camel cased, no underscores
         Examples: Log, Connection, EntropyTestResult, GeoLocation, Packet

 Enum values: Upper-case with underscores
         Examples: KNOWN_HOSTS, SSH, NFS3_REG

 Variables: Lower-case with underscores
         Examples: example_variable, ftp_sessions

 This should follow the established conventions of most scripts
 (unfortunately not all).  Did I leave anything out?

 The enum values doesn't quite work because Notice enum values have been
 defined as Camel-cased with underscores mostly.  I'm sort of inclined to
 leave this as it is because it pinpoints when a notice type is being
 defined.  I suppose that would be a subcategory of enum values that is
 just done specially.

 ----- End forwarded message -----

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/484>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list