Syntax tends to get people unusually upset in the programming world. Heck, virtually any introductory talk on Erlang (Haskell, Clojure, whatever) invariably contains a self-deprecatory quote about the syntax. The thing people forget is that this isn't new. Syntax has been upsetting hominids since the first australopithecus said "Urghk" instead of "Oook" - getting thumped for its pains - and has continued to the present day (Look up "French is better than" on The Googles)
In this talk, I will explore the similarities between spoken and programming languages, with particular emphasis on the process of learning them, as well as the almost reflexive hatred of this process in most cultures. You'll learn to appreciate the role of syntax in languages, how it can help - or hinder! - your understanding of the semantics, and most importantly, how to appreciate syntax as an element of the language that is valuable in its own right.
I’m going to bounce between spoken and programming languages a lot
This means “sour” (kinda)
Lemons are sour
This means tiger
You don’t want to find a tiger in the fridge.It’ll be unhappy. Besides, why are your lemons in the fridge anyhow?
But they are both written the same
And pronounced the same too!
How do you say this in english? “hot”? “spicy hot”? Huh?
How do you say this in english? “hot”? “spicy hot”? Huh?
What does this even mean in english? Shyness? Really?Its actually contextual
Think of programming languages.Whats a Monad in VB?
Whats a Goto in Haskell?(ok wiseguy – you can do it. But you can also put a tiger in your fridge)
But, what *is* language? And how do you categorize it?
There is an astonishing number of ways in which languages are categorized“”
hierarchy of formal grammars – type 2 grammar (proglang) type 3 (RE)
Gets even better
Yet another classification of languages(intentionally dense)
And, of course, programming languages are the same
Ok, that’s complex, and somewhat unhlefulHow about structures in grammar?.Left branching vs Right Branching
Left branching? Green Car Right branching? Machina Verde Indian Languages (and Japanese) are Left Italian/Spanish is almost always Right English is screwed up
For programming,functiinal vs. imperative
You’d like to believe that languages are pure, but they are not
The point is, how you classify languages is itself very debatableAnd doesn’t help
Either way though, languages exist, and are spoken by billions of people
Sometimes by people by speak more than one language
Its easy when you have stuff in multiple languages
But what if you’re learning a new language? Or not good?You don’t park here.
You don’t scratch your head and leave
You don’t go ‘huh’?
This is especially true for kids!
And we suck in the US.Unless you’re from somewhere else. E.g., you’re Indian like me
Multilingual people learn other languages easier
People who code in multiple languages usually know more than one language
People who code in only one language usually speak only one language
You learn languagersdifferently
The lack of preconceptions makes it easier to learn very different languages
The lack of preconceptions makes it easier to learn very different languages
While the similarities make it easier to learn related languagesOR NOT LEARN IT! (just ‘cos letters doesn’t mean it is english)
This is pretty easy to understand if you know java. Or whateverEven numbers in VB
Excel gets goofy thoughEven numbers in Excel
But going to functional languages, life gets complex, Even numbers in F#
But if you already know F# (or Haskell)But neither is *better*
Natural Languages are awesome at error correction
While the similarities make it easier to learn related languages
Programming languages, not so much.
Natural languages evolve at a ridiculous pace Verbing is accelerating
Telephone-u, bus-u
Even programming languages
Java version 1 2 ...6, 7
Especially scripting languages (because they tend to be more pragmatic)Larry Wall was a linguist Perl as English?
But, you still insist that it matters
Or maybe that it doesn’t matter
Its just a language – it doesn’t even have to make sense!C-u-t, b-u-t, p-u-t
There are two parties to a conversation – you, and everyone listeningBoth need to understand
Whether its you and another person
Whether its you and an audience
Whether its you and a computer.In all cases, everyone needs to understand
What if you’re counterparty is a node.js developer?You have to be aware of your audience!
But you’re smart! You claim that you always use the right tool for the job! You’re agnostic!
Like the coyote. And you know how that ended
Seriously!!!!
Are you going to pass this on to someone else? An “HTML Programmer”?
Are you going to pass this on to someone else? An “HTML Programmer”?
Are you going to pass this on to someone else? An “HTML Programmer”?