Monday, April 08, 2019

Teach Programming or Teach a Programming Language

For me, teaching is all about the concepts. Programming languages change. My first programming language was FORTRAN. This was the big language with I was in university. Today? Not so much. But loops and decision structures still exist. Over my career, I have learned a bunch of programming languages. I’m not sure I want to know how many but its a lot.

This morning I was reading Mark Guzdial’s blog as one does (Why we should explore more than one programming language across the curriculum) which comes as I am looking hard at my school’s computer science curriculum.  We teach several programming languages. Visual Basic in our freshmen course, App Inventor for our mobile app development course, C# in honors programming, JavaScript in AP CS Principles, and Java in AP CS A. SO potentially students can learn a bunch of languages during their time here.

Is this good or bad? Are there too many languages? Are these even the right languages? I believe that much is dependent on ones goals. Is our goal (in HS CS) to teach a programming language or to teach how to program (programming concepts).

As I started off this post, I believe that in the real world people who develop software, professionally or other wise, will need to learn new languages as time goes on. Mark has been writing a lot about task-specific languages (Task-specific programming languages: People aren’t dumb. Programming is hard.) and it is pretty clear to me that is a coming thing.

Teaching all programming classes using one programming language is probably a great way to teach that language but to quote Mark’s blog “We have no evidence currently that language-specific programming knowledge will transfer” So how do we prepare students who will have to learn new languages for new tasks?

Someone once said that the second programming language is the hardest one to learn. I can see how that could be the case. On the other hand learning programming languages does seem to get easier after that second one. I believe it is because learning a second language forces one to think beyond the syntax.

In one class, some years ago, I started showing my AP students who to do the same loop in a number of languages, including assembly language, and one student claimed later that was the most valuable lesson of the course. I still try to show multiple languages at times but since most of our students have already been exposed to several by the time they get to Advanced Placement that seems less necessary today.

Still I toy with the idea of writing a parallel programming book using several languages.  This is an idea borrowed from parallel translation Bibles where several translations of the Bible appear side by side on the page. A great study tool for religion that might work in programming as well.

Coming back to goals, I can see teaching a lot about one and only programming language as a somewhat reasonable way to prepare for a job but not for a career. I still remember getting my first programming job because I knew one language pretty well. Six months later I was handed a project specification and a language reference manual for a language I had never heard of and told “go to it.”

I truly believe that having a background in multiple languages was the difference between success and failure for me.


Garth said...

Multiple languages is a must. The kids have to be able to learn a language on their own. We as teachers have very little idea what language they are going to need in the future (the local university has gone through three languages in their intro course in the last 5 years). On the PC side they need to look at Java, Python and C#/VB at a minimum. HTML and PHP would be nice. On the Mac side Swift would be something to look at. I do not think they need to be good at any of these coming out of high school, but they do need to be able to know how to get better.

Unknown said...

In principle, I agree that exposure to multiple languages is a valuable learning experience and will be useful should the students decide to pursue computer science / coding in the future.

That said, there are advantages to focusing on one language across the curriculum. For example, I teach Python to middle and high school students across several courses; in some cases all the students in a grade take the course, while in others it is an option or elective. I can definitely see how focusing on one language helps the less natural students with reinforcement over the course of a few years. The more advanced and motivated students then switch to Java for AP.

It's roughly analogous to learning a foreign language - what's better, learning four languages over four years, or focusing on one language for four years and mastering it?

I think if you teach computer programming and a specific language in depth, then it will be easier to transfer that in depth knowledge to a new programming language.