Case Sensitivity

Almost of program languages these day are case-sensitive. When you writing source code, if your language expect some words to be all lowercase, then you should always write all lowercase. If you write the other way, compiler or interpreter will not understand that word and resulting as error.

1.
document.write('Hello, world!');

2.
document.Write('Hello, world!');

These two javascript code look similar right? But number 2 is wrong just because the word 'Write' not all lowercase.

Case-insensitive Languages

Some language does not care how you write the source code. You can use capital, all lowercase, or all uppercase and will not affect the result. Some of the language are :

  • Pascal
  • Basic
  • SQL

But these day, it's wise to always think programming language is very picky about their source code.

Recognizing the Difference

Word in one language can be written different way in other language. For example, 'true' in Python is written with capital while in Swift it written with all lowercase.

Python :

if currentScore > highScore :
    return True
else :
    return False

Swift :

if currentScore > highScore {
    return true
} else {
    return false
}

Maybe it looks confusing, but don't worry, there are some words that same across all language. You just have to read and learn to write that language so you notice and remember the difference. Programmer text editor can help you with this, because they will notice you when you write the wrong syntax.

results matching ""

    No results matching ""