Hacker News new | ask | show | jobs
by gervase 3093 days ago
Although I agree that PHP is an odd choice, I do think there's something to be said for teaching computer science with a language that the students (probably) won't end up using professionally. In some sense, this permits a decoupling of the language ergonomics from the underlying principles, thereby emphasizing 'learning' over 'training'.[0]

The very first language I was ever formally taught was Lisp. I haven't used it even one time since then, but it forced me to understand recursion at a cellular level, which has painlessly translated to every language I've used since then.

There's a significant distinction between "I understand how [inheritance|recursion|functional programming|etc] works in <language of choice>." and "I understand how [inheritance|recursion|functional programming|etc] works, period."

By choosing a non-mainstream language, I suspect that it makes it slightly more likely to end up in the second category than the first.

[0] Note that this applies only to formal computer science training, NOT developer bootcamps, where the end goals are totally different.

3 comments

> There's a significant distinction between "I understand how [inheritance|recursion|functional programming|etc] works in <language of choice>." and "I understand how [inheritance|recursion|functional programming|etc] works, period."

I would love that to happen and I think Harvard's CS50 is one such example. Assignments will cover C, Javascript, and Python. However, most 101's goal is to teach students to just learn to code. The "think like a computer scientist" is inaccurate (looking at the famous Python book: How to think like a computer scientist).

I honestly do not think teaching PHP in 101 will achieve the latter case. Combining Lisp/Scheme/Racket and a non-functional language like PHP will probably do.

Also, we need to educate each other that despite all the insecurities with PHP in the 2000s era (because there were plenty of free PHP hosting providers, a gem for kids like me back then), PHP has improved, and let's criticize poor LAMP stack configuration and bad practices. Anyway, I heard, and maybe not true at all, more PHP code at FB are now written without HHVM? Someone from FB please correct me if I am wrong.

I see your but many students will end up using PHP for work. In my NYC college a good amount of people I graduated with are doing PHP, there's probably more PHP jobs between the coasts.

I think Lisp or Scheme is great for that kind of pedagogy, though the trend lately has been to use "practical" languages.

I think the first language people cut their teeth with will be the language they use to reason about new problems. So it helps for it to be close to the language they will eventually end up using, unless you want to waste a lot of time translating the solution you have in your mind to the language you are required to program in
There's no way this is true. I cut my teeth on Microsoft QuickBasic, and I promise you that QuickBasic has been far from my mind for many years. At this point, I've written programs in about 50 different languages (not all of them professionally): procedural, object-oriented, applicative, concatenative, relational; different paradigms require different "modes of reasoning" to properly wield.

To extend your translation analogy, it's rather like learning a natural language in that at first you might think in your native tongue and translate on-the-fly, but to become fluent you must really internalize the new language and learn to "switch" your thoughts into it. I feel like the linguistic concepts of "registers" and "code switching" apply well to formal languages as well as natural ones.

Really? My first was Fortran IV; my second, after a lapse of a dozen years doing other stuff, was a minicomputer assembly language.