News for hackers. Stuff that matters.
Re:Why did we ever think a student's first programming langu... by random-string on Saturday June 26, 2021 @11:17PM (#27648245)
The first language is incredibly important and I normally recommend javascript for the following reasons

- it's /highly/ accessible (any computer with a browser can compile and run javascript - you just need to get your browser to load the file)

- it shares a lot of its syntax with C-Style languages (which makes transference to other languages much easier

- it's 'relaxed' on how it enforces rules (now, this is contentious, should a learner be allowed to get away with mistakes that will haunt them later, or should a learner be hobbled and forced to be precise from the get-go, IMO the former is easier for people to upskil with than the latter)

- it's (currently) got commercial value (that is, you can get a job with javascript on your CV)

Re:Why did we ever think a student's first programming langu... by _huayra_ on Sunday June 27, 2021 @03:33AM (#27649444)
The relaxed rule enforcement is very difficult for beginners to understand. After one has experience with other languages, we kinda understand that every language is gonna have at least one crufty WTF corner, but beginners will become really confused at the behavior like the infamous "Wat talk" [0] demonstrates.

Even Python has some quirks beyond the usual monkeypatching madness that can occur, e.g. with regards to name scoping.

I'm honestly not sure what could fit here that isn't a LISP dialect (which I think is pedagogically the right choice, but is usually impractical unless one is sure that one wants to do "hardcore" CS stuff, vs. using coding as merely a tool in another field).

[0] https://www.destroyallsoftware.com/talks/wat

Re:Why did we ever think a student's first programming langu... by speedgoose on Sunday June 27, 2021 @02:26AM (#27649118)
I think JavaScript is a bit too advanced though and some mistakes are quite difficult to explain, such as the scopes and event functions, or the relatively invisible typing system. For example, Reddit is full of beginners making fun of JavaScript because concatenating a number and a string using the + operator produces a concatenated string and not a sum number.

However to reduce the complexity, it's possible to restrict students to a subset, using eslint and one or two plug-ins. I like eslint-plugin-unicorn to restrict my co-workers.