2.3 Essential Content Knowledge [CK]
Programming Languages
Perhaps the most stressful decision for teachers who want to teach coding is this: "Which programming language should students learn in my classroom?"
The most important distinction to make is between a high-level language and a low-level language. As can be seen in this diagram, the 'language' of computers is binary code which is considered the lowest level of language. However, humans need to be able to give instructions to computers and binary code is (nearly) impossible to work with.
As we ascend through the levels, the languages become more and more like human language (i.e. natural language) until, at last, we reach the highest level in our diagram with interpreted languages like Perl, Python, and Java. When we program in languages like Java we need a compiler program to translate instructions into low-level binary code that the computer can execute. |
Typically, higher level languages are easier to learn and to work with because they are closer to human language. In fact, certain high-level programming languages, such as Seymour Papert's 'turtle language' LOGO, were designed specifically to be simple enough for children as young as age four or five to use. Papert's efforts were carried on by his own graduate student, Mitch Resnick, who worked with the MIT Media Lab to develop the block-based coding language Scratch. Both LOGO and Scratch sit far above any of the high-level languages listed in the diagram above. However, such 'ultra' high-level languages are often severely limited in terms of functionality to prevent errors when the compiler translates the programmer's instructions into binary code.
Languages that sit lower in the hierarchy, like Java and C++, are often praised as being 'real' programming languages because they are actually used in commercial software. However, these are much more 'computer-like' and have draconian syntax and structure requirements. Further, a much deeper understanding of concepts like variable types, Boolean logic, and error-message interpretation are essential to code even the simplest programs. Thankfully, there are robust Integrated Development Environments (IDEs) that help with this process but those are downloaded programs which pose many problems in a school environment as previously discussed. These factors make such 'mid-level' languages poor choices for classroom use with students.
Languages that sit lower in the hierarchy, like Java and C++, are often praised as being 'real' programming languages because they are actually used in commercial software. However, these are much more 'computer-like' and have draconian syntax and structure requirements. Further, a much deeper understanding of concepts like variable types, Boolean logic, and error-message interpretation are essential to code even the simplest programs. Thankfully, there are robust Integrated Development Environments (IDEs) that help with this process but those are downloaded programs which pose many problems in a school environment as previously discussed. These factors make such 'mid-level' languages poor choices for classroom use with students.
Selecting a Language
So we want a language that is of a high enough level to be approachable but low enough to give us freedom and flexibility. Further, it would be preferable to have a language with simple syntax rules for new coders and that has minimal compiler program requirements. There is a language that I believe sits in this 'Goldilocks Zone' between Scratch (ultra high-level) and C++ (mid-level).
One organization that has worked tirelessly to develop a programming language that is both robust and 'learnable' is the Processing Foundation. It began with a Java-based framework called Processing which made Java much more accessible to students with specialized functions and relaxed syntax rules. In 2019 they partnered with Lauren McCarthy, a digital artist and programmer who created the specialized Javascript (JS)-based framework called p5.js. Since then the Processing Foundation has shifted their focus toward McCarthy's p5.js framework. Please note that Javascript (JS) should not be confused with Java as they are two separate languages.
|
So, without getting into the finer details, p5.js is a framework for Javascript that suits our specifications. In saying that p5.js is a Javascript 'framework' we mean that p5.js uses Javascript as a 'base language' then builds on top of it by providing some specialized functions and some adapted syntax rules. p5.js is robust in terms of what can be coded, it's approachable in that it has some really handy pre-made functions, and it is easy to compile for reasons that we'll explore in the section below.
Take a screen break. Get up and stretch before scrolling down!
Why Javascript (JS) with the p5.js framework?
One of the concerns around ultra high-level languages like block-based Scratch is that students might struggle to transfer the coding skills they acquired to lower-level, text-based languages like Javascript (JS), Java, or C++ which are more functional. Critical omissions in these high-level 'kid-friendly' languages include a lack of preparation for debugging syntax errors (i.e. 'grammar mistakes' within the language) and managing files. Students will be required to perform these activities using p5.js without the soul-crushing specificity required by languages like Java and C++.
Javascript (JS) based frameworks like p5.js are also extremely convenient for use in a classroom environment because they can be compiled by web-browsers like Firefox, Chrome, Safari and, of course, good old Internet Explorer. Therefore, they do not require any additional programs, like language-specific compilers or IDEs, to be installed on school computers.
The reason web-browsers can be used to compile p5.js programs is because the functional front-end elements of web pages are coded in Javascript along with Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS), two related but separate languages. As the diagram to the left illustrates, these three language elements provide the structure, presentation, and behavior of the pages we access on the internet. |
As if all the previously mentioned advantages were not enough, there is one more feature of p5.js that makes it the most attractive option in my opinion. Since Javascript is used in designing web pages, student can directly embed the programs they write in p5.js into web pages in the future. Further, if they pursue web design they will be very familiar with Javascript (JS) which is typically considered the most conceptually challenging of the three front-end languages (HTML, CSS & JS).
All that being said, you do not have to use p5.js in your classroom. There are many options, some of which might be a better fit for your specific situation. Many primary teachers prefer the simplicity of higher-level options like Scratch and high school teachers might prefer the rigour of lower-level options like Python. For Codegogy we will employ p5.js to teach coding, but ultimately it is up to you as a teacher to select the programming language you teach.
All that being said, you do not have to use p5.js in your classroom. There are many options, some of which might be a better fit for your specific situation. Many primary teachers prefer the simplicity of higher-level options like Scratch and high school teachers might prefer the rigour of lower-level options like Python. For Codegogy we will employ p5.js to teach coding, but ultimately it is up to you as a teacher to select the programming language you teach.
Freeze & Reflect (2.3b):
|