Live data from Hacker News

Overkill: Java as a first programming language (2010)

matthias-endler.de

31–40 of 70 posts

Re: Overkill: Java as a first programming language (2010)

#31
One thing to consider when picking a language for someone's first programming experience: students like the 'language du jour' - it motivates them. I like the idea of using Basic/Pascal/Blockly/etc (and students like how easy those are) but about 3-4 weeks in they'll start to ask "Sooooo.... does anyone actually use this for real, in industry?". This tension between wanting something easy enough that students can handle it vs. wanting something that 'real' programmers use is common.

Picking a language like Java (and handing out starter files to overcome the required verbosity) is a nice way to go - it reduces the cognitive load to something they can reasonably handle AND it keeps the motivation of using a "real world language"

Re: Overkill: Java as a first programming language (2010)

#34
I think the first language course should not be any single language but a language sampling course. Students learn the concept of variables, switches, loops and subroutines, then they learn how it is used in all common languages. And for homework, they are allowed to pick their favorite.

For starting programmers, language is not important, concepts are. Any specific language will skew the concept.

Re: Overkill: Java as a first programming language (2010)

#35
post #13

I'm on board with Java not being a great first language but I'm pretty tired of posts constantly citing ancient unidiomatic Java to prove how bad of a language it is. Their file i/o example could just as easily be import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public class fileIO { public static void main(String[] args) throws IOException { Files.copy(Paths.get("test.txt"), System…

Nothing kills a beginner's interest more than "you need to have a class and a main method, always, and I can't explain why, just trust me, you'll understand later."

Java was my first language. No one explained any of that stuff to me. And for whatever reason I lacked the agency to go figure it out for myself although I had internet access. Probably because I assumed paying attention in class and doing my homework was enough.

Re: Overkill: Java as a first programming language (2010)

#36
post #9

Earlier quoted context omitted.

I believe it is to teach the fundamentals of the CPU, Machine code before the student has any knowledge of the abstraction's that currently exist. Then after the fundamentals have been established introduce the abstractions and different approaches to improve productivity.

The reverse is to give people a way to build things. Even simple things. This lights up the brains response every time you get the computer to, as my old lab partner in my first CS class put it 'to do a thing! Automatically!'. My first real python program made me gush with endorphins. I feel like if I didn't start off on Python first (and, for whats it worth, still heavily use today) I wouldn't have been NEARLY as in…

I agree with your view point. Although why are you in the CS class? If you're only interested in just getting the job done the fastest?

From a practicality stand point of view using bash, batch files, nodejs, python is going to be faster second to none, I'm not discussing that. The point is using a low level language you have to consider about decoding the jpg, memory allocation or possible streaming issues. Optimal buffer size and command prompt parameters to parse from the command line to resize the image. All tangibly relate to other fields in the curriculum and when you get a job the field.

Re: Overkill: Java as a first programming language (2010)

#37
This isn't a bad idea (Python not Java for a first language makes sense on a number of levels) but the example is setting up a straw-man. Why is the Java code handling exceptions when the Python code isn't? Why is the Java code reading the file line-by-line and the Python code isn't?

Further, you could easily write a simple file library in almost any language that abstracts over the difficulty of using the full file library if you're looking to ease people into programming.

All that being said, Python is a pretty good first language and there's a reasonable chance that someone who does one course in Python might be able to do simple tasks later on, which is nice. I think first languages should generally either be simple scripting languages or 'hazing' languages (i.e. something weird to put everyone on a more level playing field).

Re: Overkill: Java as a first programming language (2010)

#38
post #15

If you're going to take CS AP classes in high school, it's gonna be Java. This probably explains why a lot of people learn Java as a "first" language. (And no, not everybody started programming when they were five.) https://apstudent.collegeboard.org/apcourse/ap-computer-scie... https://en.wikipedia.org/wiki/AP_Computer_Science

At least at my high school, we have two classes teaching Java.

One is AP Computer Science, and the other is IB Computer Science. They're taught by different teachers, and AP CS is almost purely focused on nothing but programming, while IB CS also examines how computers work, ethical issues currently in the field, etc.

However, we also have Programming and Advanced Programming, taught by another different set of teachers, that teach Visual Basic, Gamemaker Studio, and handwriting HTML. Not JS, or CSS, just HTML.

Post reply on HN