As usual Alfred Thompson’s blog got me working on something I do not really do not have time to work on but anyway… This time it is a Morse code conversion program. I am happily putzing along thinking of nifty ways to do the program. In a moment of brilliance I decide to Google “Java Morse code conversion” and “Python Morse code conversion”. The solutions are much, much simpler that my solution but they rely on understanding the intimate details of the language (hashmaps for Java, something like it for Python). No cool algorithms, no problem devolving, just a built-in function that plops the solution down on the screen. This type of approach/solution to the problem brings up the big philosophical idea of what is programming, at least at the high school level, trying to teach. If teaching programming is a “get a job” thing (see this blog) then yes, we need to teach the heck out of Java (or whatever) with all the whistles and bells (hashmaps and like stuff). (Good luck finding high school teachers with that level of Java (or whatever) expertise.) If, on the other hand, we are trying to teach thinking and problem solving skills how much of a language do we teach?
I look at this Morse code problem as a problem requiring looking at a series of dots and dashes and how am I going to tear that apart and look at the pieces parts. Once I have the pieces parts then how am I going to compare that to something to get the correct letter. (I figure the letter to code is easy, the code to letter is the real work.) I see the problem as developing an algorithm, not as remembering a coding method/function for a specific language and then just typing. This is what I want to teach the kids. Once they understand algorithm development then a language is irrelevant. They could write this Morse code problem from Small Basic to Java.
The other side of the argument for teaching only the basics of a language and then building algorithms using those basics is they can never do anything significant in that language and what they do write is usually very inefficient. My solution for the Morse code problem is the baseball bat solution, beat it into submission. The Java expert would be able to use tweezers for the same result. I realize that as problems get more complex it is a necessity to have more than the basics in the knowledge tool kit but where do we draw the line in high school?
I am a problem solving type teacher. This is somewhat affected by the fact I can program fairly poorly in about 8 different languages and am a wiz-bang programmer in none. Given a problem like the Morse code problem I can code up a solution in at least five of those language and, given a little time, maybe another two. The code will not be pretty but it will work and the devolution of the problem will allow the use of almost any language.
So my question becomes do we, at the high school level, do a two year program of one language in an attempt to generate job market programmers or do we do a more broad field approach with multiple languages in an attempt to generate problem solvers who are not really good at any language? Of course I am a strong advocate of the latter.