Because computers are pedantic and do not handle ambiguity well programming languages have rules for how to structure code, called syntax. When these rules are broken, the programming language will provide a syntax error.
Some programming languages, like Ruby, try to avoid forcing people to conform to the machine's pedanticism. While this seems like a good idea (Yay! Fewer parenthesis!) it may result in ambiguous code which looks valid but is not.
Most programming languages have three ways for a person to interact with them:
- Writing code in a file, running that file through the language's compiler, then running the output of the compiler. This is how languages like SASS, CoffeeScript, Clojure, JAVA and C work.
- Starting an interactive session and type commands line
by line. This is how