[Bro-Dev] capitalization standardization
Don Appleman
appleman at ncsa.illinois.edu
Fri Mar 11 14:02:17 PST 2011
Seth,
What do you recommend as the standard for function names? I'm seeing them named like variables (lower_case_with_underscores). Personally, I'd prefer that they differ in some way from variables. How about camelCase with the first character lower case (to distinguish them from types)?
And I don't know how often we need to name new events. Right now, their naming appears to also follow that of variables, lower_case_with_underscores. I assume this won't change, since there are lots and lots of events already defined, but I figured I should ask, for completeness.
Thanks,
Don
----- Original Message -----
From: "Seth Hall" <seth at icir.org>
To: "Bro Dev" <bro-dev at bro-ids.org>
Sent: Monday, March 7, 2011 3:02:32 PM
Subject: [Bro-Dev] capitalization standardization
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.
.Seth
--
Seth Hall
International Computer Science Institute
(Bro) because everyone has a network
http://www.bro-ids.org/
_______________________________________________
bro-dev mailing list
bro-dev at bro-ids.org
http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev
--
Don Appleman
National Center for Supercomputing Applications
2006B NCSA, 1205 W. Clark St.
Urbana, IL 61801
217/333-6340
appleman at ncsa.illinois.edu
More information about the bro-dev
mailing list