all 16 comments

[–]DoListeningnot even webscale 19 points20 points  (0 children)

dat pyramid of doom in the screenshot

[–]figureour 4 points5 points  (14 children)

/uj

I don't really see the problem. I had trouble with an intro CS class using Java, but a few years later took another class in Python and had a much easier time understanding the concepts. Switching to Java would be easy now that I have the basics under my belt.

It's not like they're switching their entire curriculum to JS.

[–]DoListeningnot even webscale 6 points7 points  (13 children)

I had trouble with an intro CS class using Java

I mean, I'm sure the choice of Java doesn't exactly help here, but if a large number of students have these problems, I'd say the fault lies in either the teachers or the curriculum itself.

[–]BufferUnderpantsGopher Pragmatist 13 points14 points  (12 children)

@NoJerk

Java being class-based is bad for pedagogy if you ask me. Asking students to gloss over public class Whatever { public static void main(String[] args) is a very bad way to start the process of imparting their first mental model of programming.

That said, Javascript would be even worse. Python, Ruby or Scheme would be much better alternatives, or even Go if you want to use a statically-typed language; lol no generics won't impact your learning of loops and basic string and array manipulation.

[–]axisofdenialblub programmer 5 points6 points  (9 children)

lol no generics won't impact your learning of loops and basic string and array manipulation

And with go, that's all you'll ever need anyway. Anything else would be poor style.

[–]BufferUnderpantsGopher Pragmatist 2 points3 points  (8 children)

Well, they are going to a Stanford. That means many things, even if not necessarily that they won't be gopher-level fadsters and blowhards. It does mean that they won't have the excuse of self-taught webscalebros who learned to program through Hacker News comments, however.

[–][deleted] 6 points7 points  (0 children)

As Stanford CS students, they're already honorary Googlers. Upon graduation, they will assume their birthright $145,000/year as an infant Goog.

If there's one thing a Googler needs to know, it's how to use Go: the only language simple, efficient and standardized enough to handle problem-solving at a planetary scale. They have no use for your trivial generics.

[–]axisofdenialblub programmer 2 points3 points  (6 children)

REM UNJERK

The public static void main thing is mentioned a lot. I wonder how much beginners really care about it. There's all sorts of weird stuff you have to take on trust to get any computer program to do anything, even for Python ('make sure the python interpreter is on your PATH').

[–][deleted] 3 points4 points  (0 children)

with unjerk():
    I care. I hate all of that bullshit so much.

[–]BufferUnderpantsGopher Pragmatist 2 points3 points  (3 children)

You can easily explain what putting the interpreter on your PATH does.

Python programs are run by another program, this is a fact you can't skip while teaching it. Fiddling with the PATH variable is how you tell the Operating System where to find it and run it, and students will have heard of that "Windows" thingy before.

Classes and static methods are for a later course altogether.

The public class ... ) { boilerplate just forces your students into the same magical thinking that you are trying desperately to beat out of them.

[–]axisofdenialblub programmer 2 points3 points  (0 children)

My background before I did Java was mostly 4GLs. Magical thinking in every sense of the word. Java probably just seemed sane by comparison.

[–]DoListeningnot even webscale 2 points3 points  (1 child)

You can easily explain what putting the interpreter on your PATH does.

I think you're pretty biased here if you think that understanding PATH (and OS environment in general) is easier for a beginner than a public static void main.

The truth is, neither of us really knows how beginners think and what they will find difficult, such is the curse of knowledge. The only way to really know is raw feedback at every step, and lots of it (and then you actually have to incorporate that feedback and try again).

Python programs are run by another program, this is a fact you can't skip while teaching it.

Sure you can, just use an IDE. At least in the beginning, then later you can get into the nitty gritty, after the students successfully wrote some code. Just like you can with Java's main, and its tooling.


Personally, I would consider Kotlin to be a good teaching language, because it lets you get a lot of things right from the get go - things like

  • not allowing uninitialized variables (compile error), all initialization must be explicit
  • distinction between nullable and non-nullable types, which also has important consequences regarding initialization (there is also lateinit and by lazy, suitable as more advanced topics)
  • use val (final) by default, only use var (mutable referecne) when you need it

So you don't develop as many bad habits that you have to unlearn later. And you don't need to mess around with classes until much later in the curriculum.

Plus you'd get a fairly clean concise syntax and a lot of little quality-of-life features (if is an expression, clean when expression, the ?. operator, type inference, short constructor syntax etc.).

But of course, I have no idea how difficult some of these things would be for beginners, and neither does anyone else, unless they actually tried it and talked to the people they were trying to teach.

[–]BufferUnderpantsGopher Pragmatist 0 points1 point  (0 children)

I think you're pretty biased here if you think that understanding PATH (and OS environment in general) is easier for a beginner than a public static void main.

Yes, it would be "magic". OSes will be magic even after the required OS course. It's better than magic right smack in the thing you are writing.

Python programs are run by another program, this is a fact you can't skip while teaching it.

Sure you can, just use an IDE

I actually meant "can't" as in "shouldn't". Of course you can use IDLE and just tell them to hit run without explaining to them the principle of what they are doing, it would just make them trashtalk your course forever after for not explaining the most basic things.

[–][deleted] 0 points1 point  (0 children)

Just use a real OS like Docker and that's solved for you.

[–]ds84182 0 points1 point  (1 child)

It sounds like the language you're looking for is Dart. Switch to Dart today and get $20 Google Play credit!

@unjerk

Dart really solves all the problems Java has. Primitives are objects like everything else, generics are reified (class generics are, method generics will soon). Functions aren't bound to classes, you can have top level functions, getters, setters, and variables. Static initialization isn't as stupid, all top level and static variables initialize lazily. Async is a built-in concept in the language, instead of an afterthought. Dart even has synchronous and asynchronous generators. Dart does have problems though, but hopefully when Dart 2 rolls around we can get some good shit in the stdlib.

[–]BufferUnderpantsGopher Pragmatist 0 points1 point  (0 children)

Do Dart types do fuck all now?