8 ms·
Universities finally realize that Java is a bad intro programming language
- anthonybsd 10y agoI'm not sure I'd consider a decision to move from Java to JavaScript an improvement. They are going from a bloated syntax to a bad-habit goldmine. Why not go Java -> Python instead?
- ashnehete 10y agoI agree. Although JS is a powerful language, it is not suitable to teach in an introductory environment. How about C? It makes the student grasps not only logical constructs but also introduce a portion of computer organisation and architecture.
- maxxxxx 10y agoI would also go with C first. It takes the magic out of the computer and you understand what's going on under the hood.
- csciutto 10y agoThe Stanford curriculum goes from Java to C++ to C in the first core year of classes. Our final project is a memory Allocator (Malloc, Realloc, Free). By the end, students really do grasp computer organization and architecture.
- ashnehete 10y agoMumbai University curriculum goes from C to Java (actually its more of Object Oriented Methodology) and then we have a separate subject for Computer Organisation and Architecture. This is in 3 contiguous semesters. By the end, we know from low-level to high-level.
- ryandrake 10y agoFunny--I learned in pretty much the opposite order: Assembly -> C -> C++ -> Java. Seems odd to go top-down but who's to say which way is better..
- cillian64 10y agoI've taught introductory programming to undergraduates in both C and Python at different times. In my experience students struggle to grasp computer architecture and memory management at the same time as learning to think like a computer and formulate ideas in code. They have coped much better with Python and enjoyed how time/effort is spent solving useful problems rather than boilerplate. Ideally they would all learn about computer architecture and memory management at some point. But at least with this course motivation and interest is a big problem, and producing confident Python programmers seems a better result than terrified students who can't produce competent C.
- jacquesm 10y agoJS is a powerful language for a narrow domain. That makes it totally unsuitable as an introductory language because if the domain you wish to move to is not web development you now have to restart all over again with another language. Python would be better, java wasn't all that bad as a universal language it is applicable to many domains. But the ECT cycle of java could be seen as a drawback, python would remedy that to get the instant gratification factor.
- scarface74 10y agoI'm no lover of JavaScript -- especially without TypeScript -- but JS is the most universal language. There are frameworks to create server side components, Android apps, iOS apps and windows app Not that JS is optimal for any of those use cases.
- hocpoc 10y agoyeah this is my exact reaction. not sure if they are thinking that knowing JavaScript allow students to sell themselves for internship since webdev internship is getting much more popular.
- enraged_camel 10y ago>>They are going from a bloated syntax to a bad-habit goldmine. That's precisely why I think it's a good idea: with proper instruction, you can teach people good habits from the start.
- phailhaus 10y agoNot sure how that follows. You can try to teach good habits, but you're still throwing intro students into a language that doesn't care if you follow them or not.
- Lev1a 10y agoHaving gone from Python and a little C++ to Python and a certain REALLY pedantic language, I wish I had had one such unforgiving language/compiler from the start...
- enraged_camel 10y agoBut surely a university environment is the best place to experiment and learn what works and what doesn't. I mean, the majority of these students will have to write JavaScript sooner or later. Better they learn it in a controlled environment.
- phailhaus 10y agoUniversity is hardly a controlled environment; students are encouraged to get their projects working and then ditch them. There's very little incentive to write good code. Remember, we're talking about intro languages here. It's a much better idea to teach languages that encourage good habits because then going to "wild west" languages like javascript is much easier.
- deleted 10y ago[deleted]
- detaro 10y agoIn the first programming course many students can't judge "what works and what doesn't" yet, or even appreciate the details if you tell them, and are busy enough with the basic concepts behind what they are doing. You also can't really teach only an opinionated subset of the language, since students use all kinds of material to learn. Material about JS is often steeped in environment details (browser, nodeJS, JQuery, ...), and thanks to transpilation right now multiple versions are popular, which makes it even more confusing. It wouldn't be impossible to teach a good intro course with JS, but I don't see any benefit in doing so, and it wouldn't make the students very effective JS programmers.
- csciutto 10y agoI'm curious if a combination of JavaScript: The Good Parts, and a professor that emphasizes good practices can offset JS's inherent problems. Very few people formally learn JS. It's usually more of a read up on syntax, read documentation of a library, apply concepts.
- atarian 10y agoBecause you only need a browser. When you're just a beginner, setting up an environment can be extremely painful.
- misingnoglic 10y agoWith python you just need a browser too: www.repl.it/python
- Ductapemaster 10y agoWhile that's true, you learn a lot from going through those troubles. I disagree that we need to make it "easy" for students to get into programming by glossing over very important details like environment configuration. Someday they'll have to do it at their job - why not prepare them for it?
- lazyjones 10y agoIt's 2017. We have other options available in a browser: https://trinket.io/python https://trinket.io/python
- ghaff 10y agoI've gone through a couple online courses and some percentage of people obviously really struggled to get setup. It's probably significantly less of an issue at schools where "Intro to Programming" mostly assumes that you already have at least the basics of hacking around with a computer down. But it's probably hard for most people here to appreciate how daunting "never seen a command line before" is for many beginners.
- wlesieutre 10y agoEspecially once you get into managing dependencies. Virtual environments (whatever this year's flavor is, venv I think?) are a mess. I was trying to get VS Code to execute a python project in its virtual environment but gave up and just went back to running it in a terminal. There's probably a way to do it, but I poked at it for a while and didn't figure it out. Javascript might have its hassles, but even when you get to dealing with npm it's still more of a self contained thing.
- delecti 10y agoAgreed. Java was my intro language, and probably my favorite (those are probably related); conversely, I still haven't gotten the hang of Python, and it's one of my least favorite languages, but I still recognize that Python is a massively better first language than Javascript of all things.
- ashnehete 10y agoActually, Java was my first language too. And I still don't regret learning programming using Java. How much ever I love JS, I wouldn't have traded it for Java.
- pmarreck 10y agoI'm good with it. The more people they crank out learning the wrong languages, the more value I have working with the right ones. :P
- RUG3Y 10y agoSetting up Java or Python isn't that difficult. At the very least, being able to follow the instructions to set up either environment is a screener for people who aren't suited for something as detail oriented as programming, IMO.
- jhpriestley 10y agoPython has its own issues. Magic `__foo__` methods everywhere. Significant whitespace (there are arguments for or against it, but it's bad for beginners). One-line lambdas, `def wrapper`. Tuples versus lists, `(x,)` syntax. `global foo`. Ongoing split between 2.x and 3.x means that documentation is confusing. I think ES5 would be a legitimately better first language. Now that ES6 is everywhere though, javascript is a really terrible first language, certainly worse than python... the online learning material for a `for` loop, for instance, is now split between `for(var ii = 0; ...`, `for(let ii = 0; ...`, `for(var x in obj)`, `for(const x of obj)` (but make sure that something called `webpack` is set up with something called `babel` so that all of these will actually work). You'll find similar confusion when approaching variable declaration, module imports, etc.
- cpburns2009 10y agoThe magic methods in Python are used to support common, built-in functionality. E.g., `__init__` is the constructor (you rarely need `__new__`), `__len__` supports the standard `len()` function, `__str__` is equivalent to JavaScript's `.toString()`, etc. Signification white-space should actually help students when programming because it forces code to be properly indented instead of having an indentation disaster or misplaced braces. One-line lambdas and decorator functions are no worse than JavaScript's. The tuple syntax is clunky, but there is an important distinction between it and lists: mutability of the list itself. Frankly no one should be using `global` without a very good reason. The split between 2 and 3 is hardly worth mentioning. 2 is the legacy version. 3 is actively maintained and most major libraries have supported 3 for a while. Very little changed syntax wise between them. The split was necessary because of a fundamental improvement and disambiguation between textual and binary strings.
- smsm42 10y agoSignificant whitespace won't be much of a problem for a beginner that doesn't have a precocieved notion about whitespace not being significant. After all, in humanwrittenspeechwhi tespa cematters, doesn't it? So the concept shouldn't be too hard to grasp. As for magics, don't see why it would be an issue either. For a beginner, it's a magic incantation just like any other, for more advanced student, it's a callback/override just like any other. You can argue that this system has its disadvantages, but if you understand enough to argue about such matters, your education as a beginner is a definite success. 2/3 gap is an issue, yes. Fortunately, one can just teach python3 and leave python2 for advanced studies. It's not like students would be deploying in industrial production right after the class...
- cableshaft 10y agoMost do. From the article: "According to research published by Philip Guo on the ACM (Association for Computing Machinery) website in 2014, Python is now the most popular language for teaching introductory computer science in the United States. Eight of the top 10 U.S. computer science departments, and 27 of the top 39 (69 percent) use the language to teach the fundamentals of Computer Science."
- merb 10y agoEven PHP would've been a better move than to JavaScript.
- cpburns2009 10y agoAs much as I loathe PHP, I have to agree.
- cycrutchfield 10y ago>Java is popular, certainly, but it’s also extremely clunky and syntactically bloated. And Javascript?
- butabah 10y agoThe article fails to mention all the quirks with JS that will cause more headaches than "scary keywords".
- skummetmaelk 10y agoDeciding to ditch it for Javascript... They could at least move to a language which is not as full of traps for young players and odd quirks[0]. [0]https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat
- 0xCMP 10y agoJavascript is a great language to learn to program because it gives you feedback. Middle/High school students get something showing up and keeping them engaged. However, in uni I think Javascript is a very bad first language because there is a level of focus expected (and required eventually for them to be good developers) that you don't need Javascript to help with. It's better to pick a language like Scheme or Python to teach the /ideas/ of programming first and then transition to C/C++ or even Java.
- csciutto 10y agoAs a Stanford student, an important caveat is that 106J is not replacing 106A. It is still being tested out this quarter, and this is the first time it's being offered. Enrollment in 106A is still around 400 while 106J is 40.
- jabl 10y agoThis came up a when this same news was discussed a few days ago on some other site: The JavaScript first manifest: https://gist.github.com/rtoal/046c7be95aa077a832fcd87f5b024446 https://gist.github.com/rtoal/046c7be95aa077a832fcd87f5b0244... It makes a rather good (IMHO) argument that while, yes, JavaScript sucks, it does have redeeming qualities for usage as a first programming language.
- jacquesm 10y agoI strongly disagree. The kind of bugs you can create with javascript are enough to make pl experts scratch their heads, scope is a mess and while there is no shortage of web frameworks and resources that have to do with web development outside of that the library field is surprisingly barren. The only thing it really has going for it is distribution, if you have a browser then you can learn how to program in js.
- enraged_camel 10y agoI had a horrible time with Java when I took CS142 and CS143 at the University of Washington. It was a complex language even back then. As someone who had only played with HTML and a tiny bit of JavaScript back in the late 90s, I found the amount of boilerplate overwhelming and the language confusing. It didn't help that we didn't have the massive amount of online resources that we do today, so figuring anything out required digging through thick textbooks and obscure documentation files... if you could find them. I ended up getting a 2.8 in both of those classes, and it convinced me that I wasn't good enough for Computer Science. I ended up majoring in something related[1], and eventually found my way to a programming career. But I occasionally think back about those days and wonder what course my life would have taken if the classes were taught in a more friendly language like Ruby or Python (which were admittedly quite obscure back then). [1]https://ischool.uw.edu/academics/informatics/what-is-informatics https://ischool.uw.edu/academics/informatics/what-is-informa...
- jnellis 10y agoWinston Churchill said it best, "Java is the worst introductory language except all those that have been tried before."
- feelandcoffee 10y agoChurchill was one of the best coders out there. Like when he said "My Java code be buged. But in the morning will still run, and you will have to update your npm dependencies".
- spcelzrd 10y agoNo one ever wrote a book called "Java: The Good Parts" (glad I don't write Java (or JavaScript) on a regular basis anymore)
- kennu 10y agoI think JavaScript is an excellent choice. This is about getting people started, and you can start making your own apps in the browser right away with very little overhead. You can also ignore boring stuff like static types and only learn them later when doing bigger things. JavaScript also lets you learn functional programming basic concepts in an incremental way.
- jnbiche 10y agoAs someone who primarily makes a living from programming JavaScript, I don't think this is a good idea. Java may be a bit syntactically bloated, but it's a much better engineered language than JavaScript. The parts "fit" together in a more methodical way. And while a learner may be able to get started with JavaScript quicker, as they move into larger projects they'll find the quirky JS implicit type coercion rules to create hidden and hard-to-debug errors. And with Java's emphasis on interface vs implementation, it's an ideal language for learning data structures and algorithms. I'd say if you struggle with Java's syntax in your first year of CS, you might have a hard time making it as a professional programmer or academic computer scientist. If they really wanted to move from static->dynamic, I'd agree that Python would be a much wiser choice, even though it too has its idiosyncrasies. As jacquem points out, Python has the added advantage of a rich data science/machine learning ecosystem. Also, if they really wanted to use the web ecosystem, maybe TypeScript would be another wiser possibility than JavaScript? Edit: IMHO, perhaps the best didactic language is SML, but that appears to be a losing battle these days.
- ghaff 10y agoMy impression is that Python does in fact tend to be the default choice for beginning programming/algorithms/etc. courses. It seems a reasonable choice. It does have some peculiarities but is definitely mainstream. And it is suitable, especially in conjunction with its ecosystem (as you say), for a lot of tasks. It seems more generally useful for STEM students and others who aren't necessarily going to major in CS.
- hackermailman 10y agoI've seen more university calendars these days copy CMU and add functional programming like SML as the new preferred intro course, esp European universities it really is probably one of the best student languages for understanding/reasoning about large programs by using types and it puts everybody on equal footing since normally most first year students have zero exposure to functional programming. https://existentialtype.wordpress.com/2011/03/21/the-dog-that-didnt-bark/ https://existentialtype.wordpress.com/2011/03/21/the-dog-tha...
- foobarchu 10y ago
- jacquesm 10y agoReplacing a general purpose programming language with a language that really should have only one application (front-end web development) is a huge mistake. And there are many other, much better alternatives. Python would be fine, java isn't perfect but not all bad either, clojure could be interesting. Python would have the added advantage that you can go in many different directions from data structures and basics to machine learning, web development or analysis and it probably would come in very handy when collaborating with other students. Universities that pick javascript for an introduction to programming are making a choice of convenience rather than one that is best for their students. Well, at least they'll have plenty of bad habits to unlearn later on.
- RandomInteger4 10y agoJavascript is a general purpose programming language and your comment doesn't make any sense.
- jacquesm 10y agoHard to decide if your comment is meant as a joke.
- RandomInteger4 10y agoHow would I be joking? Do you even program with JS or are you basing your opinions on hearsay and a bad introduction you had one time in the past and haven't looked at it since? Last I checked, Javascript is Turing Complete and has most of the common features you'd find in every other language. Just because it doesn't have OS interaction on the browser side doesn't mean it isn't a general purpose language. Have you ever even heard of Node.js? Have you not seen the wealth of great things implemented in Javascript? Where does your claim that Javascript is not a general purpose programming language come from is what I'm asking. I can't seem to grok how one could come to that conclusion, which is why your comment doesn't make sense. Don't get me wrong, Python is a great language as well, but outside of a slightly more preferable syntax, I don't see why you seem to think Javascript is such a bad language. Javascript (in Node.js 7.9.0) even seems to have better benchmarks performance than Python 3.6.1 [1] Please elaborate rather than making snide replies. [1] https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=node&lang2=python3 https://benchmarksgame.alioth.debian.org/u64q/compare.php?la...
- jug 10y agoI belong to the Java generation but thought it was very clean and nice, promoting good OOP practices. That was in 1998 though and Java was helmed by Sun, and we used something like Java 1.0-1.3. I can understand someone jumping into Java of today could feel far more overwhelmed. So maybe this hasn't always been a truth, but a truth that has been growing?
- Tade0 10y agoMy sentiment exactly. It did a good job of acting as an improvement over C++ as the language in which business apps were supposed to be written but at some point things like InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState started coming along and ruined it.
- dvt 10y agoThe move to JS is a great one (although I'm sure many will disagree). When I was first learning programming, half the fun was seeing stuff happen on the screen. Doing programming in HyperCard[1] is one of the fondest memories I have of learning how to write code. And HyperTalk (like JS) wasn't really a "good" programming language, but it was a fun one. JavaScript has easy access to the DOM, Canvas, and even OpenGL, which should make it a great introductory language. People are able to easily build more interesting stuff than yet another mortgage calculator. [1] https://en.wikipedia.org/wiki/HyperCard https://en.wikipedia.org/wiki/HyperCard
- dasil003 10y agoHyperCard was formative in my youth as well, and I definitely think JS is a fine introductory language for the self-taught, bootcamps, or even lightweight tech school courses. But when we're talking about top-flight CS programs like Stanford I think we should be teaching students something that generalizes better. Java is crufty, but adequate for general algorithms. Personally I did the traditional Scheme in my MIT-based curriculum and so I have a bias for the syntax-less approach with a lisp, but if I'm being honest with myself I have to say that Python really is the best general purpose language for people to cut their teeth on. It's not that I think JS is a bad language, but it is pathological in its TIMTOWTDI-ness, and that is going to confuse the hell out of beginners. To have a fighting chance you're going to have to lock down the curriculum to a sane subset of JS, Crockford-style, but even then you will run into nasty cognitive dissonance when exposed to real-world JS.
- madarcho 10y agoLearnt with Python, Uni intro went Haskell (which I know is done at a few others) + Java later in the year as an OO fundamentals language. JS is a very poor alternative, but it's better than the French High School system that introduced it's own completely demented "Algorithm Language" AlgoBox. So many of my classmates swore to never touch programming because "It's difficult and pointless". That first contact is incredibly crucial, and I don't think JS is the answer.
- thiagoharry 10y agoI think that it's a big mistake that universities teaches programming in CS using most popular languages. They should use more didatical languages. Not being a popular language it's in fact a huge bonus, because it will force que students to learn other languages before leaving the university. Learning new languages shouldn't be a big problem for a good computer scientist.
- Reason077 10y agoI'm showing my age here, but in my first year of CS we used Pascal and COBOL. My second year was the first year they taught Java, and back then it seemed incredibly easy and powerful by comparison!
- FireBeyond 10y agoMine wasn't quite as 'aged', but not sure it was the best choice. First programming language my school taught was C++.
- shitgoose 10y agoare they going to blow the dust off an old good SICP one day?
- pmarreck 10y agoJava -> JavaScript :: C -> FORTRAN
- vorpalhex 10y agoEven as a JS developer, I'm not sure JS would be my goto. I actually really like introducing people through pure Ruby (so, not rails) since the syntax is pleasing, it has OO concepts but can also be used functionally, and really cuts down on the "scaryness" of the language. Python isn't a bad choice but virtualenv, v2/v3 issues, etc do make it a bit scarier. Also there are a lot of bad tutorials out there that teach poor habits (not that JS is any better..) ANSI C isn't a bad one either but I think it's more difficult to grasp and is slower to get results which might dissuade some new developers.
- humbleMouse 10y agoI may be in the minority here on hacker news, but I think Java is a great language. It was intuitive for me to learn, and it is highly extensible/customizable. Telling college kids to learn javascript first is a terrible idea. Teach them a static language first. Anybody who knows what they're doing in a static language will have no trouble picking up non-static languages like javascript.
- ashark 10y agoI think it's a lot easier to understand OO, for instance, when you know what structs and functions are ("oh, a class is basically a struct with functions [methods] in it with an implicit argument pointing to itself, and some sugar on top? Cool, that was easy.") versus trying to jump straight in, which is what makes Java so painful to n00bs. I don't see moving to JS helping with that problem much, though. If anything prototypal OO is more confusing without that foundation, and loosey-goosey nothing's-really-defined-for-real-until-runtime languages might be fast to get started in but will quickly lead students into a big ol' swamp of WTF. I'd think a semester of C as an intro, despite its warts, would make everything that followed much clearer. But maybe it'd turn off too many students because everything they'd do in that semester'd be kinda boring.
- specialbat 10y agoNot as bad as APL in 1978. It turned me off the idea of programming for 10 years
- sna1l 10y agoI laughed at the phrase: "While there’s a lot to like about it, Java is perhaps the harshest language you can learn as a beginner." "Harshest language" seems extreme, and I could name a bunch of languages that would be much harsher :)
- jon_richards 10y agoMy personal favourite is whitespace.
- noelwelsh 10y agoThe title is bit clickbaity: the article is mostly about Stanford's intro course. It's also misleading. Educators have known for a while that Java is not a good language for introductory education. The Greenfoot project attempted to work around some of its limitations, while other curriculums like How to Design Programs (using Racket in an environment designed for teaching) have used entirely different---and in my opinion much better---approaches. The thing that seems to get skipped in these discusses is that curriculum is hugely important. I believe it's more important than language choice, though a good language for teaching certainly helps. My own teaching is very much influenced by How to Design Programs. I think this paper is pretty good: http://www.ccs.neu.edu/racket/pubs/jfp2004-fffk.pdf http://www.ccs.neu.edu/racket/pubs/jfp2004-fffk.pdf
- TheApexTheater 10y agoOn that note, the size of the courses are not even comparable. If you look at "Explore Courses", a website that gives information on Stanford's course offerings per quarter, you see a massive disparity between CS106A (the intro course almost all CS majors take if they have no programming experience) and CS 106J (The new course). The "A" course, taught in Java, currently has about 560 people in it, while the Javascript course has about 40. (Source: https://explorecourses.stanford.edu/search?view=catalog&filter-coursestatus-Active=on&page=0&catalog=&academicYear=&q=CS106&collapse= https://explorecourses.stanford.edu/search?view=catalog&filt... ) I agree that Java may not be the best language to teach to beginning programmers, but to suggest there's been a wide move away from Java (as this article does) sort of oversells the situation, in my opinion.
- niftich 10y agoJava isn't a bad language for an intro programming language -- it strikes a nice balance between hiding low-level details that are often important to be aware of, but are intimidating to firstcomers, it has a rich standard library and well-made collection types, and is statically typed, encouraging type rigor and making it a good fit for dogmatic OO -- but it's undeniable that the allure of instant-feedback environments like in-browser JS is strong, and OO's stronghold in mass-market academia is being challenged by functional programming as it happened in the industry. In fact, F5-ability, and widespread real-world applicability are the biggest selling points of Javascript-as-an-intro-language, given that there's essentially no standard library to speak of, so every exercise becomes unique to the environment -- either window, or Node's APIs. As others have said, perhaps Python strikes a better balance between approachability (not too much boilerplate), dogma (indentation), lenience (dynamic typing), standard environment (a featureful standard library), and rapid iterability (interpreted from source). Not sure why it's not more widespread in these settings.
- dicroce 10y agoJavascript? Ugh. On the other hand, this may increase my job security. :)
- deleted 10y ago[deleted]
- jkajala 10y agoJavaScript offers too many opportunities to learn bad habits. The first programming language should ideally be 1) strongly-typed 2) syntactically simple and readable 3) better over-enforce rules than under-enforce
- archeantus 10y agoI think the value of using an IDE and having access to a debugger outweighed the clunkiness of the stuff I didn't understand (like public static void main(String[] args)). So much of web development comes across as formidable voodoo because of how many languages/frameworks are needed to even get anything to show up.
- itsautomatisch 10y agoI think something like Racket or other Lisps are much easier to wrap your head around as a first principles language. Python has its own set of problems, and JavaScript is complicated even for experienced programmers. If something more "modern" was needed, Ruby would also be a fantastic choice. It's easy to pick up, reinforces object-oriented design, and it has Rails. I get why people think learning C first makes more sense as it builds strong fundamentals, but it encourages people to think a certain way that doesn't really apply to newer languages. I think you can really see that when you look at courses that teach both C and C++, where too much time is spent on doing things in C and not really learning how to work idiomatically with C++. If you compare C to a Lisp, I feel like the latter is far more applicable to modern everyday programming than the former, especially with the resurgence of functional programming.
- cholantesh 10y agoI can't comment on the Lisps, Python, or Ruby, as my experience with them is limited at best. However, I believe that C/++ is a fantastic pedagogical choice - admittedly, though, I am biased - this was how I was taught in college. I feel that C allows you to get up and running with the basics very quickly (hello world, basic operations with numbers and strings, file I/O, etc), and builds strong habits around using data structures efficiently. >I think you can really see that when you look at courses that teach both C and C++, where too much time is spent on doing things in C and not really learning how to work idiomatically with C++. I think teaching a language should not be the primary goal of most software engineering courses. Instead, a language should be chosen that complements the syllabus. This usually suggests that it plays well with a particular paradigm and doesn't have too many quirks that delay a student's progress with the material. C++, in my experience, is used to introduce students to OOP, and I think it makes a fine choice for this. >If you compare C to a Lisp, I feel like the latter is far more applicable to modern everyday programming than the former, especially with the resurgence of functional programming. I think it's a bit early on to say that functional is more applicable to modern programming as compared to OOP. Iterative is obviously a no-go, but most developers today are immersed in OO and BAs/product managers speak it a bit more fluently than they do FP. That said, if you're just starting out, you can probably jump in to FP more easily than you could if you were to learn OO first.
- relics443 10y agoMy first two courses were in C++, and after that it was a mix of C++ and Java. If my first course was in JavaScript I probably would've WAT, and gone into psychology. It's funny reading the comments regarding some of Java's "bad" features like type safety, which I consider to be a strong selling point of a language. In 101 my professor educated us as to how many holy wars there are in computer science, and that most of them boil down to treating opinion as gold. Then he told us to never get involved in them, and just do the damn job in whatever language, framework, etc... we were currently using.
- welanes 10y agoFrom the comments on the site: > If a simple Hello World program in Java frightens you, you might as well forget about learning how to code. Meh at this attitude. It's not that it's 'frightening', it's simply a longer path (and cognitive load) from code to result. You want to pique a student's interest? Let them navigate to JSFiddle.net and begin making magic happen in an environment they spend all day in VS whatever-you-have-to-do-to-get-Java-running. Not everyone who takes an intro to programming class aims to build their own kernel. Some simply want to know how to build cool things. A little bit of dazzle in programming 101 will keep the latter interested without alienating the former, and you can get in to the thick of it later. This 'you might as well forget about learning' attitude is toxic.
- ghaff 10y ago>Not everyone who takes an intro to programming class aims to build their own kernel. And, for that matter, not everyone who takes an Intro to Programming class may want to become a CS major. They may want to do stats in R. They may want to be comfortable working with and running fluid analysis models as a mechanical engineer.
- mattferderer 10y agoI think JavaScript is a great intro language. Note, it's being used as an introductory language. I use it for teaching kids & it works wonders. Here's why: * You can show off what you develop to your friends because everyone has a web browser. Being able to show off your work is very important to students' feeling of accomplishment. * You can go to any website & start modifying their code. People love doing this when they start coding. Most of us that learned in the 90s probably learned this way. * No special software/tools are needed. This is a bit of a repeat of the above two but it makes getting started so much simpler when you can focus on the code & not the environment. * You can teach server side & front side development. * You can teach functional programming & object oriented programming basics. JavaScript is everywhere. With the skills they learn they can write code for the web, games, IoT devices, mobile devices, etc. Once they advance & start learning more advanced programming, then they can open up Pandora's box. I believe an intro class should be about teaching very basic concepts & creating passion for the subject. I think JavaScript does a great job creating a snowball effect when it comes to learning programming.
- jnbiche 10y agoIt's a great intro language. But it's a poor language for university-level CS major students (I realize that most of these classes using JS are not CS-track classes).
- mattferderer 10y agoI agree that a quality university should teach better languages for the bulk of the major. The class does say "No prior programming experience required" though. I'm making a similar guess as I believe you are that a lot of non-CS students are taking this class. If that's the case, it works great for them if they want to use a simple language to do some automation later in life in some non programming related job. From what I can tell, this class isn't part of the CS degree -http://exploredegrees.stanford.edu/schoolofengineering/computerscience/#bachelortext http://exploredegrees.stanford.edu/schoolofengineering/compu... unless this hasn't been updated yet.
- secult 10y agoAlthough I agree with the case that Java is syntactically bloated and hostile to newbies. However, a person admitted to computer science programme should be well used to programming already from her high school or self-study. If not, the hostility of Java environment is just a minor issue in the context of other courses, alongside of learning how to survive at the university per se.
- vintagedave 10y agoThe Stanford Daily's article is a much better source: http://www.stanforddaily.com/2017/02/28/cs-department-updates-introductory-courses/ http://www.stanforddaily.com/2017/02/28/cs-department-update... This quote stands out: > The computer science department has cycled through several languages over the past decades. When Roberts came to Stanford in 1990, CS106A was still taught in Pascal, a programming language he described as not “clean.” The department adopted the C language in 1992. Moving to C makes sense, but the rest of that statement is extraordinary and needs examination. In 1990, Pascal was widely used, as many Hacker News contributors can attest to. In fact, it was designed for clarity, with teaching one of the design's use cases - the other being clarity for a pro coder - and was widely used for many years by many CS courses for exactly that reason. Some schools still use it in its modern OO form Delphi. Javascript is widely regarded as a less than ideal language. On HN this is preaching to the converted, but: http://www.javascriptgotchas.com/gotchas/common-javascript-errors-and-mistakes.html http://www.javascriptgotchas.com/gotchas/common-javascript-e... and http://stackoverflow.com/questions/12694530/what-is-typescript-and-why-would-i-use-it-in-place-of-javascript/35048303#35048303 http://stackoverflow.com/questions/12694530/what-is-typescri... both contain good material. So the same person who considered Pascal - a clarity-focused and teaching language - unsuitable for teaching, considers Javascript - an unclear and confusing language with lack of type safety and many widely known gotchas, such that many people move to the Pascal-ish or C#-ish Typescript - as suitable?
- didibus 10y agoI'd recommend Processing as an intro class. I think getting people hooked on programming by giving them from the start the feeling of accomplishment and a quick feedback loop is most important. It's also very good for learning the basics.
- vasilia 10y agoGood choice. I hope later they understand that algorithms are not necessary. All that you need is npm install.
- jogjayr 10y agoMaking Java an introductory programming language was a misbegotten idea IMO. I can sort of see the justifications: "it'll make students workforce ready", "it's a modern programming language and teaches OOP" etc. And relevance to industry is also probably why Stanford might be switching to JS. For me an intro programming language should have one of two qualities. It should either: a) have simple, easy-to-understand syntax so that students can learn the fundamentals of stitching together a series of logical steps into a working program OR b) be low-level so that students learn computers and programming from the ground up. I mean registers and pointer arithmetic and memory allocation/deallocation. Either is a valid approach. For a) the most obvious candidate (to me) is Python. For b) it's either some sort of assembler language (my first language was 8086 assembler) or C Java is a "tweener" language; it's not simple enough to teach programming and logic, but not low-level enough for students to understand computers at a basic level.
- smsm42 10y ago> introductory programming language > make students workforce ready That's the problem right here - the idea that a single introductory programming course can make anyone "workforce ready".
- jogjayr 10y agoNot that one class alone. But it may very well be that students use predominantly Java throughout their degree, starting with this course. I got my bachelors in India so we started with C++ and learned Java for just one course in year 3. But when I came to the US for my Masters everyone who went to undergrad in the US only used Java for class projects. So it may be that for students who graduated in the last ~10 years in the US, Java is their strongest language. I didn't ask anyone about their language choices at the time so I don't know this for sure; others are welcome to chime in.
- afghanPower 10y agoRust and Go should probably also be considered for b), don't you think?
- Upvoter33 10y agoThis is hilarious. I can't believe anyone looks at Javascript and thinks "aha, a better intro programming language". I agree Java has problems, but seriously?
- smsm42 10y agoWait, they saw Java as bad beginner's language and they switched to... Javascript? It's like realizing eating carbs-heavy diet may be not healthy and then resolving to dine only on Big Macs & fries from now on. Javascript is a good practical language, but it was never designed as a beginner's one and has tons of quirks, from minor, to major things like being kinda-OO-but-not-OO and kinda-functional-but-not-functional. And subjecting a beginner to some of the industrial JS framework code would be downright cruel.
- mamcx 10y agoA better language? Pascal. A lot of people here forget this.
- dolbysurnd 10y agowhen writing code, I like the idea 'fail fast, fail hard'. i.e. my IDE helps me fail fast by showing me bad code. my program crashes and burns with a verbose stack trace when I commit some runtime heinousness javascript doesn't do that, and the first time they walk into a coding landmine they'll be scratching their heads for hours debugging it