Keywords

Even though programming language is very strict, but it's not more complex than spoken or written human language. Java, for example, only have 50 keywords, compare to English language that have more than 171.000 words. Keywords is words belong to the language, they know what the meaning of the word when you write it.

Of course that doesn't mean if you know all the programming language keywords mean you expert at that language, you still have to know how to use it or make combination of them to write statement.

When the word we want aren't in the language, we can still have that in our source code but we have to define it ourselves. Look at Swift code below :

if currentScore > highScore {
    print("Congratulation, you have the high score!")
} else {
    print("Better luck next time.")
}

Some words in that code is keywords, because Swift know how what that means. The words is "if", "print", and "else". We cannot change what it means, because it belong to the language. In the other hand, words like "currentScore" and "highScore" are not keyword. That words is our choice to represent data or information we want to keep track. We call that word something else and the meaning of them is up to us.

results matching ""

    No results matching ""