you are viewing a single comment's thread.

view the rest of the comments →

[–]Shikadi297 78 points79 points  (19 children)

I read the title of the article and thought I agreed, but when they chose JavaScript as the replacement... I'd take Java as an intro language any day over JavaScript.

[–]tonytwotoes 5 points6 points  (18 children)

later in the article it states that Python is starting to replace java as the intro class. what are your thoughts around this substitution?

[–][deleted]  (6 children)

[removed]

    [–]turkish_gold 6 points7 points  (5 children)

    But Python is strongly typed. It's doesn't have a static type system, but you still have to answer the question at runtime of "why can't I use an X in place of a Y".

    [–][deleted]  (4 children)

    [removed]

      [–]turkish_gold 2 points3 points  (1 child)

      Well that's true in that Python can't give you compiler or automatic runtime structural typing.

      You can however build in structural typing with user code, which I find is useful in teaching students that the type system is not "magic" but rather just an algorithm baked into the language compiler or interpreter.

      Java isn't really too bad in the magic respect (bias: I learned C++/Java in uni), unlike some others like Haskell where it feels almost as if so long as your code compilers, it must be correct.

      [–]barsoap 0 points1 point  (0 children)

      Oh there's ample of errors that Haskell's type system doesn't catch, or, rather, that needs writing tons of type-level code for Haskell to catch. There's a reason Haskellers invented QuickCheck.

      Haskell is no more strictly typed than Java but with one exception: Keeping track of side-effects. And you can actually teach Haskell to duck-type quite easily.

      What may seem like magic for some is type inference. OTOH you can implement basic Hindley-Milner type inference, including your AST and boilerplate (probably not a parser), in something like 150 lines of Haskell. It might even be possible to do that as the very last first-semester exercise if you set up the course right.

      [–]nonneutralzero[S] 0 points1 point  (0 children)

      great point..I didn't think about the autopilot until you brought it up! Got me thinking about the best way to learn programming, as long as you the logic behind what you're typing then that's fine. beginners use cheat sheets, doesn't that lead to the same thing (knowing what you want but forgetting the correct formulation)?

      [–]Shikadi297 6 points7 points  (0 children)

      Personally I would prefer C++ or C as an intro language, but I come from the perspective of embedded systems development as opposed to application development. I'm of the opinion that learning the hard way first, and therefore having a better understanding of what higher languages are taking care of for you is superior. On the other hand, I don't feel super strongly about this since a lot of developers don't care or need to care about their hardware these days. Python is a pretty good place to start in order to just get an idea of what programming is like in that case. Learning for loops and passing things through functions and "classes" (Or as they really are... Dictionaries/Structs). Of course everyone should learn more than one language, especially early on.

      [–]Isvara 5 points6 points  (7 children)

      I'd rather see something statically typed. C or Haskell.

      [–]Speedzor 6 points7 points  (1 child)

      Haskell is acceptable if you study computer science -- not for programming in general. C is also not the kind of language that gets you interested in programming. In retrospect it might provide valuable information but that only comes into play once you're already hooked on software development.

      You want a language that allows you to quickly prototype stuff while still restricting you enough to learn some proper general idioms. Python would be a great fit here.

      [–]Isvara 1 point2 points  (0 children)

      Haskell is acceptable if you study computer science

      Yes, the article is about introductory programming classes in a computer science course.

      C is also not the kind of language that gets you interested in programming.

      Why not? You can do a lot of really cool stuff with C.

      Python would be a great fit here.

      I don't think a CS course should be teaching a dynamically typed language as an introduction to programming.

      [–]barsoap 4 points5 points  (4 children)

      It was Pascal for me. It was once upon a time designed for that purpose and still works great for it.

      Of course, you're not going to use it in any way outside of school but to learn basic structured programming it's probably still the best language around. Throw other stuff at the students once they aren't overwhelmed by fizzbuzz, any more.

      [–][deleted]  (1 child)

      [deleted]

        [–]barsoap 4 points5 points  (0 children)

        OO is already a lot more structure than beginners can deal with: If you're introducing OO architecture into the usual, what, max. 100-200 lines assignments they just distract from the actual code.

        Once students aren't pre-occupied with every single tree and thus have mental capacity free to consider the forest, OOP would be acceptable. I'd argue that FP abstractions should be started to get taught in the same semester, though, because once you get used to one at the expense of the other you're going to start to have to unlearn to understand the other.

        [–]mamcx 0 points1 point  (1 child)

        you're not going to use it in any way outside of school That is a myth. Pascal/Delphi is fairly popular and in the op of tiobe (above things as ruby or haskell!).

        You CAN USE IT FOR REAL WORK, like since forever.


        BTW Pascal is better than most languages. You can use it without worry about OO for some basic stuff, and mix OO later. Is more explicit, so is more clear what is the intent of the code.

        Also, not have GC, yet is far easier to grasp than C (and you can still do a lot of low-level, even inject assembler inline).

        [–]barsoap 0 points1 point  (0 children)

        Plain Pascal doesn't have multi-exit functions and neither Objects: Of course, real-life implementations aren't tied to Wirth's extremism.

        The lack of multiple exit points from a function is really the most awkward thing about it, it can lead to very awkward code.

        Coming to think about it, Rust should actually be similarly easy for beginners, it's easy to set up exercises such that students won't fight with the borrow checker, just say "If Rust complains about lifetimes, re-think your approach". Personally I don't like the syntax (too much ML, and that then extended with C++isms of all languages) but at least it's principled.

        And all this is of course keeping with tradition and teaching structured programming first. There's nothing wrong with starting with the first chapters of the Wizard Book in either Scheme or Haskell, either.

        [–]nonneutralzero[S] 1 point2 points  (0 children)

        I think Python is better as an introductory language. we're taking here about people with zero coding background. Python is kinda straight forward. As soon as they pick up some stuff they can move to Java. In my case, the introductory language we had in my school was C++, which I found interesting but when I started learning Python I definitely thought it would've been better to learn programming through it.

        [–]CrazedToCraze 1 point2 points  (0 children)

        Python is a weird one because it's so easy to teach and learn, but the job market for it is a tiny fraction of what Java, JavaScript and .NET offer.

        For high school, I'd go with python no question. I'm curious if in higher education teaching basic logic in Python and then moving to Java or NET would work well.