Understanding ComputerSpeak
Similar to learning English, Mandarin or Italian, there are also rules in the programming language spelling, grammar and order of elements. Computers expect you to type codes and formulas in a certain method, and this is called syntax.
Computer programs differ in the terms used, spelling the success when you use the term “Exit” or “Close Program” to move on to another application. There are predetermined syntactical rules controlling what can be understood, what a certain syntax means, what error prompts “Syntax Error” message, and so on.
An example of syntax would be for Cascading Style Sheets, which define the content display in markup and stored in style sheets. A CSS style would have the syntax: selector { property : value ; }. This, then, is the only form a computer can recognize as a CSS style.
Here are some terms that are related to syntaxes for better comprehension.
- Computer Science - is a body of knowledge that studies all aspects of computers, computation and software. Specializations include Computing Theory, Algorithms, Computer architecture, Software engineering, and Programming languages.
- Programming language - are the terms and grammatical rules a programmer uses to tell a computer how to work. Since these are human-readable lexicon, computers then translate programming language into machine code with a compiler program so it can be understood by the computer. C++ and Java are types of programming language.
- Advanced Query Syntax (AQS) - allows targeted users to target search queries in systems and programs that support it such as Windows Vista or Microsoft Outlook. If for example, you want to find all emails with the word “Rain”, just use AQS in the search query: Rain author:michelle kind:email sent:yesterday.
- Markup languages - are well-known because of HTML or hypertext markup language. These languages contain both lexicon and grammar, as with any programming language, but they are limited in purpose. They only mark up or label information into segments for future use by another program that can then display it in an organized manner to the computer or Internet user.
- Chomsky hierarchy - was defined by linguist Noam Chomsky as a hierarchy of languages with four levels of complexity that matches four classes of machines. It is based on the premise that anything computed by a machine at the lowest level can also be computed by the machine at the next highest level.
How is this done? By simply creating an interpreter to translate what the lower level machine can do. The higher level machine can then compute whatever the lower level machine can do, with the aid of the interpreter.
When it comes to machines, Chomsky’s four levels are: finite automata (simplest), pushdown automata, linear bounded automata and Turing Machines (most complex).
Syntax deals with everything from regular expressions, input alphabet, parentheses, and character classes, among others. It is an interesting linguistic feast for anyone interested. Computer science classes serve as the perfect venue to pique your students’ interest in this area.
Sources:
“Advanced Query Syntax: What, Where, Why, and How.” Retrieved October 8, 2008 from
http://blogs.msdn.com/cheller/archive/2006/12/05/advanced-query-syntax-what-where-why-and-how.aspx
“Computer science.” Retrieved October 8, 2008 from http://en.citizendium.org/wiki/Programming_language
“CSS Syntax” Retrieved October 8, 2008 from
http://webdesign.about.com/od/beginningcss/p/aacss2syntax.htm
“Source Code.” Retrieved October 8, 2008 from http://en.citizendium.org/wiki/Source_code
“Syntax.” Retrieved October 8, 2008 from
http://en.citizendium.org/wiki/Syntax_(computer_science)
“Syntax.” Retrieved October 8, 2008 from
http://www.webopedia.com/TERM/S/syntax.html
“The Chomsky Hierarchy.” Retrieved October 8, 2008 from
http://www2.lib.uchicago.edu/~keith//tcl-course/topics/regexp.html
(Published 20 October 2008, Smart Communications, Inc.)