7 ms·
10 years ago JavaScript was an ugly language, with its clunky prototypal inheritance and so on. Modern JavaScript is a beautiful language, however, especially w
by flowerlad 5y ago
10 years ago JavaScript was an ugly language, with its clunky prototypal inheritance and so on. Modern JavaScript is a beautiful language, however, especially when enhanced with static typing as in TypeScript. So much so, that Stanford has replaced Java with JavaScript for its introductory programming course [1].
[1] https://web.stanford.edu/class/cs106j/handouts/01-GeneralInformation.pdf https://web.stanford.edu/class/cs106j/handouts/01-GeneralInf...
- BenjiWiebe 5y agoI feel that being nicer than Java is a pretty low bar.
- qsort 5y agoWhich version? I feel like Java >=11 is absolutely fine, but if you're talking about earlier versions you have a point.
- xhkkffbf 5y agoA number of schools like Dartmouth did this more than 15 years ago.
- criddell 5y agoPicking a language to teach programming and concepts in computer science presents an interesting conundrum. Do you pick a commercially relevant language (which most students want) or go with one that might be better for academic purposes? I probably lean mostly towards the former because time spent learning something like Eiffel feels somewhat wasted.
- qsort 5y agoOn the other hand, there are concepts (closures, objects, pointers) that come more naturally with some languages, and you absolutely need to learn the concepts even if you don't end up using the language. Don't pick one, pick a healthy mix.
- dehrmann 5y agoTo me, the dilemma is between a language that's easy to learn and one that is useful once you learn the language. Most languages have too many warts and footguns to be easy to learn, but learning a toy language isn't good, either, because it's not useful.
- lanstin 5y agoNo one should have a computer science degree and not know multiple languages and multiple programming paradigms. Prolog, lisp or scheme, C, JavaScript, Haskell. The long term task of the professional software developer is to learn new stuff. Helps if your awareness of the cool things you could learn is already broad. I cannot explain how wrong it is to graduate with Java only and think that is sufficient. To be honest, I would also want people to understand the halting problem and Godel’s incompleteness theorem’s proof, as understanding the equivalence of apparent different systems that can handle the integers is very fundamental. And these days some knowledge of distributed theory is also good, the Lamport time clocks paper and so on. Unless the student is ambitious and doesn’t really like programming and just wants to program for a few years and then get into management or something like that (product? bizdev? I’d that a thing?) they will go thru many iterations of interesting new technologies. The brain that enjoys learning mind-bending shit will have a broader conceptual base and a better chance to see how lisp macro type things can help with k8s configs. Or while lazy argument evaluation might not be in your language, having it in your tool box for message processing design or you know evaluation of user preference rule sets against an event might be helpful.
- klibertp 5y agoNo! Eiffel should be the default OOP language for any kind of course. Being forced to think about pre- and postcoditions and invariants by the language is a really good thing for beginner programmers. While the syntax is somewhat verbose (mainly because of using keywords instead of most punctuation) Not teaching about Design by Contract is yet another billion dollar mistake in computer science. There are DbC libraries or frameworks for just about any language, but only very few programmers know about its existence, which leads to criminal underutilisation of the technique in the industry. I can't be sure, but I think there's a lot of thought, at least, behind selecting a particular language for an introductory course on programming. I don't know which language I would choose, but I'd like something that would broaden the horizons of student as much as possible. It could be Mozart/Oz or something similar.
- ksml 5y agoActually, the class you linked was an experimental class, and we ended up going with Python instead. (source: I was the head TA for that class)
- galangalalgol 5y agoWhy a dynamically typed language to learn with?
- ksml 5y agoI think there were two main reasons: choosing a popular language (JS and python happen to be among the most popular, accessible languages) and pedagogical simplicity (it's nice to avoid burdening beginners with extra syntax when they're already struggling to learn other things). Some unscientific evaluation showed that students picked up static types just fine in our second programming class (which is in C++) Personally, I think we should be teaching static types and I pushed for Typescript, but it didn't happen.
- bachmeier 5y ago> it's nice to avoid burdening beginners with extra syntax when they're already struggling to learn other things As someone that teaches college students to program (not in a CS department) that statement is correct but doesn't provide the full picture. It's good to get rid of the extra syntax if and only if you don't need it - and that means you're intentionally limiting what you're teaching them.
- extra88 5y ago> you're intentionally limiting what you're teaching them Yes, that’s the point. It’s an introductory class, choices have to be made about what to teach when.
- bachmeier 5y agoWell, of course, but the point is that avoiding syntax is not a great criterion for defining the fundamentals of programming. A couple orders of magnitude more important is to decide what concepts are useful for beginning programmers to know.
- axguscbklp 5y agoI think that it was beautiful 10 years ago, too, if you mainly used a subset of it, relying heavily on closures and avoiding constructors and "this" as much as possible. I think that prototypal inheritance is elegant but in any case, there was never much reason to use any inheritance syntax to begin with other than perhaps in rare cases where one wanted to really maximize performance. As for static typing, while it has its uses, the idea that it makes things more beautiful is subjective. Arrow functions really are a great bit of syntactic sugar. I know that they are more than that, but since I avoid "this" anyway, for me they may as well just be syntactic sugar. As for the "class" keyword, I find it to be utterly pointless but of course, tastes vary.
- geuis 5y agoJavascript is still based on prototypal inheritance. The newer class syntax is just a wrapper.
- dragonwriter 5y ago> Javascript is still based on prototypal inheritance. Protoypal inheritance and class-based inheritance where classes are themselves first-class objects aren’t really all that different, anyhow.