(series) how to design a programming language: even if youve never coded

the myth of the non-coder

 

the non-coder is a mythological beast, handed down from quaint old wives tales. people generally believe by age 10 that they are either a “computer person” or “not a computer person.” for an idea of what a computer person looks like, look up jack black as “computerman” on youtube.

the myth of the non-coder is reinforced by the myth of the coder. the coder is a person who was born understanding how to code, who has never heard of “hello, world” and who has never looked up a command more than once.

which isnt to say that coders and non-coders dont exist, but they exist almost entirely in mythology: made-up rules that are loosely based on reality.

a coder is someone who has coded. at least this is how it used to be. today, a coder is someone who has mastered coding! but this is another mythology; no matter how well you “master coding” there are more horizons and more things to learn.

perhaps you should hold off before telling people you are a “master coder.” but watch out for the many fanatics who will insist that until you are a master, that you are not a coder. from there, you could spend the rest of your life trying to prove something to people that arent paying attention.

the way i learned coding was typing examples out of a book, noting what they did, and learning the commands by comparing what happened to what i typed. i learned that print put words on the screen by typing in code that included the print command, and noting that it put words on the screen. you can also learn that print puts words on the screen by reading that it does that.

actually coding is a more interesting experience than just learning it from a book– although a book can help a lot. as you type in code, you go from noting what happens to predicting what you think will happen, to writing code that does what you want. though you still have to try it to be sure it does what you think it will– then repeat the process with changes and fixes.

 

 

a quick tour through beginner-friendly coding

1964: (dartmouth basic)

10 print “hello, world!”
20 goto 10

 

1967**: (logo)

forever [print “hello, world]

 

1986: (amigabasic)

while 1
print “hello, world!”
wend

 

1993: (lua)

while 1 do
print(“hello, world!”)
end

 

2005: (python)

while 1: print “hello, world!”

 

2015: (fig)

while
now “hello, world!” print
wend

 

** this is intended to be logo, which is from 1967, although there are over 300 dialects of logo. while it is easy to find a 1964 manual for basic, it is not as easy to find an authoritative source on what logo looked like in the 1960s. this line is correct microworlds logo:

forever [print “hello]

 

and it is presumed (but not certain) this would also work:

forever [print “hello, world!]

 

 

hour of make up your own code! (a challenge for every wordpress reader)

if youre on wordpress you may have heard of the “hour of code.” i think its a great idea, but if youre thinking of skipping it anyway, why not try the “hour of make up your own code?”

you dont even have to know how coding works to do it. but it could end up being your first step towards learning to code. still reading? ok, heres what you do:

 

1. imagine some things you could tell the computer to do.

 

2. give a name to each of these things you want to tell the computer to do. once you name it, that thing is a “command” for the computer. an example of a command is “uppercase.” it takes words and makes them uppercase– another is “dot.” it draws a dot on the computer, in any colour on any place on the screen.

 

3. (optional) for each command you make up, you can add “parameters.” parameters are details for the command. like for your “dot” command, you could have parameters for how many “dots” from the left side of the screen you want to put it, or how many “dots” from the top you want– or what colour you want to use. parameters look like this:

command parameter1 parameter2 parameter3

 

you can name your parameters if you want to:

dot: fromleft, fromtop, colour

 

4. (bonus) create as many “commands” as you want, then write a program in your new language!

1) dot: 5, 5, “orange”
2) line: 7, 10 – 30, 100 “green”
3) say-on-screen: “hello, this is my program.”

 

5. feel free to post your language ideas or your programs as a reply to this post, or put them on your own blog (or link to them here.) if you like the idea, feel free to copy this entire article to your own blog.