I've seen a lot of people say that Python is a good first language, but I think Javascript is just as approachable as Python.
I've seen a lot of people say that Python is a good first language, but I think Javascript is just as approachable as Python.
You want a small language with not a lot of extra bells and whistles. My first year CS classes were in C# using visual studio, and at the time I hated it. I had never coded before and I was drowning in complexity that had nothing to do with computer science fundamentals. It was only until I did some stuff with discrete maths that my thoughts turned to programming again - possibly because discrete maths was not taught in an "industry focused" way, and that freed up my mind to wander.
Focusing on stuff that recruiters want is a cancer in computer science education.
And I totally agree. CS grads should be DECIDING (not at first) what languages are to be used at their shiny jobs... Vocational schools are for teaching the languages that are "in demand".
At the same time, it's perhaps not as easy to write quick scripts if you don't know OOP (example: having to use the global keyword in helper functions). There's also the work required to get it set-up.
I learnt with Java. It gave me an understanding of OOP but in it did not give me a good understanding of lower level details and unfortunately I've not properly learnt to write code in C at university. In hindsight I'd have been better off starting with C. It would've been more difficult for sure, but I'd have understood what actually going on.
Your example has nothing to do with OOP. It's simply how python handles variable scope outside of a class.
It's been designed to have as little magic as possible, which is a good thing for huge teams working on huge codebases (its primary target) but also turns out to be a good point for learning a language. It's got all the niceties that make high-level programming easy and fun (GC, types, instantaneous compiler, integrated testing and benchmarking frameworks). Many Go developers could tell you about how coding small programs in python vs Go turns out to be similar from a developer experience point of view. I don't see any class-level task that can't be solved with the standard library, but if something else is needed, adding external dependencies is extremely easy. It's also going to teach students about the differences between concurrency and parallelism, notions that are desperately needed as the hardware has been multi-core for so long now but still hasn't been exploited as much as it should have.
Of course not everything is perfect, I can see a few issues:
* Go favors composition over inheritance to the point that the latter just can't be done. While I believe this to be the correct choice, it will hinder students' capacity to switch to other languages that favor inheritance, i.e most of them
* Go remains a "backend" language. There is no easy way to do any fancy graphical stuff, let alone work in the browser. Those 2 domains both have very specific demands that I feel are worth learning early
* There is no REPL for quick validations of intuitions or ideas. I do use play.golang.org for this, but it's far from being as smooth as running a python interpreter or dropping into the browser for a simple test
Plus you get types hints for free, and safe auto completion too.
Python has it's own magical syntax idioms, mostly in regards to array slicing and list comprehension, but even that seems a bit less intimidating than JS (I say this as someone who learned to code after being intimidated by it for several years)