![]() |
![]() |
|
August 09, 2002Coding stylesHave you ever went style crazy working in different languages? Recently I have been doing more C programming that Java as I write new embedded code for everything from a custom SNMP trap manager to apolicy based enforcement control system. In the midst of doing so, I are REALLY noticing my Java formating haunting the C code.... which 10 years ago I would NEVER have done. You see, I have been a "camel case" fan ever since I started working with Oak (now called Java) and was quite comfortable with it. Camel case typically is the use of plain words strung together with the first letter lower case, and every subsequent first letter uppercase. As an example:
It makes total sense and easy to read. Now please don't blast me on the rights and ridicules of variable naming conventions. I disagree with many a book that says variables should be short and represent what it is. It is stupid to think that other people forced to refactor your code will understand what the hell int fc = 0; means. Get a life. If you are so worried that a few more keystrokes will make you less productive, consider the amount of times you will be scrolling around finding what the variable represents a few years from now. Guess what... you'll end up using the same amount of keystrokes, or more. And don't use the excuse of symbol table girth. When the compiler goes at it it will shrink it in the symbol table anyways. Strip it... and size isn't an issue. (Depending on language, variable name size isn't an issue anyways). And lets not go into the "hungarian" format notation. Anyways, back on track, I find that for some $DEITY aweful reason camel notation seems/looks ugly to me when I am reading C code. Dunno why. Style thing. Maybe because I wrote pure code in C for over 5 years before I moved to C++ and was used to it. In any event, I started looking at some different conventions... and kinda like "tight-rope" notation. Basically that is words strung together with underlines, using all lower case. As an example:
Now... in either format.... I can still make ice cubes. That is good. (If you don't get the reference move on.... don't try to figure it out). But for some reason, it just feels more comfortable in C code. I tried it in Java.... and it doesn't look good. Maybe because EVERYTHING else is camel case. Dunno. Perl, PHP and shell... well they are just f*cked anyways. I think the $DEITIES of these languages are secretly, and probably unbeknownst to them through corporate greed, money grubbing. They HAVE to be. Don't you think its quite arrogant to use so many $ signs in a document, unless you are the CFO of WorldCom? It may be alittle late, but best wishes... and a flask of my MOJO goes out to Arcterex and his job interview. I wish you well dude. I really wish I had the cash in time to hire you before you found a job. :( You have always been a kewl team mate to work with, and a good friend. I'll miss you when you go to the great iceburg of the North called Edmon*choke*ton. And hey... you won't need a freon converter. Posted by SilverStr at August 9, 2002 02:57 PM |
![]() ![]()
My 5 Favorite Books
Writing Secure Code
Secure Programming Cookbook Security Engineering Secure Coding Principles & Practice Inside the Security Mind ![]()
My 5 Favorite Papers
Smashing the Stack
Penetration Studies Covert Channel Analysis of Trusted Systems DoD Trusted Computer System Evaluation Criteria NSA Security Recommendation Guides ![]()
Archives
December 2005
November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 ![]() |
|