CamelCase naming convention
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
Personally I prefer camel / Pascal case generally, ut reserve the use of the underscore for punctuation.. e.g. I might have Patient_Doctor which contains the many-many links between patients and doctors, and separates it from PatientDoctor which would be a collection of doctors who are easy-going.
___________________________________________ .\\axxx (That's an 'M')
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
-
I only ever use
!
on a true boolean value and always useNULL
when checking pointers. :) I find it easier to read, especially as I dumped Hungarian notation years ago:if (foo == NULL)
{
// I know 'foo' is a pointer
}if (!bar)
{
// I know 'bar' is a bool
}Each to their own.
Rob Caldecott wrote:
I only ever use ! on a true boolean value and always use NULL when checking pointers.
Nice point. May be I will do it too. :)
It is a crappy thing, but it's life -^ Carlo Pallini
-
Nemanja Trifunovic wrote:
Do I see a contradiction here?
But of course! This is all completely subjective, except for the fact that I'm right and you're wrong, VIM sucks, and using the underscore as you're proposing will undoubtedly lead to the end of the Union, and a take over of the State by leftist-grave-robbing-breast-feeding-thumb-sucking-whiner-socialists.
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog Just Say No to Web 2 Point Oh
Ah, but you're wrong, and you've hit the nail on the head! VIM is the best thing since sliced bread (who even needs a mouse anyway? and gui's? curses on all my friends!), although I'm sure it existed before sliced bread, and leftists are actually quite an agreeable bunch. So, unfortunately, I'm going to have to conclude that *you're* wrong. :)
Paul
The flight towards the light I'll stay in the lava for life Ísland
-
Jim Crafton wrote:
Slow day?
On the contrary - a busy day and I need to vent :)
Jim Crafton wrote:
That makes my stomach churn. For no other reason that typing the underscore is a PITA. I find camel casing more aesthetically pleasing, at least to my eyes
Do I see a contradiction here? It makes your stomach churn for no other reason than typing, and then you say you find camel casing more aesthetically pleasing? Anyway, I can't argue with the "aesthetically pleasing" part, but it is equally hard to type.
Nemanja Trifunovic wrote:
Anyway, I can't argue with the "aesthetically pleasing" part, but it is equally hard to type.
I think capital letters are far easier to type than an underscore. All the letters on my keyboard are just one key away, whereas the underscore I have to move my cute lil' pinky up two rows. My left ring finger can handle taking up the responsibility of the left pinky just find. Hmm, talking about fingers is really weird. Good topic though! I reckon being able to type with spaces would be better, and have the editor condense it to whatever form is required. Interestingly, on that topic, I don't actually type the capitals much any more, I type about half the method in lower case, then ctrl+space finishes the word for me, and fixes up my capitalisation. Yay for tools!
-
Ah, but you're wrong, and you've hit the nail on the head! VIM is the best thing since sliced bread (who even needs a mouse anyway? and gui's? curses on all my friends!), although I'm sure it existed before sliced bread, and leftists are actually quite an agreeable bunch. So, unfortunately, I'm going to have to conclude that *you're* wrong. :)
Paul
The flight towards the light I'll stay in the lava for life Ísland
Preposterous! Absurdities stacked on inanities, turgid logic piled upon vapid conundrums! I'm convinced beyond a shadow of a doubt that you're wrong!
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog Just Say No to Web 2 Point Oh
-
Preposterous! Absurdities stacked on inanities, turgid logic piled upon vapid conundrums! I'm convinced beyond a shadow of a doubt that you're wrong!
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog Just Say No to Web 2 Point Oh
...oh, and Lisp is cool. And so is Haskell :) Definitely been hanging too much with the dark side :). But this all leads me to believe, without doubt, that you're wrong. Speaking of inane deductions, which your post exemplifies! ;P
Paul
The flight towards the light I'll stay in the lava for life Ísland
-
Nemanja Trifunovic wrote:
Anyway, I can't argue with the "aesthetically pleasing" part, but it is equally hard to type.
I think capital letters are far easier to type than an underscore. All the letters on my keyboard are just one key away, whereas the underscore I have to move my cute lil' pinky up two rows. My left ring finger can handle taking up the responsibility of the left pinky just find. Hmm, talking about fingers is really weird. Good topic though! I reckon being able to type with spaces would be better, and have the editor condense it to whatever form is required. Interestingly, on that topic, I don't actually type the capitals much any more, I type about half the method in lower case, then ctrl+space finishes the word for me, and fixes up my capitalisation. Yay for tools!
Phil Martin... wrote:
I type about half the method in lower case, then ctrl+space finishes the word for me, and fixes up my capitalisation. Yay for tools!
Same here, except that I use vim's Ctrl-P :)
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
Just use shorter identifiers. I've started to use namespaces a lot for that reason. I use a notation that looks like this: IO::Backup::Database(...). My apologies if namespaces aren't available in your toolset. Personally, I prefer camel case over underscores in long identifiers.
-- Kein Mitleid Für Die Mehrheit
-
I guess my first name has made a good impression on you then? Not sure if I want to impress you even further with Jörgën though. People could mistake me for a french man! ;)
-- Kein Mitleid Für Die Mehrheit
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
The main problem in you examples is not the case, but the lenght of the function. GetMyXML() is not difficult to read at all. If you function or variable names are that long, you might need to split the functionality into smaller parts.
-
Computafreak wrote:
IHaveNeverReallyHadThisProblemBecauseIFindItEasyToBothReadAndWrit
You find that easy to read? :~ As for ease of writing, how many time did you have to press Shift?
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
Back in the mainframe days, before PCs were invented, underscores were a standard way of making long identifiers readable. As people have observed, it's slightly more effort to type, but code is only written once and read many times. More effort and expense per line of code is expended in maintenance than initially creating it, so if it makes your code more readable it may be worth it.
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
-
GetMyPreciousDataFromAnXMLFile() get_my_precious_data_from_an_XML_file() Either way that's a LOT of typing wouldn't this be better: Gmpdff() ?
grgran wrote:
wouldn't this be better: Gmpdff()
Nah - you still need to hit the Shift key. Maybe: gmpdff()
-
grgran wrote:
wouldn't this be better: Gmpdff()
Nah - you still need to hit the Shift key. Maybe: gmpdff()
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
Actually as a JS coder I preffer that naming:
//Get My Precious Data From An XML File
gmpdfaxmlf();Publish the code without comments :) And make sure you keep copy of it with comments! :P
-
Why most programmers (at least Windows and Java programmers) use this horrible notation? It is both hard to write and hard to read:
GetMyPreciousDataFromAnXMLFile()
With undrescores it is at least easy to read if not to write:
get_my_precious_data_from_an_XML_file()
And of course, there is always a way to make it easy to write but hard to read:
getmypreciousdatafromanXMLfile()
Lispers have the best of both worlds (well, except for the parentheses):
(get-my-precious-data-from-an-XML-file)
I feel better now - feel free to vote me down :)
I have always used Camel Case because it is easy to read. I hate reaching for the underscore anyhow. Give me the main three rows of keys for ease of typing. Anyhow it is part of the accepted coding conditions for VB programming.