Live data from Hacker News

Overkill: Java as a first programming language (2010)

matthias-endler.de

41–50 of 70 posts

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

#41

If you want something intended specifically for beginners, Microsoft's Small Basic is interesting.

Is great.... except the lack of support for writing your own functions. Except you can simulate it with hacks, which are confusing to kids. My son did SB at school, and the code they produced was a mess because they couldn't structure things well when they needed repeated, but slightly different things to happen, they end up copy pasting, then they have a problem and have to track down all the copy pastes, etc

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

#42
Currently learning Java in AP Computer Science in highschool.

I have past experience with Java/C/programming, so it's not too difficult, but a lot of my classmates struggle due to the complexity of Java. Thankfully, the AP test is mostly logic focused, but the amount of time we spend going over Java is less time we can talk about problem solving. (And the amount of time we go over topics like what "static" means is substantial)

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

#44
post #11
post #3

What's the point in hiding the fundamentals of OOP, rather than starting with them very quickly? You can't get very far before you're calling methods on the strings you're printing. I'm genuinely curious, I sat through an intro to programming & follow-up course in PHP and that line of thinking seemed to confuse the students. They weren't sure of what a function was even though they were using functions! The professor…

It's not about hiding OOP, it's about being overwhelmed with too many new concepts at the same time. Put yourself in the shoes of a beginner: the runtime, the IDE, the language keywords,... everything is new to them. Once you know your way around simple functions you can start adding another layer of abstraction. But slowly. Maybe Ruby would be an easier start for OOP than Java.

Just my opinion, but it seems that starting off all at once with the language runtime, "Hello World", an IDE, and language keywords will cause more confusion than a few extra lines of code.

Java was the first language used when I was in school, and nobody had a problem with the "Hello World" boilerplate. The professor took about 2 minutes explaining it, told us we'd cover it later in the course (and we did), and then we jumped into the main function.

A bad teacher can teach any language poorly.

EDIT: Now that I think about it, the class was something like, "Data Structures in Java," and the main focus of the class was introducing data structures, with Java tacked on because it was popular at the time (right around y2k) and it made grading easier to have everything in the same language. After that, I don't recall there being any classes explicitly about learning particular language. There was an "Advanced Java" class, but it was an elective showing how to create GUIs and a (brief) intro to things like Java Server Pages.

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

#45
post #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…

I think that says more about your teacher (and maybe about you) than it does about Java as a first language. Bad teachers will teach poorly no matter which language they're teaching.

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

#46
So we should start to teach ppl to fly planes by first teaching them to ride a bike? Riding a bike will not help you fly. Programming isn't hard but if "public static..." melts your mind, software may not be for you.

Also the classic file read idiom (the C one) teaches some of the most basic things every programmer should undertand:

. file encoding (which you ignore)

. buffer sizes

. error handling (likely 80-90% of production code)

Your python example ignores these basic instructive points. Why is there no "String str=String.read(file)"? Because it's seldom useful in production (see points above).

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

#47
post #6

Logo[0] was my first programming language on an Apple IIe. I was in 2nd grade and I loved it. You had subroutines, but that's it. Essentially all state was visible (although you could do increasingly more magical-seeming things the more state you hid - a truism that has held since then). It was a lovely way to see the thread of execution. What an amazing experience to read Papert's[1] Mind Storms[2] as an adult to un…

We feel the same way! That's why we re-created Apple LOGO with 3D [adding UP / DOWN / R(oll)L(eft) / R(oll)R(ight) commands] support to make it more palatable to modern audiences... http://octalyzer.com/downloads/ Any feedback you could give would be awesome! Thanks =)

While there is nothing wrong with adding up, down, roll, pitch, and yaw commands (I guess yaw is already provided by RT and LT) it feels like you are missing the point of LOGO when you make statements like these.

The turtle graphics are great at getting you sucked in, but the language is so much more powerful than that. Logo is a lisp and can be used to do many wonderful things in addition to turtle graphics

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

#48
post #24

Earlier quoted context omitted.

In my CS101 class I asked what the "public static void main(String[] args)" meant at the beginning of the java code we kept getting and got the response: "It's some magic, don't worry about it."

Well then your instructor was doing it wrong, and that's a shame. I teach this course regularly, in Java (and previously in C++). Week 1: "it's just some magic, don't worry about it" Week 2: arrays are a thing, hey look, args is an array of strings! Week 3: functions are a thing, hey look, "void" is the return type, args is the parameter! Week 8: objects are a thing, hey look, static mean's it's not a member of an ob…

thanks for the much-needed perspective

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

#49
post #47

Earlier quoted context omitted.

We feel the same way! That's why we re-created Apple LOGO with 3D [adding UP / DOWN / R(oll)L(eft) / R(oll)R(ight) commands] support to make it more palatable to modern audiences... http://octalyzer.com/downloads/ Any feedback you could give would be awesome! Thanks =)

While there is nothing wrong with adding up, down, roll, pitch, and yaw commands (I guess yaw is already provided by RT and LT) it feels like you are missing the point of LOGO when you make statements like these. The turtle graphics are great at getting you sucked in, but the language is so much more powerful than that. Logo is a lisp and can be used to do many wonderful things in addition to turtle graphics

We are aware =) This is why we re-implemented the entire language syntax (not just turtle graphics).

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

#50
post #5
post #4

Earlier quoted context omitted.

It was even worse starting in C++. Almost half the code in any project was opaque black magic. What is char and why do I need it? Why do I need `using namespace std`? Why do I need to create a Pair in order to insert into a Map?

I don't think it's worse in C++. You can make purely imperative C-like programs in C++ with essentially no boilerplate (with the exception of maybe needing io from the standard library), and build things up as they go.

While I still am a big fan of C++, I'd attest to the fact that is a worse language to teach beginners. Funnily enough, that's not so much because of the language, but because of its legacy.

I learned programming with Borland Turbo Pascal and later Delphi and have to admit I struggled with the OOP mindset at first. The according chapters of the book I used were filled with contrived examples that left me saying "I can also do this the old way!". Apart from this, I found the book to be very well written, though.

Then, I tried learning C++ (using a Book frome the same series) with Borland C++ Builder. Boy, was that a mistake. I didn't get around to understand why I had to keep using -> instead of . everywhere (before, I almost never used a pointer anywhere), the whole delete-dance was a nightmare and the Borland tooling was so filled with magical clicks that generated event handlers that I never understood how the whole thing really worked (you never got to see the whole code). Headers vs. .cpps was a similar disaster, and compiler errors could only be met with comparing your code with the example on a symbol by symbol basis[1].

So, while C++ is a nice language (far better than Java IMO), starting in it was a nightmare. The problem here is that you have to explain way too many concepts at the beginning (which still holds true even with C++17), and since APIs like the Borland GUI libraries or win32 are based on so much cruft and ages old crap, you'll never get to the point where a beginner can say "Look, I've drawn a circle!".

Honestly, if you ask me, programming courses should best just start with a modern version of Python. But even then you'll have trouble setting up on Windows and getting over the whole UI frameworks disaster.

[1]: This kills experimentation. That's the absolutely last thing you want to do if you're trying to teach a motivated kid how to program.

Edit:

Also note: Often, the mindset seems to be that "beginner" means someone at a university. In my opinion, that's a fallacy too. I started out when I was 11 - I'd never even had any decent english course in school back then. Think of that, and you'll start to see the flaws in starting out with some way too complicated concepts. We should get rid of the notion that a learner has to "push through" things (especially at the start!). It will be to the benefit of society.

Post reply on HN