• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it necessary to capitalize when we are writing the code?  RSS feed

 
Alexandra Logvin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally found out my issue, I realized I wasn't capitalizing certain things, and when I did it i was able to run the compiler. is there a utility or tool that auto formats the capitalization and such? I read kathy mentioning about eclipse I installed I don'tt know where that feature is

Thanks in advance.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Yes, capitalization matters. And there aren't tools that would automatically change that for you, because changing capitalization generally can alter the meaning of the code.

Autoformatting typically only changes indenting (by adding and removing spaces and/or newlines), so that it improves readability of the code for humans. However, the compiler will generate the exactly same output from the code before it was autoformatted and after it was autoformatted. This is why autoformatting tools are safe - they won't change the meaning of the code.
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

There are conventions about which words should and which should not have capital letters or CapitalLetters or capitalLetters. This style sheet is old but is still worth reading. This section tells you about naming and where to put capitals. Note that keywords are always lower‑case throughout and package names have some strange conventions which you can read about in the Java® Tutorials. you should always follow such conventions because other people need to read your code and they will understand it better with correct capitalisation.
I am not aware of a tool which checks for capitalisation but Eclipse (and probably other IDEs too) has a spell‑checker which can tell when there is an error and can suggest you change namme to name or name to Name.
It is probably a bad idea to use an IDE at this stage because learning the IDE gets in the way of learning programming. Use a decent text editor and set up the options I mentioned previously (look at this post and the three links therein. I think Notepad++ is very good for programming.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!