6 ms·
I think universities should cover JavaScript at some point, but using it in an introductory course seems short-sighted and problematic. I think if I'd have sta
by lol768 10y ago
I think universities should cover JavaScript at some point, but using it in an introductory course seems short-sighted and problematic.
I think if I'd have started with JavaScript I'd have been intimidated by the ecosystem, I'd have learnt about an approach to inheritance I couldn't apply to languages like C# and Java - and I wouldn't have gained an appreciation for strong typing. When I first learnt about how integers can be stored using two's complement it was easy to see how this mapped to the "int" type in Java and I could experiment and see how this worked in practice. Everything is floating point in JavaScript, a lot of behaviour is inconsistent with type conversions etc.
I get that it's popular and used on the web .. but it doesn't seem like a good first language.
- wildrhythms 10y agoWhat do you think is a good first language? 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.
- SOLAR_FIELDS 10y agoFor however "forgiving" JavaScript syntax is, I still believe that the syntax is a bit intimidating for beginners (curly braces). 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)
- lol768 10y agoIt's a hard question to definitively answer. I think Python has a lot going for it. It doesn't do dumb things when testing for equality, it's predictable. 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.
- u801e 10y ago> 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 function Your example has nothing to do with OOP. It's simply how python handles variable scope outside of a class.
- lacampbell 10y agoNot the person you asked, but I would say one of Scheme, Lua, or C. 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.
- nobleach 10y agoActually, all three of those sound like a fantastic mix. I was taught Turbo Pascal at first, and then my college classes were in Java (mostly). So it was more concept based. But each of those languages that you've specified, highlight different facets. (Interpreted vs dynamic. Functional vs imperative - maybe toss in some C# for OOP) 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".
- lolive 10y agoThe most important is to learn object composition & strong type systems. So I would say Java 8 (in an IDE, of course).
- goatlover 10y agoWhy should a beginning programming class have to include learning an IDE?
- lolive 10y agoSo you get a safe refactor feature for free. So you don't get afraid of refactoring. So you do refactor. So you get used to that exercise. And eventually you refactor in your head before typing. Plus you get types hints for free, and safe auto completion too.
- mrmondo 10y agoPython, then as a second move down to C.
- madhadron 10y agoI have yet to see anything superior to the TeachPack languages in PLT Racket, though a friend of mine is building a similar incremental system of instruction in Python.
- rakoo 10y agoAs a fan myself, I'd go with Go. 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
- bdcravens 10y agoI think there is something to say about approachability. Perhaps an interesting approach would be to teach TypeScript (though your point about ints vs. floating point is still true)
- neutronicus 10y agoI actually think it's a great first language. Not because of anything intrinsic to the language itself (which I loathe), but because it's hosted on the browser and has baked-in notions of "making the browser do things". The students get to start learning to program with a language that was created to automate an environment they are comfortable and familiar with. No longer do you need to haze them with ssh-ing into class servers to run a compiler to create executables that interact with the user via the console.
- lol768 10y agoIf WebAssembly becomes a viable compilation target for other languages (and browser support is there), would you support the teaching of those too for the same reasons? I think part of this is an issue with academia - the tooling that's recommended tends to be (in my experience as a student) outdated, difficult to use and completely out of touch with what's used in industry. Throughout the whole of my CS degree first year we were editing Java in gedit and compiling it with (an outdated version of) javac! Dependencies were downloaded as JARs and manually added to the classpath. There are so many better tools available, especially for use in teaching. For example, JetBrains have done some really great work on an educational IDE for Python (https://www.jetbrains.com/pycharm-edu/concepts/ https://www.jetbrains.com/pycharm-edu/concepts/). GitHub offer a whole suite of tools for the classroom. They just don't seem to be used as much as they should. I think Python (combined with some GUI/graphics library) could be really valuable and avoid the whole "console interaction" thing.
- neutronicus 10y agoI would, indeed.
- ams6110 10y agoThe point of real computer science programs is to teach computer science, not specific programming languages or IDEs.
- krapp 10y agoIf I were going to teach an introductory programming course in Javascript, I wouldn't bother with the ecosystem, it would just be plain vanilla JS. That's actually how the javascript class I took worked - attach a js file to an HTML file, zip it and upload it to moodle. Teacher unzips it, double clicks it, and if it doesn't run, you fail. Then he checks the actual code. I think many people here underestimate the level of knowledge needed for an introductory course. People can worry about the way integers work once they actually grasp what a variable is and how functions work, in a later class using a language where those things are more overt.
- staticassertion 10y ago> If I were going to teach an introductory programming course in Javascript, I wouldn't bother with the ecosystem, it would just be plain vanilla JS. I assume they're referring to self-teaching outside of class.
- lhnz 10y ago> I wouldn't have gained an appreciation for strong typing. TypeError: undefined is not a function On the other hand, JavaScript can make you appreciate strong typing, when you eventually encounter it. (Or at least I personally found that JavaScript made me care a lot more about static typing and correctness than Python ever did because it is so easy to make mistakes.)
- nobleach 10y agoMy first year Java textbook had nothing concerning how to set up Maven/Ant builds/SpringMVC/JSTL/Enterprise JavaBeans/etc. It was about data structures and algorithms. I seriously doubt Stanford is going to teach Webpack/React/Redux. I don't think a college should cover a language in particular. Leave that for the job-place. Obviously some language differences/features can be beneficial. (Garbage collection vs Reference counting for example). Overall, college is place to be taught how to think about solving problems. So, it's just fine as a teaching tool. Then again, I still believe everyone's first language should be Pascal (like mine) as it's a wonderful teaching language.