Stanford dumps Java as introductory class



  • If I may use the occasion to write a micro-rant: in my experience, 90% of the confusion comes from the relationship between variable - pointer - object. Teachers often don't explain those explicitly enough, and any tiny misunderstanding WILL cause problems later.

    Maybe they should actually teach the basics of a few languages where they operate differently, like C, Java, Python and Javascript, just to make sure that students really understand the underlying concepts.



  • @mikael_svahnberg said in Stanford dumps Java as introductory class:

    Could be worse. At my uni they are discussing switching to Python as the first language.

    "They" largely being the two teachers in charge of the "introduction to programming" course, and for more or less unarticulated raisins. I keep pressing the progamme managers to at least consider some of the research on learning progamming and which language provides the best platform for subsequent curses.

    But that's probably just me, and my dislike for any language that assigns a semantic meaning to whitespace...

    It's just you - python would've been a much better introduction to programming than java or javascript.



  • @jaloopa said in Stanford dumps Java as introductory class:

    ArrayList isn't generic

    0_1500578414675_Screen Shot 2017-07-20 at 3.19.52 PM.png


  • Impossible Mission - B

    @jazzyjosh The context is C#, not Java.


  • Trolleybus Mechanic

    @anonymous234 said in Stanford dumps Java as introductory class:

    If I may use the occasion to write a micro-rant: in my experience, 90% of the confusion comes from the relationship between variable - pointer - object. Teachers often don't explain those explicitly enough, and any tiny misunderstanding WILL cause problems later.

    Maybe they should actually teach the basics of Fortran. That way, the faint of heart will never try to learn programming again.

    FTFY :trollface:



  • @masonwheeler Welp.

    To be fair, the Topic is about Java, the referenced post contained the word Java, and having to cast an object to use it when taking it out of a collection DMSYR in the year 2017.



  • @slackerd said in Stanford dumps Java as introductory class:

    Fortran

    Might as well make it COBOL, so if they pass they'll be sure to find lifelong employment at some bank.


  • Discourse touched me in a no-no place

    @the_quiet_one said in Stanford dumps Java as introductory class:

    Agreed on that point. I've always hated teachers who punish students for going the extra step of doing stuff that isn't learned in class yet. If there's anything we need to do in programming class, it's encouraging them to learn stuff on their own.

    This!

    Ten thousand and thirty eight times, this!

    And yes, I've done teaching. I know that allowing such flexibility makes things more difficult for assessment, but I'd rather have more pain and have someone learn better than optimise purely for my own laziness. The whole damn point of teaching is to get it so that people can learn for themselves, and to get them so they'll keep on going even when the learning is getting difficult (as not all worthwhile lessons are easy ones).



  • @jazzyjosh said in Stanford dumps Java as introductory class:

    @masonwheeler Welp.

    To be fair, the Topic is about Java, the referenced post contained the word Java, and having to cast an object to use it when taking it out of a collection DMSYR in the year 2017.

    ArrayList is the old .NET v1 class provided for backwards compatibility.
    List<T> is the widely used list class in C#, and it is very much generic.
    (And unlike java you can write List<int>, which doesn't create needless objects.)



  • @createdtodislikethis I realize this. Still DMSYR


  • Discourse touched me in a no-no place

    @anonymous234 said in Stanford dumps Java as introductory class:

    90% of the confusion comes from the relationship between variable - pointer - object.

    Also, there's the difference between those three and names and identities. Just to get that 90% well and truly covered. Also to break the brains of most people. With any luck, you can get them truly to understand how something that they previously thought was one thing was actually five separate concepts.

    But giving them a headache is admittedly more likely. 😜


  • Impossible Mission - B

    @dkf said in Stanford dumps Java as introductory class:

    This!

    Ten thousand and thirty eight times, this!

    And yes, I've done teaching. I know that allowing such flexibility makes things more difficult for assessment, but I'd rather have more pain and have someone learn better than optimise purely for my own laziness. The whole damn point of teaching is to get it so that people can learn for themselves, and to get them so they'll keep on going even when the learning is getting difficult (as not all worthwhile lessons are easy ones).

    On the one hand, yes, you have a point.

    On the other hand, so do professors who do this. If a student learns high-level concepts before the low-level ones they're built on, they might have an incorrect (or nonexistent) understanding of those concepts, which becomes harmful later on. So I can sort of see both sides of the argument here.



  • @raceprouk said in Stanford dumps Java as introductory class:

    But this change is mainly there to help students get into the concepts behind programming, instead of drowning them in 'Public Static Void' like jargon.

    So, to get students to learn concepts better, you throw half of them away. Gurd jorb.

    I was a TA in an introductory programming class with Java for a while (and a while ago). This class was aimed at general engineering students, not CS specifically. For a significant portion of the students, this really was their first proper programming class.

    And IME, the boilerplate of Java really gets in the way. The simplest example (i.e., "Hello World") contains more magic incantations than actual code. In an introductory course, you might not even end up covering all of the incantations -- remember, these students may only be familiar with the terms "variable" and "function" from math (where they are something quite different). "Objects" and "classes" and "packages" are meaningless terms to these, so stuff like "public" and "static" are just noise at that point. "String[]"? Put it there because you need to. "Void"? Same -- we'll get to that later[1]. "System.out.println"? Yeah .. the "println" is the interesting part. "System.out" ... yeah, later.

    It's not that the students shouldn't learn the concepts, it's more that they need to learn to crawl (understand WTF a function is, and WTF a variable is, how&why types matter, and how to sequence the things you want to do in a sensible order -- surprisingly often a difficulty for math-heavy students) before you can teach them to stumble forward somewhat upright.

    Edit/added: As one student told me, this was the first time she realized she could write commands that the computer would then run. This was apparently fairly mind-blowing at the time.

    @Mikael_Svahnberg said in Stanford dumps Java as introductory class:

    Could be worse. At my uni they are discussing switching to Python as the first language.

    I think it depends on the target audience. For something like math/physics students, I think it would be a fairly solid choice as a first language. It certainly would be more useful than Java, which essentially nobody ever touches again after the first programming course (again IME).

    For CS, my former uni's approach of Haskell+Java followed up by ASM+C seemed like a solid foundation for later courses. Not sure I'd recommend replacing any of those with Python, though.

    [1] I think C++ took a significant step in the wrong direction here, with the ">>"/"<<" syntax for input/output.



  • Let's see...
    I was introduced to programming with BASIC in 3rd grade, but didn't really do much until I basically taught myself C and C++ while I was in high school.
    The college (university) programming introductory classes were (are?) something like this:
    100 - Alice
    101 - C#
    102 - C++

    After that, there's a good mix of C-like (C, C++, C#), functional (SML/NJ), CLI scripting (Bash), assembly (x86 asm), and database (MSSQL). I don't recall there being much in the way of web programming. There was a mixed CS/Business class that taught a little HTML/CSS, but nothing introduced PHP, Javascript, or similar.


  • Java Dev

    @raceprouk said in Stanford dumps Java as introductory class:

    Does she also recommend using x = x + 1; instead of x++;?

    Also known as the Apple way. As they removed the ++ and -- shorthands from Swift. And least += and similar are still in the language...


  • area_pol

    @masonwheeler said in Stanford dumps Java as introductory class:

    On the other hand, so do professors who do this. If a student learns high-level concepts before the low-level ones they're built on, they might have an incorrect (or nonexistent) understanding of those concepts, which becomes harmful later on. So I can sort of see both sides of the argument here.

    In practice that is not the case.
    If students explore the topic on their own, they care and think about it, and through this thinking and exploration can build the understanding.
    They will surely learn more than those who begrudgingly do prescribed homework by copying from StackOverflow.

    @cvi said in Stanford dumps Java as introductory class:

    For something like math/physics students

    Python should be the language taught to them, because it has great tools for scientific programming.
    These are the tools these students will likely use in their career.



  • @atazhaia said in Stanford dumps Java as introductory class:

    @raceprouk said in Stanford dumps Java as introductory class:

    Does she also recommend using x = x + 1; instead of x++;?

    Also known as the Apple way. As they removed the ++ and -- shorthands from Swift. And least += and similar are still in the language...

    Python removes those too.

    Honestly, ++ and -- have no real benefit over += and -= except in:
    -- for (int i = 0; i < n; i++)-style loops, which should not be used in modern languages anyway.
    -- wonderful statements like "x = y++ + z-- == ++w / --v"

    In modern languages, you'd only ever want to use ++ and -- in order to increment/decrement a variable for its own sake (as opposed to in order to iterate over a collection or do pointer gymnastics) - in which case += 1 and -= 1 are far clearer in intent.



  • @createdtodislikethis said in Stanford dumps Java as introductory class:

    In modern languages, you'd only ever want to use ++ and -- in order to increment/decrement a variable for its own sake (as opposed to in order to iterate over a collection or do pointer gymnastics)

    How about logging or debugging?



  • @coldandtired - is having to write the extra character "1" (you can omit the spaces around the '+=' if you must) really a strong enough justification for two more operators with irregular behaviour?


  • Winner of the 2016 Presidential Election

    @createdtodislikethis said in Stanford dumps Java as introductory class:

    In modern languages, you'd only ever want to use ++ and -- in order to increment/decrement a variable for its own sake

    But, but… What if I want my operator ++ to create a new random number? And -- to segfault? Don't take my operators away, man!


  • I survived the hour long Uno hand

    @adynathos said in Stanford dumps Java as introductory class:

    Python should be the language taught to them, because it has great tools for scientific programming.

    Or R. R gets right down to "Here's how you do math" rather than needing a ton of background into "what am I even looking at".



  • @createdtodislikethis Sorry, I must be tired. :( I meant to quote this line

    for (int i = 0; i < n; i++)-style loops, which should not be used in modern languages anyway.

    to comment about having the index value occasionally be useful.


  • area_can

    I'm in a CS program, but the first course we took was designed to be understood by people who haven't done programming before. It was in scheme (lisp (actually (racket))). I think this is actually pretty reasonable, because for people who only know math, the idea of defining functions and defining constants isn't too hard to grasp. We didn't cover mutation until a month or two into the course.

    I don't get the hate here. It's a CS100 course. class Example { public static void Main(String[] arts) { is what makes people think that programming is some sort of black magic and makes them run away in terror.


  • I survived the hour long Uno hand

    @coldandtired said in Stanford dumps Java as introductory class:

    having the index value occasionally be useful

    array.map((val, index) => doSomething) or array.reduce((accumulator, val, index) => doSomething), startVal) depending on your use case.


  • Impossible Mission - B

    @bb36e said in Stanford dumps Java as introductory class:

    I don't get the hate here. It's a CS100 course. class Example { public static void Main(String[] arts) { is what makes people think that programming is some sort of black magic and makes them run away in terror.

    And getting Lost In Superfluous Parenthesis doesn't?!?


  • area_can

    @masonwheeler said in Stanford dumps Java as introductory class:

    And getting Lost In Superfluous Parenthesis doesn't?!?

    It's a hell of a lot simpler to explain. Any time you want to do anything, put a pair of parentheses around it. Basic lisp has brain-dead syntax. Plus your editor will format and highlight the parens for you



  • @bb36e said in Stanford dumps Java as introductory class:

    I don't get the hate here. It's a CS100 course. class Example { public static void Main(String[] arts) { is what makes people think that programming is some sort of black magic and makes them run away in terror.

    Why would it? I would just say, "This has a very important meaning that you don't need to know right now. If you care about it immensely, come see me after and I'll go over it, but as just a basic explanation, giving some class a Main method that looks like that tells your computer where to start."



  • @masonwheeler What superfluous parentheses? Lisp has exactly as many parentheses as other languages have parentheses and curly braces, and every single one is equally meaningful.



  • @yamikuronue said in Stanford dumps Java as introductory class:

    @coldandtired said in Stanford dumps Java as introductory class:

    having the index value occasionally be useful

    array.map((val, index) => doSomething) or array.reduce((accumulator, val, index) => doSomething), startVal) depending on your use case.

    Why add the overhead and visual complexity of the map/reduce gubbins if all you want is a simple integer index?


  • I survived the hour long Uno hand

    @japonicus It really depends what you're doing. Why introduce the visual complexity and overhead of a for-loop to transform one set of data into another?


  • Impossible Mission - B

    @bb36e said in Stanford dumps Java as introductory class:

    Basic lisp has brain-dead syntax.

    Because it was designed in an (electronically) brain-dead age when non-trivial syntax parsing was misunderstood to a ridiculous degree. (No, seriously; people thought it was such a hard problem that it was considered it a part of AI research back then!) So the language designers punted, coming up with the most simplistic thing that could possibly work, creating an incredibly dumbed-down AST that puts a lot of extra work on the coder, and on the later compiler stages, that in more advanced languages gets handled in the parser.

    Brain-dead indeed!


  • Discourse touched me in a no-no place

    @bb36e said in Stanford dumps Java as introductory class:

    I don't get the hate here.

    I think it is because it's easy for people to lose sight of what it is like to truly be a non-programmer.

    My degree programme started with Standard ML (which I skipped because I changed major part way through the year, but hey). It's got a bit more syntax than the Lisps but that just makes it look more like conventional mathematical notation. I'd guess that someone approaching teaching from that direction now would probably use Haskell instead, but that language's implementations were a bit too raw back then. :) After that, it was Modula-3 (with the OO parts postponed to the start of the second year) and both Java and C# are one heck of a lot better than Modula-3, though much newer too. The start of the second year included an optional non-assessed course that was a crash introduction to lots of programming languages. That was where one got Assembler, C, C++, Lisp, Prolog, Bourne Shell, etc., and having a lot of them thrown at you fast helps you see the truth that all are only showing you part of what a computer can do. And all that was aside from more formal teaching in things like OO, parallelism, data structures, compiler theory, etc.

    (The course had really high entry requirements. ;))



  • I was taught, in order:

    • Visual Basic 6
    • Java 6
    • Scala and MIPS assembly (not sure which one came first; they were in the same class)

    Languages I have used in the last few years outside of school environments:

    • HTML
    • JavaScript
    • CSS
    • TypeScript
    • Go
    • C#
    • C++
    • CMake
    • Bash
    • Batch
    • PowerShell
    • Markdown
    • BIT

  • area_pol

    @yamikuronue said in Stanford dumps Java as introductory class:

    Or R. R gets right down to "Here's how you do math" rather than needing a ton of background into "what am I even looking at".

    Exactly, Python / R / MATLAB is what they will be using in their research.

    I have seen a C++/numeric methods course in the physics department, it was a disaster:

    • most people programming for the first time
    • spending most time fighting C++ and not calculating anything
    • or trying to load some stupid CSV input files with string parsing
    • in the end, the ones who knew programming helped the novices with the exercises, the novices did not learn much
    • the professor asking about C++ syntax for pointers and references on the exam

    @magus said in Stanford dumps Java as introductory class:

    Why would it?

    Because, as you say:

    This has a very important meaning that you don't need to know right now.

    The best system is a one based on conceptually simple rules. If you understand them, you can learn new parts of the system by applying the known rules.
    If the first thing you see is "something you don't need to know now", it means you are not even given the base rules for the simplest example.

    A great way to learn is to try things and discover the rules in the process.
    If the topic is filled with incomprehensible incantations, you could get the feeling that exploring beyond the immediate scope of the prepared exercise will end in cryptic failure.

    A much better way it to give them a REPL.
    Start with simple things, like checking if 1+1 gives 2. That is a familiar concept, no incantations.
    Then you can add more sophisticated topics, but after every step being able to see that it still works.
    (A REPL can be on the JVM too, Scala has one)



  • @adynathos But why do you need to type car? Why are there parentheses? Why is the thing you're doing inside them?

    Any language has things that aren't immediately obvious. I don't think that's inherently any worse.


  • Garbage Person

    In high school I took the Intro to Programming course at the local university. It was in PL/C.

    At University the Intro to Programming course was in Karel. From there I remember Turbo Pascal and LISP. I don't remember which others were in the actual coursework.



  • @asdf said in Stanford dumps Java as introductory class:

    Also, Python might not be ideal, since its designers made controversial choices, but at least it's well-designed

    ... was it?

    They needed to make compatibility-breaking changes to get it to support unicode properly. They have a fucking GIL. Neither of those things screams "well-designed" to me.


  • Winner of the 2016 Presidential Election

    @blakeyrat
    As I said before, the GIL has nothing to do with the language, it's a shortcoming of the reference implementation. That's like saying JavaScript is bad because of the bugs in IE's JS engine.


  • FoxDev

    @blakeyrat said in Stanford dumps Java as introductory class:

    They have a fucking GIL

    Some do, but some don't:

    Jython and IronPython have no GIL and can fully exploit multiprocessor systems


  • Discourse touched me in a no-no place

    @blakeyrat said in Stanford dumps Java as introductory class:

    ... was it?

    Pro-tip: The answer to that is No.

    The surface of the language is pretty reasonable — I'm not too upset with someone for using it in a simple interactive way — but there's all sorts of places where weirdness pokes through once you start working with it in anger. I'm still really pissed off by some of the ways it works (the exact order of binding of methods and decorators to classes is really fucking awful). The GIL is a total garbage fire too, and one that it seems that nobody can fix other than by completely reimplementing the language in a managed runtime because the consequences of the Stupid Fuckup are now baked into millions of user scripts.

    I'm not so upset by the breaking changes for unicode though. That's actually remarkably difficult to get right if you start out from extended ASCII, and some of the possible solutions screw the pooch totally when it comes to performance. (If it makes you happier — I bet it won't — Ruby made an even bigger dog's breakfast of their unicode handling. There are things in Ruby that make me contemplate borrowing someone's piko hammer and some bleach for blood stains.)


  • FoxDev

    @dkf said in Stanford dumps Java as introductory class:

    There are things in Ruby that make me contemplate borrowing someone's piko hammer and some bleach for blood stains.

    All :piko: I supply come pre-treated with a water-repellant coating that makes the blood so easy to clean off, you won't even notice! ;)



  • Question: how the 101-style numbering mean exactly? I get that the first number is the year, but what's the difference between 101, 102, 103 and so on?


  • 🚽 Regular

    @the_quiet_one said in Stanford dumps Java as introductory class:

    I'd be OK with this if they went into generics as a topic later in the semester. Introducing students to lists in general without distracting them with what generics are is a reasonable teaching approach, IMO.

    If you don't want to distract them with the specifics of generics that's fine. But forbidding their use? :wtf:


  • Winner of the 2016 Presidential Election

    @dkf
    As long as you're not claiming that Python is worse than JS. Because that's what my original post was about.


  • FoxDev

    @khudzlin said in Stanford dumps Java as introductory class:

    Question: how the 101-style numbering mean exactly? I get that the first number is the year, but what's the difference between 101, 102, 103 and so on?

    I'd imagine the rest of the number is just there to make the codes unique. There may be an implied ordering, but it'll likely be no more than that.


  • 🚽 Regular

    @bb36e said in Stanford dumps Java as introductory class:

    I'm in a CS program, but the first course we took was designed to be understood by people who haven't done programming before. It was in scheme (lisp (actually (racket))). I think this is actually pretty reasonable, because for people who only know math, the idea of defining functions and defining constants isn't too hard to grasp. We didn't cover mutation until a month or two into the course.

    My first two languages in college were Scheme and Common Lisp. I agree that these are reasonable first languages. We then took Prolog (which blew my mind) and in another class some form of academic assembly which may have been LC3.

    The first serious languages we were taught were C, followed by C++, and then C# and Java.

    So the order was: Scheme/Common Lisp/Prolog (variables! abstract thinking! declarative programming!) → assembler (imperative programming! raw data! stack! heap!) → C (structured data! memory pointers!) → C++ (vtables! class hierarchies! protection levels!) → C# and Java ("real languages"!)

    I wouldn't have it any other way. We even got to play with generating images in PPM format in the first semesters, which was fun.



  • @raceprouk said in Stanford dumps Java as introductory class:

    It'll breed a whole generation of programmers who don't understand a lot of the basic concepts of programming, and will write code of a deplorable standard hitherto unseen up to this point.

    Meh. I've seen this kind of argument and discussion for as long as I've seen discussions about teaching programmers (and Joel's article cited by @masonwheeler is a good example of that as it's already more than 10 years old).

    In some part, this really sounds the same as all teachers complaining that students are getting worse every year, or old geezers ranting about the good old times.



  • @createdtodislikethis said in Stanford dumps Java as introductory class:

    @coldandtired - is having to write the extra character "1" (you can omit the spaces around the '+=' if you must) really a strong enough justification for two more operators with irregular behaviour?

    I'm lazy so yes. Besides, you could expand this argument to += as well, can't you just write i = i + 1? ;).



  • @khudzlin said in Stanford dumps Java as introductory class:

    Question: how the 101-style numbering mean exactly? I get that the first number is the year, but what's the difference between 101, 102, 103 and so on?

    There is no consistent pattern other than that incrementing the first digit increases the level of the course. Different universities are different in their numbers. Bigger usually means harder, but...


  • I survived the hour long Uno hand

    @khudzlin said in Stanford dumps Java as introductory class:

    I get that the first number is the year, but what's the difference between 101, 102, 103 and so on?

    100- level is for freshmen. Then they're just in catalog order. So like at one of my alma maters, you had:

    MAT 112: Contemporary topics in Mathematics
    MAT 115: College Algebra
    MAT 120: Business calculus (Calculus as a final math course for business folks)
    MAT 150: Precalc 1
    MAT 151: Precalc 2
    MAT 191: Calc 1

    This is all because you were expected to take precalc in high school, but many students didn't, so they have to catch up at the college level. At the 200 level there's

    MAT 253: Mathematical structures, which is taught in Python
    MAT 292: Calc 2
    MAT 293: Calc 3

    et cetera.

    Unlike what popular media would have you believe, you don't actually get "Basket-weaving 101, Basket-weaving 102"; you get something like "ART 115 Basket Weaving 1, ART 116 Basket Weaving 2": a department, then a number, then a title of the course.

    HTH.


Log in to reply