I wrote this blog in a single sitting. I could not type as fast as I my mind raced because it addresses an issue that I, as an Alberta high school computer science teacher, struggled with for decades. I thought and read and experimented and queried and reflected on this issue for decades. I make some statements that should be documented. I plan to do that, but first I wanted to get the lay of the land in front of us. For now … welcome to Best Programming Language Blog 1.0.
Students necessarily implement algorithms in one language or another. Students necessarily work with one set of syntax or other. Just as poetry and concepts and philosophy are expressed in Hindi, Mandarin, English or Sanskrit, so are algorithms expressed in BASIC, Fortran, Scheme, C++, Java or Python. It is necessary to learn one or another programming language to implement algorithms.
All languages are not created equal. There has been an evolution in the use of languages. Just as the dialect of Canterbury Tales evolved into English, so has OOP evolved from Smalltalk in 1980 through C++ and Java and Python. Just to complicate matters, some languages continue to themselves evolve mightily through one version after the other while others become stagnant and abandoned. Even within a grab bag of similarly powerful languages, it is a generally a false equivalency that asserts each to be equally eloquent just because they may be equally powerful.
Further, languages exist in ecosystems of culture and artefacts that make them more or less relevant, accessible, and learnable. English is well known to have more irregular verbs than most languages, yet there are multitudes more documents of literature and science expressed in English than any other language, including the logically engineered Esperanto. Computer languages, like human languages, exist in a culture of usage supported by tools and documentation and applications. Some languages are indeed more equal than others.
When I taught, I typically arrived at school before 8:00 am, taught and “performed” with students throughout the day, including supervising them in my lab during lunch hours and inviting lost souls to take courses in my lab during my preparation periods. Typically I worked with students one way or another for 8 – 10 hours each day. Secondary school teachers simply do not have the time to author textbooks and exercises and cleaver lesson plans, although I did a lot of that early in the morning (I was always an early riser around 5:30 am) and on weekends. Most teachers spend more time with their students than their families.
Teachers need to be able to share resources and confer with one another around common resources and a common language. It is true that the concept is the important outcome and not mastery of some specific language syntax, but it is also true that syntax is the vehicle by which algorithms are expressed. Shakespeare wrote in English. Hugo wrote in French. Computer programmers implement algorithms in a specific programming language. Facility with a language is a necessary though not sufficient condition to grounding an algorithm in the real world.
Tool kits such as those packaged in an Integrated Development Environment (IDE) can support and speed both learning and development by magnitudes. It is ridiculous to force students to use a typewriter when they can harness the power of a computerized word processor. Likewise, it is equally uninformed to force students to bang out code with a naked text editor when the student can reap the efficacy of immediate context sensitive feedback.
Desirable interactive feedback features found in an IDE include the following.
- Syntax Highlighting – different kinds of code have distinctive colours and/or text styles (bold, italics, proportional fonts) Aids reading code and identifying errors.
- Content/code Assist/code completion/autocomplete – provides a list of plausible terms that are narrowed with each keystroke. Highlight the desired term and press enter. Predicts the word that is wanted based on keystrokes already typed.
- Context completion – completes words or entire phrases based on context from a training data set.
- Spell Check – If a term is not found in a list of legal terms, it is flagged
Every tool captures a concept. Tools in an IDE are concepts waiting to be learned through discovery, experimentation and application. The more feature rich an IDE, the higher the opportunity for learning.
Students can use the same tools for learning that an expert will use to enhance speed and correctness of execution. One of the most profound tools for learning is the “debugger”. A debugger is a set of features or tools that aids the learner to detect and diagnose logical errors in your program. The same tools that are used to aid error checking can also be used for exploration and elucidation.
We have learned more about the brain in the past decade than in all prior history because an MRI machine lets us observe the state of the brain while the subject remains conscious. A debugger is to a program what an MRI machine is to the brain. A debugger allows a learner to see what the “inside” of a program looks like when viewing the state of the user’s interface at a specific point in the run of the program. A debugger lets the student typical debugger supports breakpoints, suspending a program in the middle of a run so that you can examine the values of variables and expressions at that particular point in the executive of the program. This assists the expert in identifying logical errors (10,000 cheques being printed instead of 10 cheques), but it also allows a learner to inspect the specific state of data at an arbitrary point when the program is running.
Test Driven Development is one of the most important paradigms in project development in the 21st century. In program development, for every chunk of program code, there must be corresponding code that is an automated test case that will “pass” only if the program code does what you want it to do. Typically, the testing code is written first, then program code is written to pass the tests of the testing code. Java supports an elegant way to do this with “JUnit Analysis”. Every time you change the program code and do a test run of the program, all of the testing code of the entire program gets executed, thus testing all program code every time you run the program during development. Testing code is (hopefully) removed or disabled when the program is distributed to users.
Flowcharting was used in the last century to visually represent the structure of a sequentially, procedurally structured program, today we use UML diagrams as per the Unified Modelling Language (UML) to visually plan and represent the structure, behaviour and architecture of OOP structured programs. The Netbeans and Eclipse IDEs both support integration and generation of UML models and diagrams with their associated programming projects.
A well developed IDE also supports ease in shaping and maintaining a neat and easily read “structure” of the code itself, such as nesting code inside a class which is nested inside a package which is nested inside a program which is nested inside a project. A structure that is simple by design and maintained by practice reinforces physical patterns that mimic and reflect logic as students learn the syntax of a programming language.
Many tools of a powerful IDE save the learner precious time and allow them to focus on higher order process because these tools use brute force to implement routine and laborious functions. My favourite is “auto format” which automates implementation of oodles of tedious “rules” specifying where to indent code, whether to place a space or brace before and after a term, where to insert a line break, et cetera. I would delight in rattling off a couple dozen rules and telling my students that the code of every program they submitted had to strictly implement those rules. (Witness rolling of eyes and rude gestures.) I would then show my students the couple of “hot keys” which, when pressed simultaneously, would immediately restructure all of their code according to their own rules of “programming style” for structuring their programming code. An invaluable side effect of auto formatting is that the resulting, well formatted code is easier to read and think with than the often ragged etchings left from frenetic coding sessions . Structured code is the electronic equivalent of neat handwriting. If you have to expend precious time and concentration on deciphering the syntax of your own code, you are spending less of those valuable resources (time and concentration) on problem solving.
Refactoring is another feature that saves precious time. In Java , good form directs that each class is saved to a file with the same name as the class. Refactoring is a search and replace function that changes not only all instances of a term in the text, but also file names corresponding to that term.
Then there are the auto generate functions that automatically generate large chunks of code such as “getters” and “setters” methods of instance variables. This saves the expert significant time, but it also forces or “models” correct syntax for the learner can always type these things out “long hand” if they wish.
In short, a teaching and learning programming language should have a feature rich IDE that introduces powerful concepts, diminishes “dog work”, gives immediate error feedback, provides guidance for “correct” processing.
A great learning language should have broad and copious literature from theory to exemplars at multiple reading and comprehension levels. Most high school students read at a grade 8 or higher reading level, but some students, perhaps 10% – 20% of students, thrive on abstract theory coupled with challenging examples and problem sets. We want a broad range of resources so we can reach a broad range of students and so we can also provide a broad range of resources to each individual student. The strongest students still benefit from simple, clear, unambiguous examples. In the world of high school computer programming languages, the publishers give the most attention to the teaching and examination languages used, firstly by Advanced Placement, then by the International Baccalaureate Program, simply because the textbook market is too small otherwise; The serious money spent on textbooks is spent for resources for these two programs, predominantly for Advance Placement because it has the greatest numbers.
Teachers do not have time to author. It is useful and even career saving for a teacher new to teaching computer programming to find a community all of whom use the same programming language and resources. Then teachers can better share ideas, lesson plans, exercises, quizzes, and examinations. It also then makes sense to have a division of labour where one teacher can spend a lot of time honing a particular resource or lesson and then scale it’s use to multiple colleagues.
It is not just about identifying a language that is most “powerful” (greatest functionality) but rather a language which is associated the most efficacious resource ecosystem, one very important resource being colleagues who use the same language and resources in their classrooms that you use in your classroom.
Then too the selection of a language depends on the age and development stage of the student. There are precocious students in computer science just as there are in chess and mathematics. However, for the bottom 90 percentile, a choice of language should also correspond to the student’s mental age and stage of cognitive development.
In past decades Seymour Papert demonstrated that six year olds could learn to use and understand recursion through creating programs by directing a mechanical of a turtle. Subsequently a number of languages, famously Logo, created “Turtle Graphics” that primary aged students to learn to the programming process. Today we have a number of such “toy languages” – languages created for the express purpose and exciting and serving the cognitive skill sets of beginning programmers: Scratch from MIT and Alice from Carnegie Mellon University are the two widely used such languages. Scratch and Alice excite beginning programmers of all ages, including beginners in post-secondary institutions. Since when must post-secondary students have only choices of challenge and drudgery. Bernard Shaw complained that it is a shame that youth is wasted on the young. Likewise, it is a shame indeed that the ease and fun of toy languages should be denied older students who have not yet caught the thrill and swill of problem solving with a computer programming language.
Early in my high school teaching career I recall visiting a good friend who taught grade 1. Her room was filled with colour and posters and it made me excited to be in that room. I began placing colourful and exciting posters on my walls, often from far flung museums that I visited when travelling overseas in the summer. Students loved my posters. We make a mistake when we think that we outgrow appreciation for imaginative and colourful settings. Scratch and Alice belong every bit as much in university as they do in Junior High schools.
Click on the pictures below to blow them up to see some of the many the posters on my lab walls.
The Organisation for Economic Co-operation and Development (OECD) is an organization that promotes economic stability and democracy in its member countries and in developing nations. The OECD Programme for International Student Assessment (PISA) “is an international study that was launched by the OECD in 1997. It aims to evaluate education systems worldwide every three years by assessing 15-year-olds’ competencies in the key subjects: reading, mathematics and science. To date over 70 countries and economies have participated in PISA.” (Source: http://www.oecd.org/pisa/)
In 2009 Alberta’s 15 year old students in the PISA study ranked among the top in the world in reading, mathematics and science. (See pdf document Measuring up: Canadian Results of the OECD PISA Study.)
- Reading: 5th in the world in reading just behind Shanghai, Korea, Findland, and Hong Kong.
- Mathematics: statistically tied 8th with Switzerland, Japan, Netherlands and Macao behind Shanghai, Singapore, Hong Kong, Tapei, Finland and Liechtenstein.
- Science: 4th behind Shanghai, Finland and Hong Kong.
Alberta high school students are among the most academically skilled in the world!
In 2012 and 2013, in a thoughtfully planned high school program where few if any grade 10 students have experience with a computer programming language, I contend that it is most appropriate to use a toy language in grade 10 to introduce students to programming in a fun and easy to use interface. I am personally familiar with Alice and would recommend a full course in Alice.
However, it is my experience that., where grade 10 students in September are still basically “children”, by the time they enter grade 11 and definitely grade 12, most have matured enormously and now seek courses that are “worthwhile”. A “worthwhile” course is one that optimizes opportunities for intellectual growth and prepares students for post-secondary education. Yes, it should be fun and inspiring, but above all it must be “worthwhile”. Academically mature grade 11 and grade 12 students are willing to work hard and long if they feel that what they are doing has an academic payoff that will advantage them in post-secondary education. Well informed families know that the vast majority of jobs of the 21st century that will provide a middle class income and lifestyle will require post-secondary education. The combined 21st century pressures of globalization and technology conspire to eliminate traditional jobs that only required a high school education. The 21st century employee will be expected to exercise a greater degree of autonomous thought, decision making and behaviour than contemplated by most 20th century families.
The mature grade 11 and grade 12 Alberta student of the 21st century can handle and should be given an academically challenging and “worthwhile” computer science experience. While there are a plethora of computer science related topics that might compete for space and time in a grade 11 and grade 12 Alberta CSE curriculum, I contend that the emphasis should be on mastery of algorithmic thought and process with a computer programming language because, in 2012 and 2013, experience and facility with an industrial strength computer programming language offers the greatest opportunity to scale the full scope of the cognitive and affective landscapes of Bloom’s Taxonomy. (Wikipedia: http://en.wikipedia.org/wiki/Bloom’s_Taxonomy)
Fifteen years ago there was an ambitious push with the functional language Scheme (antecedent LISP, now evolved into Racket) where teachers were paid to take courses in the language. Scheme was generally disastrous in high school programs where it was used. Functional programming languages do not have the wealth of supporting resources that early scripting languages have: C, C++, Fortran, Pascal, BASIC. The textbooks that existed for functional languages were typically written for computer science majors in post-secondary institutions. Those of us in Alberta who experimented with Scheme found Scheme to be an abject failure in our high school classes. That may well have been due to the teacher’s lack of skills in the language, ergo, the benefits of a rich ecosystem of supporting resources.
In my opinion, the choices of candidate, cognitively respectable computer programming languages for grades 11 and 12 Alberta students, languages supported by a rich, cultural ecosystem of exemplars, tools (IDEs) , literature and audio-visual resources become quickly narrowed to three computer programming languages:
These languages are all OOP languages. In 2012/2013 a learning language should go beyond the procedural processing of 1980’s BASIC and Pascal. When C++ was introduced to high school curricula, we found the powerful OOP (Object Oriented Programming) paradigm introduced, notwithstanding some briefly flirting with Delphi, an early OOP variation of Pascal. C++ was the “programmer’s language” because it supported both low level (assembly) and higher level (OOP) functions. However, few high school teachers had either university or industry experience with computer programming. The different flavours and implementations of different, often proprietary, implementations of C/C++ was frustrating for high school teachers, although there was a period of consensus in Alberta where most teachers used Borland’s C++. There were just enough quirks in different C++ implementations to throw time consuming “gotchas” in the way of learning instead of discerning the reason that code in a particular textbook didn’t work with your particular compiler. It wasn’t a stopper, but it was irritating. Those of us teaching dynamic memory management had constant hassles with C++ memory leaks.
Then came Java. Java was built for OOP from the ground up, plus it had the advantage of being owned by a single company: Sun Microsystems. Java also had something called a “garbage collector” that prevented (almost) all memory leaks. In 2010 Oracle bought Sun. Sun had made Java Open Source, but Oracle, like Sun before it, acts as a “guardian” of the Java platform. This single ownership of Java had the huge advantage for high school teachers of having a single source of specifications. Notwithstanding additional features added to Java with the introduction of evolving versions of Java, at least teachers could look to a single source for Java development. These advantages of Java (OOP, single source of standardization, not proprietary, rich culture of resources) combined with the fact that for years Java has been the language of instruction for the Advanced Placement (AP) and International Baccalaureate (IB) computer science courses make it virtually compulsory for a student preparing for the AP examination. One prominent Alberta AP teacher told us last summer (2012) that Java will continue being the AP language of examination for the next 5 years.
In the past several years we have seem the emerging popularity of a more flexible (less data typing) language called Python. By all accounts, Python appears to be the next contender for a meaningful high school programming language. Python is an interpreted, OOP language. Resources for teaching Python have not reached the quantity and breadth of Java, but they are appearing rapidly. There is some reason to believe that Python could gradually replace Java and C/C++ as the academic high school programming language. But not yet, not if you want to prepare students to write the Advanced Placement exam in the next five years.
For teaching and learning, one extraordinary resource has been the continued development of the Alice graphical 3D programming language, an almost unique advantage if later teaching and learning with Java or other OOP languages. Alice is a toy language that beginning students love and learn well with, but there is a one-to-line correspondence between Alice, which is written in Java, and Java itself; thus Alice conceptually matches the syntax and OOP flavour of Java.
Now we find Oracle providing $2995 online course to teachers for free! (See Oracle Academy Offers Java Courses Gratis To CSTAAB Members!) That is/was a great professional development opportunity for Alberta CSE educators in the winter and spring of 2013.
If I were teaching high school Computer Science today and I was given free reign to decide the language for each course, I would teach a full (5/6 credits) course of Alice in grade 10 and a full course of Java or Python in each of grades 11 and 12.
There are always some students looking for special projects or those who will not prepare for AP or IB examinations. I would offer those students the option to do an assembly programming language course or whichever of Java or Python that they had not yet taken. By the way, an assembly course that I did in fact allow my students to do for extra credit was Bradley Kjell’s Programmed Introduction to MIPS Assembly Language.
Finally, history does not always repeat itself. It may well be that Java will continue to be the most “worthwhile” language for teaching and learning, or at least one such language, for the next decade.
Summary: I give a “subjective rating” of each language below as a measure of features that I personally feel are important in a programming language for teaching and learning in an Alberta high scho0l. If you don’t like my numbers, why don’t you create your own table and then weight each factor according to its importance in your experience?