Is Java a terrible first programming language to learn? Do you agree with Stanford switching their intro course to JavaScript? Or would you have picked something else?

https://thenextweb.com/dd/2017/04/24/universities-finally-realize-java-bad-introductory-programming-language/#.tnw_AFXiESVy
2
LVL 6

Expert Comment

by:Doug Walton
Java was my first programming language and I thought it was fine...  I didn't understand the whole "public static void main(String args[])..." bit for a while, too.
0
LVL 18

Expert Comment

by:Phil Phillips
As an intro language, it is a bit bloated. Students should be learning more of the concepts, rather than the syntax. JavaScript is a good alternative that allows users to hit the ground running day 1. I think Cal Poly switched off of Java to Python a few years back.  Python is nice too since it gets users into the habit of formatting their code ;).
2
LVL 7

Author Comment

by:Brian Matis
@Phil: yeah, I've been learning some Python lately and am a big fan of its indentation rules. Really cool to have good formatting actually be enforced by how the language functions! I've also liked how Python works really well for starting off very simple and gradually introducing new programming concepts.

I've never done any Java programming, but just looking at the syntax has always been a big turn-off. You either have to just take things on faith and enter a bunch of code without having any idea why, or learn a bunch of concepts before doing any coding. It seems like trying to learn calculus before you've done any algebra!
0
LVL 31

Expert Comment

by:dpearson
I don't think Java is a terrible first language, but I agree with Stanford that JavaScript is a better choice (and I've been writing Java every day for the last 10+ years).

JavaScript has several advantages IMO:
 - You don't need any "tools" to get started (just a browser)
 - you can get feedback immediately as you write the code
 - the type system is more "forgiving" which makes it easier to get started
 - you can do graphical things directly, which makes it more appealing to early users
 - you can learn about variables and functions before learning about classes, which seems like the natural order

Java remains a great choice for major projects and for learning how to build larger systems, but for an intro class, I agree with their choice.  You can imagine the start of a 2nd semester course beginning with "OK, now you know JavaScript, what problems would we expect to run into in a 100,000 line project?"  And now you start to motivate why people learn and use languages like Java :)

Doug
1
LVL 15

Expert Comment

by:Jeffrey Dake
I definitely think there is something better to start with than Java, but not sure JavaScript is the answer.
1
LVL 7

Author Comment

by:Brian Matis
I imagine the appeal of JavaScript is how you can run it in a browser and don't need to worry about dev environment setup or learning a command line to get started.

What language would you choose, Jeff?
0

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month