Universities finally realize that Java is a bad intro programming language
thenextweb.com
thenextweb.com
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.
Besides, everyone in a CS program these days gets a shell account, right? I mean, login from home using whatever SSH client is hip on Windows these days and then it's just a matter of doing:
javac YOURFILE
java YOURFILE
(making sure that your class path is set up to your cwd). You don't even have to use vi/vim, nano is available on most any linux/unix distro.No complex environment to set up at all, although even setting up a Java IDE is not that hard (my friend's HS students do it with little problem).
Besides, you don't need an IDE for Java, it's just that most people use one. I personally use gradle and vim when progamming Java.
GOROOT and GOPATH are set automatically by default, you don't need to mess with these unless you want to.
> I think it's about the same as Java in terms of complexity.
Even if GOPATH/etc weren't set automatically, you still need to learn Maven and Gradle and friends. I've been programming for a decade or so, and every time I try to play with Java I have such a hard time getting projects set up. I don't know if the tooling is really so complex or if the happy path is just poorly documented (perhaps because everyone assumes you're using an IDE?). A few things I had trouble with: - Getting the Gradle server set up so I didn't have to wait for the JVM to boot every time I wanted to compile anything - Configuring Gradle to compile a native dependency like OpenGL - Configuring Gradle to produce a fat jar - Configuring Gradle for unit testing
By comparison, with Go does all of that out of the box (`go build` doesn't have a VM to warm up, and Go's tooling supports native dependencies, static compilation, and testing by default).
I don't think this is a big problem if you already understand Java's ecosystem or if you have someone to hold your hand until you get a project set up, but I had a terrible time finding the right documentation.
> Besides, you don't need an IDE for Java, it's just that most people use one. I personally use gradle and vim when progamming Java.
Last I checked (a year or so ago), there were no reasonable vim plugins for Java. Certainly nothing as mature as vim-go.
Where is the mkdir icon on my windows desktop?
I bet they don't, though :/
Of course your conclusion that IDEs are more somehow productive than text editors is completely baseless (or perhaps only based on experience with Java and the like).
There are two possible reasons for this I can see:
1. Go is so awesome that unlike any other language I've used in my multi-decade carrier, it can not be improved with an IDE. It's just an ideal and any attempted improvement would just spoil it.
2. There's no decent IDEs for Go and Go developers are forced to do with what they've got.
My experience shows the former is much more probable than the latter.
> Developing Go without an IDE is quite feasible
Of course, people programmed when ed was an IDE, and before that. It's humanly possible. Is it better? I highly doubt it.
> The particularities of IDEs which make them more productive than text editors are artifacts of the poor project system found in most languages
I'm sorry but this statement sounds both misinformed and fanboyish. There are tons of benefits to IDE which have nothing to do with "poor project system" - from module management to task management to refactoring to keeping integrated information about the project to code assist, etc., etc. I could spend an hour writing them. Claiming that Go "fixed" need for IDE sounds, excuse me for being blunt, laughable. It's like when iPhone was first released, I heard some fanboy claim that iPhone interface is so intuitive one doesn't need copy-paste (first version didn't have it). Of course, next update added copy-paste and iPhone users (including the said fanboy) are happily using it ever since.
> or perhaps only based on experience with Java and the like
Yes, it is based on almost 30 years of experience with programming in multitude of languages and environments, and this experience is why I find claims that Go is so awesome it needs no IDE so laughable. I'm sorry to look self-aggrandizing here, but you asked about it so I have to say it I guess.
Fanboyish? Quite a statement from someone arguing that IDEs are necessary--my position is that they're optional. Misinformed? The features you list aren't particular to an IDE--they're available in any pluggable editor, which is a repackaging of my point. I don't mind a rude rebuke, but you're not even vaguely correct. Forgive me for basing my decisions off experience and not your misinformed speculation. ;)
Javascript might have its hassles, but even when you get to dealing with npm it's still more of a self contained thing.
But if you're introducing people to programming, letting them know command line exists may also be not that bad of an idea :)
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.
Our final project is a memory Allocator (Malloc, Realloc, Free). By the end, students really do grasp computer organization and architecture.
Not that JS is optimal for any of those use cases.
"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."
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.
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.
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...
That's precisely why I think it's a good idea: with proper instruction, you can teach people good habits from the start.
I mean, the majority of these students will have to write JavaScript sooner or later. Better they learn it in a controlled environment.
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.
That's what the instructors are there for...
You can tell them, yes. But as you rightly say, an important thing is to experiment and (IMHO) to see for yourself what works and what doesn't. And that part works best if it fits their abilities. Experimentation should lead them past what they've learned from you, but not into to much confusion, which for absolute beginners can be incredibly demoralizing.
More talented students will go into different languages and weird stuff anyways, I'll help them when they ask questions or I see something they are doing I can contribute to, but I can't run a course matching their abilities as an intro-course.
Again, I'm not saying you can't do it in JS, but it's not a decision of "let's use JS because I want people to learn JS". And if having JS in there is the goal, nothing wrong with running a course using multiple languages and using JS as one of the later ones. Ideally, after a good set of intro courses your students have seen enough that they can pick up most languages relatively easily, and then, when they need them, learn what current best practices and their ecosystem are.
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.
Very few people formally learn JS. It's usually more of a read up on syntax, read documentation of a library, apply concepts.
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.
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?la...
They could at least move to a language which is not as full of traps for young players and odd quirks[0].
> 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.
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.
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.
>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.
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.
It makes a rather good (IMHO) argument that while, yes, JavaScript sucks, it does have redeeming qualities for usage as a first programming language.
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.
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.
* 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.
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/compu... unless this hasn't been updated yet.
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-informa...
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.
This is a direct result of the design decision to enforce an OO class structure on all Java programs. You literally can't write any code that isn't somehow part of a "class" (an OO concept that, as an intro CS student, you haven't even learned yet).
> make students workforce ready
That's the problem right here - the idea that a single introductory programming course can make anyone "workforce ready".
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
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.
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.
And Javascript?
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.
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.
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-e... and 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?
(glad I don't write Java (or JavaScript) on a regular basis anymore)
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.
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.
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.
"Harshest language" seems extreme, and I could name a bunch of languages that would be much harsher :)
It's also very good for learning the basics.
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.
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.
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.
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.
My second year was the first year they taught Java, and back then it seemed incredibly easy and powerful by comparison!
First programming language my school taught was C++.
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
A lot of people here forget this.