18 points · by nafizh · 8y ago · 57 comments
Teach a language and you will prepare someone for the present. Teach concepts and will you prepare someone for the future.
By concepts I mean things like closures, higher-order-programming, concurrency, explicit state, inheritance, security, encapsulation, complexity, laziness, etc
Also, I believe that you need to learn more than one language to full appreciate those concepts.
There is some irony in the fact that i developed my own indepth, initiative understanding of these concepts while learning JS.
You could learn using many different languages for sure, but I believe it would be more efficient with one language that is truly multiparadigm, where no paradigm is favoured and there are primitives for all core concepts.
With all these general concepts, techniques and design principles under your belt, learning the core of a new language is a breeze, almost just like translating the syntax.
Maybe it has all the primitives, or you have to use a lib or build your own, or apply a design pattern, it might be more or less verbose, but you would be just implementing the crucial thing, the design.
Of course, then you have to learn the idioms too to become proficient.
I don't understand where this concept comes from? It is as turing complete as any other language. From a "General Programming" perspective, it is also one of the most prevalent run time environments.
> You could learn using many different languages for sure, but I believe it would be more efficient with one language that is truly multiparadigm, where no paradigm is favoured and there are primitives for all core concepts.
I find being in a single language can lead you to associate the abstract concepts with the syntax too much. In moving the concepts between different syntax and forms the abstract notion becomes clearer, for me at least. I appreciate that learning everything in a single would likely be more "efficient".
> With all these general concepts, techniques and design principles under your belt, learning the core of a new language is a breeze, almost just like translating the syntax.
Absolutely! :)
Want to work with data from any API? Well JSON, industry standard data protocol, happens to already use exactly the syntax you're familiar with!
Want to give them a sandbox to mess around in...take your pick between jsfiddle, plnkr, codesandbox, etc. Many of these let you collaborate realtime with people to help them work through problems directly. Most people learning to program have 0 familiarity with using a terminal, and having to go through the process of getting an environment set up correctly ALONE is enough to turn off the vast majority of people to programming.
As the author already mentioned, rendering a UI in JS is going to happen on the most ubiquitous platform on the planet: the web browser. If a programmer starting today goes into UI work, the odds are that they'll be building UIs for a web browser is astronomically high, the odds that they'll be using a one-off python toy library is highly unlikely.
And last but not least, the syntax of JavaScript is very much like the syntax for Java and C. Learning JavaScript first makes it very easy to read code from other mainstream languages and have a good idea of what's going on. Particularly with ES6, there is very little to complain about in the syntax of JavaScript.
Sure, JS is the hip language for making SPAs, but not the best way to show what boolean logic is and the difference between for and while loops.
It's really no worse for that than any commonly used language. Perhaps you meant something else?
And I see data structures and algorithms mentioned below...I'm not exactly sure which data structure or algorithm it is that you suspect cannot be expressed in JavaScript?
And anyone who seriously considers teaching a first language that students can't use in a data structures and algorithms course (without having to learn a second language) isn't worth paying much attention to.
C is weakly typed and has implicit conversion. JS is weakly typed and has implicit conversion.
You most certainly mean static types, but even there we have issues with C because passing void pointers is a thing for generic ADTs. This is even weaker typing than JS offers (and that's without talking about the interactions with function pointers).
An even stronger argument against your position on static types is SICP. It's written in scheme, but I have yet to find an introductory book more packed with CS fundamentals. You can read it multiple times and learn new things (very rare for a book to speak to both the experienced and the novice).
If static types were really important, Java, all the C's, and most common be CS language would never be used and Standard ML would reign supreme (perhaps it should anyway).
Types are simply one weapon in the war between elitism and pragmatism.
What more concurrency are you looking for?
You are restricted to what ammounts to coroutining, which is just one of the many concurrency techniques out there, none of which you can teach with javascript.
You wouldn't be able to show many of the other possibilities of concurrent programming.
Parallelism I see as a hardware feature that can make programs faster.
I thought about the "callback hell", this is a bit more like coroutines, a quite limited form of concurrency (like non-preemptive threads). In this sense Js is very limited in what programming techniques can be taught.
I say this because, across the board, I know my staff would gaff at the prospect of trying to incorporate JS into anything other than an elective. Honestly, even to that, they would throw their pinkies in the air in retort of the thought that JS be taught at all in a 4-year institution. “Nay, let it be relegated to the community college.
...I know I know, ‘burn him at the stake’
Which, don't get me wrong, I'm a university snob and think software engineers should understand things all the way down to the machine level, but the snobbery in reaction to JS* being taught in 4-yr curricula (which I wouldn't doubt as a widely held reaction) is saddening.
*JS wouldn't be my first choice for an actual university course on real-world coding; but I do resent the the chasm between applicable and theoretical software engineering skills... though this problem isn't confined to Comp Sci.
Anyway, having packaged apps in Javascript (nodejs) , Java and several other languages/tools/frameworks , I find the state of packaging and GUI in Python simply pathetic, it really takes you 20 years back :)
I don’t see why anyone would need a specific “teaching language,” in the first place.
You don’t teach a language, you teach concepts. You teach about variables and call-stacks, function calls, how the hardware works, computational complexity, and common algorithms that are used.
In any application you’ll likely be using multiple languages and throughout a career you’ll be using many languages or you’ll be unemployed frequently.
I don’t have particularly positive feelings about Python as a language, in fact there’s a lot about it that I think sucks. But I feel the same way about Javascript and Lisp and C.
Which doesn’t take anything away from any of them. But it does highlight to me a deficiency in programming education if someone strongly believes that we should put off exposing students to new languages.
The syntaxes and libraries can be slightly different but the concepts are all very closely related. So I think it’s a huge problem that we allow people to have these complexes where they say “I’m a C programmer,” or “I only know Java.” Not that I’m against specialization but I think it causes some artificial intransigence that’s undesirable at any level and hard to break otherwise successful individual contributors of.
That being said there is a solid point to the article. If students want to delve into graphical displays great. Suggest they investigate JavaScript (after they get the basics of traversing an array down). Or teach both languages at once switching to JS for graphical portions. They are similar enough this shouldn't be too difficult. Plus it would help prevent language tunnel vision or language clinging and/or new language phobia.
You're either going to have to go the executable route, which is difficult to figure out your first time. Or you're going to go the web route, which is also difficult to figure out the first time, and you're going to have to not only learn html, css, javascript, but also WSGI, nginx, and a few other things as well.
I happen to think that going the web route is a really good way of doing things as a teacher because you get to teach a lot of general computing things along the way.
But the bottom line is what are you trying to teach? You can teach almost anything with almost any language, and in this case I'd say take the "programming" out of the "Programming Language" and ask yourself a different question: is there any one best language in which to teach people arithmetic, or art history, or physics, or music theory?
There's obviously not. It doesn't matter if you're speaking English or German or Japanese or Russian. These concepts can be described and explained just fine.
I think a conversation about what language to teach in has to boil down at least to the context it's being taught in and what is being taught.
This author's decision is as reasonable as anyone's based on what he's saying he wants to teach. And I think I have some sympathy. I don't have a 4-year degree in comp sci. Or anything. But if there's one thing I wish teachers everywhere in the tech world spent more time on, it would be deployment strategies.
Someone should be teaching that class at schools if they are not already.
For low-contact teaching where the students were going to be doing lots of independent work between contacts, that was more concerned with enabling students to try stuff out, I'd generally agree with this.
For other contexts, maybe not; I think Python (or Scheme, or some others) a better choice for a first language in a broad, structured CS curriculum. Though I'd certainly still agree JS is a useful thing to have in your toolkit fairly early on in programming these days.
Trying to not let that bias influence my opinion, I too have been frustrated with some of its shortcomings. Distribution, concurrency, and GUIs have been excersizes more in patience and persistence than utility.
I’ve moved most of my efforts into Nim and haven’t been disappointed. I don’t know if it’s a suitable teaching language yet.
But JS as a general purpose language? For web, web, web.
I also found the syntax, uh, interesting. Mainly the lack of braces to denote blocks, ie functions, loops, if statements, etc. Indentng to me seems problematic and a learning hurdle. But as a long time Pascal/C/Objective C/Swift/JavaScript developer, what a virgin programmer thinks I’ve long since forgot.
Better than that garbage JavaScript though.
and a Twitter thread from 2018: https://twitter.com/mkennedy/status/949688651058835456