Live data from Hacker News

Universities finally realize that Java is a bad intro programming language

thenextweb.com

81–90 of 132 posts

Re: Universities finally realize that Java is a bad intro programming language

#81

Replacing 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 t…

Javascript is a general purpose programming language and your comment doesn't make any sense.

Hard to decide if your comment is meant as a joke.

Re: Universities finally realize that Java is a bad intro programming language

#82
post #48

I 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 :)

My personal favourite is whitespace.

Re: Universities finally realize that Java is a bad intro programming language

#83

I'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?

Python 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.

Re: Universities finally realize that Java is a bad intro programming language

#84
post #18

I'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?

Because you only need a browser. When you're just a beginner, setting up an environment can be extremely painful.

[deleted]

Re: Universities finally realize that Java is a bad intro programming language

#85

Replacing 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 t…

Javascript is a general purpose programming language and your comment doesn't make any sense.

ECMAScript is a general purpose programming language that, historically, just happened to be made specifically for the purpose of standardizing a language made specifically with a web-browser (Netscape) in mind.

Re: Universities finally realize that Java is a bad intro programming language

#87

Earlier quoted context omitted.

>>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.

Not 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.

Having 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...

Re: Universities finally realize that Java is a bad intro programming language

#88

I'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?

Python 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…

The 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.

Re: Universities finally realize that Java is a bad intro programming language

#90
post #20

As 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…

I agree. When I TA'd intro programming courses, I found that most frustration stemmed from a piece of code not doing exactly what you expect it to do. JavaScript is famous for having a million quirks and places where behavior changes based on context ('this', for example). That's going to lead to a million places where students blow up because it doesn't do what they expect it to do. Students need lots of little wins, and JavaScript is full of little losses.
Post reply on HN