I have followed stories about learning to code in education and am intrigued by what I have read. My own experience in learning how to code seems so different than the current solutions that many offer, so I want to in this article to discuss a different viewpoint in how to teach young people how to code. This is not a criticism of others methods, but simply a suggestion of how to view education about programming in a different light.
Let’s examine my experience in reverse.
Rather than start with how I began to code, let me start at the end of the story about where I am at now. I am no novice to coding. In the last 20 years I have developed a GUI framework for Windows which a good number of programmers use today. My customers are not typical consumers, but programmers themselves. I write code to make the lives of programmers easier. My current expertise is the Windows WIN32 API. So rather than being the typical web developer of today or app developer, I write low level code using only the WIN32 API to build higher level libraries. I wrote my own drag and drop Visual Designer for generating coding for building apps, as well. I have worked with many of the low level aspects of Windows and especially enjoyed writing graphics engines using OpenGL and low level Windows. My experience has taught me the importance of writing code for performance and also finding ways to push Windows to its limits. I don’t need others higher level frameworks to accomplish my work. I don’t use MFC (Microsoft Foundation Classes), ATL or any other older framework. I don’t use dot.net or any more modern framework. I do everything with the old fashioned, low level WIN32 API.
A few years back, when Microsoft was reaching out to help developers, I had a nice discussion on the phone with a Microsoft Architect level programmer. When I was contacted by Microsoft (they had a program to reach out to developers which I signed up for online) I explained what I do and my experience, the person who communicated with me realized they need someone with more experience to talk to me. The nice fellow I finally was set up to talk with was only suppose to talk to me for about 30 minutes, but our conversation lasted for a good hour. I found it interesting something he said to me after we discussed what I was working on and my experience. He simply stated that most programmers didn’t work at such a level that I did (likely meaning there were few WIN32 API experts around anymore). I really don’t consider myself a WIN32 expert (there is so much to learn), but I guess because WIN32 programming has become a lost art today, maybe that does make me an expert of sorts. The point is that I am more than just a beginner or novice at programming.
My GUI framework tools are being used in a number of commercial software applications today. One example may suffice to make my point:
Fathom Systems in the UK has been using my tools for a long time now and they have written many applications using it. One example of their work can be seen in the following video. Stop the video at about 4 minutes and 33 seconds and notice the software (on a laptop) used by Chevron which controls their Deep Water Pipeline system. That software was developed using the GUI framework which I developed. I could name a number of other examples, but this one is enough.
https://www.youtube.com/watch?v=D9fvdfE59_Y
I think by now I know a little bit about developing real world applications and what goes into programming. So how did I learn how to code and what lessons does my experience contain.
Math makes a difference
I see many comments about where it is best to teach coding in schools today. So what class did I learn coding ? Back in the old days (some may be thinking back when Dinosaurs were around. [that’s a joke]) in the mid 1970’s I had my first experience in coding in an advanced algebra class. Yes math class. Do I think math class is the best place to teach coding ? Absolutely. Why ?
No matter what anyone says, coding is very akin to math. The better ones math skills the more likely one will like coding and do well with it, especially the low level stuff (ie. machine language or assembler). There may be other classes it would be well suited to, but math class should be a primary place to learn coding. So much about coding is very akin to things one learns about in algebra, especially such things like formulas, variables and many math functions (ie. SIN, COS, ABS). The transition from higher level math to coding is very straight forward. But does one need to wait until later years in school to learn how to code ? Not necessarily, but math should still be part of the coding experience.
Coding language makes a difference
The coding languages first learned are also critical. Why ? Well the answer to that can be derived from my own experience. So what first language did I first start with ?
BASIC
Oh, but isn’t that a poor language to learn or start with ? Actually I personally found it the best language to learn and I think more emphasis on bringing BASIC back into the mainstream could make a big difference in teaching coding. But why ?
One of BASIC’s biggest strengths is its being a “natural language”. In an interview I did with Bob Zale, creator of both the famous Turbo Basic and later Powerbasic, he made a profound comment about why he chose to write a BASIC language compiler. He said:
The syntax of BASIC is the closest to “natural language,” the language we speak every day. Virtually every programmer can be productive with PowerBASIC in very short order. Who doesn’t understand BASIC code?
Entire article can be found here: https://www.techrepublic.com/blog/software-engineer/interview-with-powerbasic-founder-bob-zale/
Notice he referred to BASIC as a “natural language”. One of the goals of BASIC originally was to make coding natural, more like we speak (at least in English anyway). The more natural the language the quicker even children can pick up the language. Back in the days of the Commodore 64 and other home computers, so many children and adults alike, learned how to code in BASIC. It didn’t require a complex drag and drop development system nor any visually inviting front end. Just a simple text editor and away they went.
But BASIC is bad you may say. Likely the negative views about BASIC come from those who prefer to keep programming in the hands of the “elite” few rather than the common person. Be honest now, does a programming language really have to use the { } bracket characters to make it readable (aka. C) ? Personally I can see this in how programming languages have developed over the years and my biggest concern about modern languages is that they have lost any naturalness we used to enjoy (in BASIC) and are terse and overly complex. Maybe this is one reason Python in recent years has become so popular. It is far more natural in syntax than most other languages like C++, JAVA, etc. But BASIC was (and still is) far more natural in syntax than even modern Python.
If programming languages were more simple and natural like BASIC (or Python) then likely more children could learn how to code.
Games are not the answer
One thing I am concerned about and if I were in the position of trying to teach children how to code, is that many are falling back to trying to teach coding through game like environments. I think that might be a mistake or at least not the best approach. The coders of the 1960’s and 1970’s often learned how to code with a simple text editor without any higher level game like environment. Why is this likely not the best choice ?
It equates coding with playing games. Coding is not about playing games. It is about doing real work. The same problem occurs with learning math. Math can be boring at times, so often children lose interest quickly and say “how can that benefit me ?”. Coding using simple techniques like just using a code editor, like old BASIC programmers did, may first appear to be boring. The solution is not to turn it into a game. That only demeans coding (and math). The solution is to teach both math and coding in a way which demonstrates its value and its power to create or solve problems.
This is a similar problem that Visual Basic (classic) had. Visual Basic made budding programmers more productive faster. But it often lacked the raw power needed to do many things and if one was not careful, one could be so enamored by drag and drop design that they don’t learn many of the code concepts of good programming. I experienced the same problem with my commercial programming tools I wrote for use by programmers. So often my tools were compared to Visual Basic and many clamored for a more visual development system. My framework could easily be used for hand coding an app without a designer, but customers needed it so much that I was forced to build my own Visual Designer. It took me years to develop the skills to build a designer from scratch, but after 5 generations of my software I finally produced an environment that would have put early versions of Visual Basic (1.0, 2.0) to shame. If my customers only know how much work it is to write a drag and drop environment from scratch using only the Windows WIN32 API. But I digress. The point is that too much emphasis on game like environments will not produce the type coders needed in the modern world. Coding is not a game nor is it play. When I learned electronics in high school or wood working in elementary school, it was never a game nor taught as a game. It was work. But it was so exciting once I gained those skills. Do not underestimate what children can learn. It need not be a game to teach them. So how do you teach coding if it is not a game ?
Coding is a Science and an Art
Coding is both a Science and an Art. First teach coding like it is a science, because it really is one. When one learns what really goes into making real world software and the complexity of it, one may at first be turned off. No one likes Science, right ? It is how it is taught that matters. One needs to see the beauty in what they are being taught. To illustrate: It is not easy to paint a beautiful painting. My wife loves art (and so do I) and we marvel at beautiful paintings by excellent artists. At first glance most of us would say, I could never do that. But one can be taught the techniques of art. When the complex is broken down into its simpler steps, one may catch on and say, “just maybe I could learn to do that”. But what motivates them to work hard to learn to be an artist ? An appreciation of the results. Yes, when you see how beautiful a painting is or some other art form, one may build the desire to want to “create” things like that themselves. People who love wood working are the same. They see the results and the desire builds to want to learn how to create such things themselves. I am a programmer, but I am also a wood worker, I have learned how to do auto mechanic work (I rebuilt an engine once) and to a degree an artist too. They are all similar to me. They are all sciences in that there are challenging skills to learn, but they are all art as well. Art could be defined as the skill to create something unique. Coding is no different. For years things like wood working, electronics, art and other skills have been taught in school. It is not different with coding. It is simply just another skill with its own challenges. Not everyone loves to work on cars or build using wood, but those who have the love for it (or develop it) can and will learn the skills necessary if they are motivated by the benefits or results. I learned auto mechanics, not because I love it but out of necessity. I could not afford to pay the high costs of auto repair and could not afford new cars, so I learned how to work on cars myself, from books (no schooling). But other skills I learned was because I enjoyed them or desired the results and enjoyed creating.
So if there is one thing I have learned about coding is that, appreciate that it is not a game, but a real skill, so teach it like it is such. “Oh, but you likely were taught in college how to program and many young people may never go to college like you” some may say to me. Guess what ? I am a self taught programmer. In the 1980’s I bought my first home computers. A TI99/4A, then a Commodore 64 and some Atari’s. I waited until I could get them on clearance, since I could ill afford buying one new, but when I got them, I quickly saw how amazing they were (and back on those they didn’t do much by today’s standards). Coding was an art to me. The joy of creating your first program that simply printed the same thing multiple times then led to even more complex stuff.
Back in the old days one could buy magazines which taught coding (remember the Compute Gazette magazine). I gobbled up each issue and learned more. I then bought the Commodore 64 programmers reference and even a book on Machine language. Yes, I learned 6502 machine language and even wrote my own compiler.
Learning BASIC in those days did not lead to being “limited” in my ability to learn advanced coding, but led me to advanced things like machine language. The amazing thing though is that learning BASIC made me appreciate the importance of coding in a “natural syntax language”, which I still use even today. I never lost that, which is why I do WIN32 programming in (wait for it) , yes, BASIC (today Powerbasic). I can do most anything an old time C programmer could with the WIN32, but using BASIC. Now I write tools for programmers.
Try teaching BASIC rather than use a game
For those interested in teaching coding, why not try this as an experiment. Teach a child using BASIC using a simple code editor rather than introduce them to a game like programming like environment. No drag and drop visual front end. No game like stuff. Don’t make things like 3D easy with some kind of ultra programming language that can do 3D with just a couple lines of code. No make them work for it. Teach them that programming is a skill and one has to work for it to appreciate it. You can start with a nice BASIC language called ThinBasic. You can download it from their website here:
http://thinbasic.com/
It is free and so you can install it on every computer in a classroom. ThinBasic (it is an interpreter) is patterned after the Powerbasic language. Powerbasic is a professional language and while inexpensive, it may be more than a school can afford to equip every student. Once you get used to ThinBasic, then next try Oxygen Basic, which you can download here:
https://www.oxygenbasic.org/
It actually can compile programs to fast x86 machine language, both 32 bit and 64 bit (Windows). It is a bit terse in nature, but it provides some C like syntaxes which expose the student with a more terse language.
For those interested in the Raspberry PI, then check out Fuze Basic. It is now free to download and is designed for the Raspberry PI. You can download it here:
https://www.fuze.co.uk/
If you want to expose students to 3D and Graphics on the Raspberry PI, then check out AppGameKit for the Raspberry PI. It is free and you can get it here:
https://www.appgamekit.com/agk-pi
How about a BASIC for the Arduino ? Check out B4R (Basic) and you can download it here:
https://www.b4x.com/b4r.html
Are you interested in making your own Roku channel for school ? Did you know that the Roku development tools are free and the language is very similar to, yes, BASIC. You can get it here:
https://sdkdocs.roku.com/display/sdkdoc/The+Roku+Channel+Developer+Program
Lastly, one more BASIC to suggest and that is ROBOT BASIC. Interested in building robots in the classroom ? Why not check it out here:
http://www.robotbasic.org/
The key is, teach a real skill and demonstrate how creative coding really can be
Even if you yourself are not very experienced at coding (many teachers aren’t yet), why not try some of the programming languages mentioned above. Once you grasp any one of them, they teach them to your students exactly the same way you learned it yourself. It is important to teach patience because students my lose interest quickly. They need to see that the real creativity comes from those who patiently learn the basic skills. You are not trying to teach them so they can work for Microsoft some day. You are trying to teach them a skill which they may find beneficial personally someday. A student may want to be a carpenter. Show him or her how a carpenter can code solutions to problems (ie. calculate materials, costs, estimates, etc.). Demonstrate real world solutions to simple problems in life. Once they get the “bug” for coding, then you may be surprised how much they can learn on their own. Help them find resources online which answer their questions about coding.
Also one of the most important things to learn from is making mistakes. Yes, don’t give students a false send of empowerment from a drag and drop visual coding environment that makes them “think” they are a programmer, when they really haven’t done very much. Make them earn the joys of programming. Even if it means error after error, until they get it right. Some may find a solution in minutes, but others may take hours. Give them the time to find a solution. When they finally solve the problem, they will have greater joy because they finally figured it out themselves. You may be surprised how quickly they find a solution on the next project.
Lastly, allow the students to find their own creative solutions, even if they don’t fit the “official” model you expect. In elementary school, math was my better subject and how I use to hate it when I used shortcuts and the teacher scolded me for not doing the math problem the official “Long way” that they required. I stood my ground and would say “did I get the right answer” and when they said “yes”, I simply said that was enough for me. That may not have satisfied the teacher, but in later years as an experienced programmer I write all my own code from scratch often using my own techniques which I develop. It has allowed me to create some pretty amazing software at times. So don’t stifle creativity if a students code doesn’t fit the “official” model. It is part of the learning experience. At most, you may suggest they “compare” the results of their code with the so called “official model” and ask them, why did they chose a different route. What benefits are there in their style ? There are often multiple ways to solve the same problem. Let students learn to solve things using the skills they already have. Some of their solutions may be quite creative, if you just give them a chance. Remember that I said that programming is also an Art. It really is. Let the students find creative solutions and you will be teaching them the importance of being a “thinker”. Sadly in the real world many a professional programmer has become less of a thinker and more of a “copier”. I see this all the time on programming forums. Many a programmer is so concerned about finding a solution that they often will simply copy code right from a programming forum and use it in the software project they are working on, with little thought to whether the code actually works properly or has any bug (errors) in it. Consider this experience:
I was learning how to work with the WIN32 API DibSection API’s. I found some code on the Powerbasic forums I frequent, but as was my habit, rather than simply copy the code and use it, I always examine what API’s were used and how they were used and just made notes. Then I would go to the official Microsoft Windows SDK documentation and look up each and every API function and find from the official docs how to use them properly. I would then write my own code solution from scratch using what I learned. In this case though I noticed the code was treating the return value of the CreateDIBSection function as if it were a GLOBAL memory handle rather than simply a Bitmap handle. I could not understand how the programmer who posted the code made this mistake since he was known to be an excellent programmer. I then decided to search the web for more information about this and I came across examples which were written in C rather than powerbasic. Guess what ? The C examples were identical to the Powerbasic one, only different as far as the language syntax may go, but otherwise identical. The Powerbasic programmer likely didn’t know how to do the task himself at one point and when he learned how to do it, he likely just ported code he found written in C to Powerbasic without giving thought to whether the code was correct or not. My point is that when programmers just “copy and paste”, they stop being “thinkers” and can easily get lazy. When teaching students to code, it is not whether the code they write fits some official model or looks exactly like someone else’s code. It is a matter of whether it works or not. Does it solve the problem effectively ? Let students be creative. Ask them to prove their code solves the problem and works. Even if you don’t like how the code looks or how it accomplishes the task, let the test be whether it works. In the beginning you want to teach students to be “thinkers”. They can learn important styles of coding which are important for things like modular design, easier debugging, etc much later. For now teach them to be creative, to think. If you do, they may get the “bug” and really enjoy coding.