What should we be teaching: programmers or thinkers?

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.


2 Responses to “What should we be teaching: programmers or thinkers?”

  1. gasstationwithoutpumps Says:

    I think the dichotomy “two year program of one language in an attempt to generate job market programmers or … a more broad field approach with multiple languages in an attempt to generate problem solvers who are not really good at any language” is wrong.

    To create problem solvers, you need to have them solve problems, and learn to recognize the difference between a good solution and a poor one. Spending all your time teaching them different languages gives them little time to learn to solve problems. Better to pick a language and get them to the point where they can solve problems in the language without having to spend all their mental energy wrestling with the language.

    Incidentally, “dict” in Python is a very fundamental part of the language, generally taught in the first few weeks. Inverting a mapping using a dict is a standard exercise fairly early in a course. It may be an advanced concept in Java, but it is foundational in Python. What language you teach does make a difference in what problems are easy to solve.

    If you want only solutions that are equally ugly in all languages, you should teach a very low-level language like C. Teaching a more advanced language and then only having students use the C-like parts is doing the students and the language a disservice.

  2. gflint Says:

    Good points. I am just nervous that if I focus on one language, which would have to be Python, that the University of their choice would use language X for their intro. I consider learning a new language as a problem solving task and teaches how to learn but as you point out, they never learn good programming solutions.

    The book I use does not hit “dict” until chapter 20. I usually get to only chapter 18. I will have to re-examine my chapter progression.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: