Monthly Archives: January 2012

Programming languages compared

Taking part in Code Year (JavaScript) and working with SQL, I find it helps to get a few principles and differences straight, especially for a beginner like me. First off, JavaScript is Turing-complete and SQL is not (not considering extensions like PL/SQL which implements e.g. loops and variables). Moreover, JavaScript is an imperative  and SQL is a declarative programming language – in SQL I tell the program what it should do without having to tell it how to do it (here’s a nice explanation of this contrast). Basically, I focus on describing the result I want to see and leave the execution up to the inner workings of the RDBMS. As a query and data manipulation, i.e. domain-specific language, SQL requires knowledge of the data structures which are its basis.

Two more formal differences that spring to mind:

  • SQL is not case-sensitive
  • syntax is easier in SQL (no brackets and braces, which I got a bit confused about – color coding helps to clarify the blocks that need these “boundaries”)

The precision and abstraction skills gained from cataloging prove to be invaluable when tackling coding. I realize that logic as one of the paradigms of programming is creeping in more and more, so in the long run it probably won’t be possible to avoid that subject …