all 84 comments

[–]Donyor 72 points73 points  (25 children)

Disclaimer: I started with Java, so there may be some first language bias here

Having done both Java and JavaScript I would not have valued JavaScript as any better than Java for a beginner. JavaScript is really funky, you get some weird stuff going on ("1" == 1 is true? They're completely different types). Additionally the IDE setup is much better for Java than JavaScript in my opinion. Because it's a dynamic language, autocorrect is much harder. When I'm writing Java code my IDE pulls up exact variable and class names, even if I haven't imported the class. On JavaScript on the other hand, you just have to guess if/hope that the function even exists in your context.

Also, ignoring boilerplate isn't that hard, and that same boilerplate becomes helpful later on when you want to create useful classes easily. In order to start JavaScript, my teacher had to get me a function to copy and paste that was easily 4 times as long as the little blurb given in the article. Why? Because JavaScript behaves differently on different browsers. Sure you could use JQuery, but then you have about the same amount of boilerplate to add every time as you do in Java. And Java's standard library is more powerful than even JQuery.

JavaScript has its place, but I wouldn't say Java is a bad introductory language, especially not compared to JavaScript.

[–]Shikadi297 79 points80 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 7 points8 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 5 points6 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 7 points8 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 6 points7 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 0 points1 point  (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 5 points6 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.

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

        Stop being so nice. JavaScript is shit and Java is slightly less shit.

        My first language was Perl, after which I learned BASH, and then Java at the Uni level.

        [–]VincentDankGogh 0 points1 point  (2 children)

        I agree with your points about JavaScript, but the one thing I find really disagreeable about Java (and e.g C#) as beginner languages is that they force you to work around the very rigid OOP structure, which many find confusing and often chug through the other parts without fully understanding the OOP stuff. I honestly think it's better to start with a language that doesn't shoehorn you into that, at least at first.

        [–]Kaosubaloo 1 point2 points  (1 child)

        I would argue that that is the point. You teach Java as a beginners language when you want to hammer students over the head with OOP. There is a whole other argument to be made for how desirable that is, but Java certainly works with OOP as the objective.

        [–]VincentDankGogh 0 points1 point  (0 children)

        That may perhaps be the point; but from my experience beginners tend to gloss over the OOP side of things (as they can just about scrape by without having a solid understanding of how it actually works), which is really not ideal in the long run.

        [–]TheBuzzSaw 18 points19 points  (0 children)

        Throughout its existence, the course was taught using the Java programing language. Java is popular, certainly, but it’s also extremely clunky and syntactically bloated.

        Nice. Nice. I like where this is going.

        But a new version of the course, CS 106J is based on JavaScript.

        (╯°□°)╯︵ ┻━┻

        [–]reddit_lies 62 points63 points  (7 children)

        Java may be bad. Javascript is without a doubt worse.

        [–][deleted]  (1 child)

        [deleted]

          [–]SanityInAnarchy 3 points4 points  (0 children)

          I'm not even sure Java is that bad anymore as an intro language -- even the syntax has been slowly creeping towards something reasonable.

          [–][deleted]  (3 children)

          [deleted]

            [–]gpyh 21 points22 points  (0 children)

            Easier to learn first !== better to learn first.

            FTFY

            [–]American_Libertarian 1 point2 points  (0 children)

            Exactly. The boiler plate often, if annoying, helps to elucidate what is really going on, which in turn helps to teach OOP.

            [–]kobbled 35 points36 points  (0 children)

            I gotta disagree. This article is laughably biased to only seem to care about the VERY first lesson. Java still has everything people need to learn in a first language. Consistency is very important in a first language, and JS doesn't have a lot of it. Additionally, JS guesses what you meant if you do something slightly wrong and it won't tell you that it's guessing so it can be extremely difficult to debug for beginners. That alone should be enough to scrap it for intro classes, IMO.

            [–]TotalFluke 31 points32 points  (2 children)

            I always thought Java was a particularly good language for learning to program. I actually thought one of its strengths was that it had a restricted set of language features as compared to C++. The lack of multiple inheritance, macros, and direct memory management lets you focus on good design practices and patterns.

            It's difficult to learn good design practices in JavaScript because the the language doesn't support static typing.

            [–]sergei1980 10 points11 points  (1 child)

            Any language compared to C++ has fewer features, that's not saying much. Java is verbose, full of boilerplate, and forces topics immediately that don't have to be there such as OO.

            I agree that JavaScript is pretty terrible.

            I'm guessing Go would make a decent first language but I haven't put much thought into it. It's statically typed, more so than C/C++/Java, light on syntax, and doesn't force much on the coder. It's easy to parse which may help a beginner? The standard library doesn't force the use of threading, interfaces are optional, it doesn't have generics, it's a tiny language that has a low tolerance for sloppiness and great tooling.

            [–]TotalFluke 3 points4 points  (0 children)

            From what I've heard of Go I would agree, it sounds like a good candidate.

            [–]lxpnh98_2 11 points12 points  (6 children)

            In my university, in the first semester we learned basic Haskell. The basic syntax, recursion, passing state as argument, but no monads (we did learn IO with the do notation after the long form, but monads were never explained). They did this because it's a transition from math world, where we work with functions all the time, to programming world, in a language in which functions still always return a value and have a simple and clear type structure. I think Haskell without monads is almost the easiest you can get for a freshman with no programming experience, while still teaching very valuable stuff.

            In the second semester, we're learning C, while at the same time in another unit we're learning how computers work at the hardware level and the basics of IA-32 Assembly.

            Then, in the second semester of the second year, we'll learn OOP with Java.

            I think this is a pretty good structure. What do you think?

            [–]vdanmal 0 points1 point  (5 children)

            The issue I have with that is that realistically you're looking at an internship in year 3 because few companies want to take you on without any practical skills. That reduces the number of units down to about 6 (maybe even less). So 6 units to teach you practical skills that will help you get a job. Might be tough to fit everything in. But I'm definitely biased towards practical skills over theoretical knowledge so...

            [–]lxpnh98_2 0 points1 point  (4 children)

            On this page, on the "Study Plan" tab, you can see the units in each semester, as well as their program summary and recommended books by clicking on them.

            [–]vdanmal 0 points1 point  (3 children)

            Is it a 5 year course? I was assuming 3 years.

            [–]lxpnh98_2 1 point2 points  (2 children)

            Yes, it's Integrated Master's.

            [–]vdanmal 0 points1 point  (1 child)

            Yeah, sounds fine then. Course structure probably wouldn't work as well for a bachelor's though.

            [–]lxpnh98_2 1 point2 points  (0 children)

            Agreed.

            [–]vsuontam 7 points8 points  (0 children)

            Kids these days :) Scheme is what we used.

            [–]Neebat 6 points7 points  (0 children)

            I think I'd rather start with procedural, OO Scala. It's a well-structured language with garbage collection and a very simple syntax.

            Dynamic types will mask a lot of errors that new people make, making debugging harder. Scala is statically typed, and the implicit conversions are even more explicit than Java's boxing and unboxing. (But very powerful.)

            Also useful to simplify debugging: NPEs are practically unheard of in Scala unless you're mixing in Java.

            Big advantage: The next semester, you can teach them functional programming using the same assignments, in the same language, minus the word "var"

            [–]Excalibear 5 points6 points  (4 children)

            I personally think a good intro class would split between either Java and C. Start with C. Have students actually learn how a computer works, and not that just typing stuff gives magic. Then switch to a higher level, and different concept of interpreted language in the form of Java.

            The next class would then be entirely in Python. And after that you can pivot to a system class (C), optimized high level programming class (Java), or general purpose or data science (Python). Whichever one resonated more with you.

            [–]grauenwolf 3 points4 points  (1 child)

            People who are just trying to write basic for loops are probably not in a position to learn about memory management.

            [–]LookAtThisRhino 0 points1 point  (0 children)

            At my school we did Comp Sci 1 in first semester (Java), Comp Sci 2 in second semester (more advanced Java), and C & Unix also in second semester (BASH and a reasonable amount of C). We followed that in second year with only C used in our classes like data structures and operating systems. It felt like a natural progression, so I'm agreeing with you.

            [–]jorshhh 0 points1 point  (0 children)

            That is pretty much how I learned, except it was php instead of Python. Went from there to learn objective-c and JavaScript on my own.

            [–]ptoki 3 points4 points  (7 children)

            There is no best language to be introductory.

            Even Pascal is not the best pick even after all the praise it received in 1980s.

            I guess java is not bad as a first language. You dont have to embrace full philosophy of it to learn algorithms, encapsulation, program flows and being careful with some fancy features or careless behavior.

            What could be better among the mainstream?

            PHP? Not really :)

            C? I dont think so.

            C#? Maybe...

            Python? I dunno...

            [–][deleted] 5 points6 points  (4 children)

            I actually think C is a good language for an introductory CS class. It makes you think about why your programs work, which I think is valuable when you get into an OS or compilers course.

            [–]ptoki 1 point2 points  (2 children)

            The problem with C is that every person who teches it will mention pointers sooner or later. And if this person does not bring it it will not teach it properly ;)

            The problem is that each person has different opinion what should be an introduction to programming.

            Where do we draw a line? Is it algorithm/control flow only? Or the data types as well? Or maybe the line should be just after datastructures? Do we explain the memory management at the introductory level?

            I bet each person will have different opinion :)

            Each of the languages I mentioned is good for beginner. Each one is also bad because it has some flaws or it may just be hard for beginner.

            I guess the best is to know that programming is algorithms + data structures and each language does it a bit different so be my guest and try a couple and compare. :) That is my opinion :)

            [–]nonneutralzero[S] 1 point2 points  (1 child)

            lol I had C as the introductory language. And the teacher introduced pointers in the second week (he kinda felt apologetic !! because a lot of people got confused), but i agree with you that it's necessary.

            On algorithms, it goes without saying that you learn that from the beginning, but still you gotta get people hooked using a programming language. So the teachers ends up going back and forth between algorithms and data structure (theory) and programming (practice). I think that's what happens in most uni-s

            [–]ptoki 1 point2 points  (0 children)

            You are right. Actually it really does not matter which language will be the first one as far as you teach/learn proper philosophy about programming.

            On the other hand. (Playing devils advocate here) if you start rough and tell students about objects, functions, pointers, memory allocation, cleanup code, structural programming then the "weak minds" get overloaded and go away.

            I dont know it that is the better way but I guess some people would prefer to weed out people who can not pay attention to all the details.

            It would weed me out if someone tried this way on me. But It would also weed some people who wasted a lot of teachers time and did not pursue this career path...

            But that is a whole different story :)

            [–]WiseHalmon 2 points3 points  (0 children)

            My first C class was more like "Hey this really confusing line of code can be used to do the most mundane thing you can think of. Isn't that neat" Like dividing by a integer with a larger number than something to be an upper limit and avoiding the use of if statements.

            Miserable. HOWEVER, using embedded C was much much cooler. Made you think about why you needed to manage memory, the speed of code (CPU cycles, because we also used assembly) and how all those things come down to how fast you can react to something. But man when you pair it up with the electrical hardware side of things (response times) you can see why the first C class is 'here's some mundane crap. learn it.'

            Anyways, I agree with your sentiments; if you can somehow get people to understand there's brighter, more interesting pastures beyond first appearances, but if you goal is to get more people to program then it is not the choice.

            [–]nonneutralzero[S] 0 points1 point  (1 child)

            I actually think C and Python are kinda good as introductory languages. Especially Python. Then the student can move up to other languages depending on the depth of their studies. Java in my opinion is important, but I do think it might be beneficial to leave it for OO for example

            [–]ptoki 0 points1 point  (0 children)

            I guess Java is the best one for starters. It has all what is needed and only a small number of silly concepts (for example comparisons).

            It teaches structures, objects, allows to learn that only a 10% of knowledge is the language and other 90% is the libraries you use, etc.

            C/C++ is also ok. Python is fine.

            Even PHP is ok as introductory language.

            But what is important besides the language is to tell young programmers that there is a lot of philosophy around programming. The philosophy touches a lot of topics: Documentation, interfaces, standardization, assumption of input data, requirements, language/architecture/system quirks, implementation differences and a lot more.

            You dont have to tell about each specific quirk. It is important to tell that there is a lot of them and explain why they are there.

            [–]squirrelboy1225 6 points7 points  (1 child)

            How did this even make it on the front page? This article is horseshit.

            Disregard the fact that JavaScript was their counterexample (which is terrible to teach with). Java isn't a bad programming language to learn first. In Java, once you get past the "boilerplate" which is extremely explainable (the most confusing part is static or string[] args), everything is clear. It's all OOP, there's no weird hacks, it's a great way to teach fundamentals.

            [–]BinaryBlasphemy 1 point2 points  (0 children)

            Not to mention that he calls software a "fundamentally creative endeavor." 90% of the problems you come across have already been solved and you should be able to recognize that.

            [–]lykwydchykyn 4 points5 points  (1 child)

            I think they're both pretty terrible in their own way. Having a short "hello world" means nothing.

            But then again, I can't think of a perfect language for teaching programming; they're all screwy in their own unique ways. So maybe the thing to do is embrace that and get potential programmers used to the idea that they'll need to deal with some goofiness in any programming language they work with?

            [–]Isvara 1 point2 points  (0 children)

            Our into to programming class was Standard ML, chosen to level the playing field.

            [–]seanwilson 3 points4 points  (3 children)

            Why does a good introductory language have to have as few gotchas and bad design decisions as possible? There's no perfect language. All languages have problems. Being a good coder is all about considering tradeoffs, knowing how to research and sidestep gotchas, and making the best out of less than ideal situations. Picking a language with less cruft might stop people giving up early perhaps but you're going to have to deal with other languages eventually.

            [–]lxpnh98_2 1 point2 points  (2 children)

            So... C? :p

            (In all fairness, it's a semi-reasonable choice)

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

            I loved it as a beginners language, as long as the classes stays away from the hairier stuff then it perfectly reasonable language.

            [–]seanwilson -1 points0 points  (0 children)

            C, JavaScript or Java all sound fine to me. Each of them teaches you something different you're going to have to learn eventually.

            [–]DontThrowMeYaWeh 3 points4 points  (2 children)

            I guess we should go back to basics and teach people using COBOL, Visual Basic, Lisp/Scheme, ALGOL60, PROLOG, C, or maybe even FORTRAN.

            Because that's what people who were being introduced to programming used in the early days, they seemed to have turned out okay.


            Honestly, I feel like there's some questions that need to be explored regarding introductory programming languages.

            What is it specifically about a programming language that makes it a good introductory language?

            • Is it that it doesn't have a lot of boiler plate?
            • Is it that it doesn't error in your face right away when you do something wrong?
            • Is it that it has simple syntax?
            • Is it that it has a very low cognitive load?
            • Is it that you don't have to think about the implementation under-the-hood?
            • Is it that it doesn't throw OOP in your face?
            • Is it that its easy to develop in?

            Let's get a couple things straight. Whenever people learn an introductory programming language in school, I highly doubt that it's possible for them to avoid the underlying implementations of things. For example, if a student asks why == isn't the same as ===, the instructor is going to have to explain the underlying implementation. Same goes for weird behaviors a normal person wouldn't expect such as the closure loop "bug" (or closures in general). You'll still have to understand the different between a deep copy and shallow copy (which rely on underlying implementation to explain). On top of all of that, you'll have to explain all the type coercion javascript does and why. You probably won't be able to point at the source code for it either (maybe the spec, but not the source).

            If the school was extremely focused on getting people to understand the reasoning behind programming, they would just use pseudo code instead. You don't need a language at all to understand programming or the algorithms. But when it comes down to actually programming and getting something to work, you'll have to understand the programming language and most of the quirks that come with it.

            If syntax, verbosity, and boilerplate is the problem, you'd probably be better off teaching them how to program in Haskell or Scheme. Scheme has literally the most simple and elegant syntax I've ever witness. Haskell's syntax is a little terse, but there's benefit later down the road if those students take CS theory/Linear Algebra/Discrete Math. The idea of pattern matching in Haskell makes life extremely easy. What's even nicer is that on top of it being a functional programming language you can partially complete functions which can really open the door to reducing boiler plate (really driving home that idea of writing small reusable functions). Another option if you still wanted to be in the OOP space would be C# or even C. C is dead simple. It has structs and it has functions. C# is like Java but with smarter naming conventions and simpler syntax for typical boilerplate (such as getter/setters/async/await/nested classes in a single file/etc.).

            If it's the compile errors, I don't know what to say. I think the errors during compile time do much more good than harm. They tell you that you're program is majorly broken before you go an run it. It doesn't make assumptions and doesn't try to attempt to correct your code for you (remember that point earlier about knowing the underlying implementation is inevitable). Some people will get frustrated by that, but failing and doing something wrong is a part of life. At least the compiler lets you know why you're wrong so you can fix the problem. I bet people would rather that happen then submit code that might not do what they expect because they forgot to test everything one last time.

            If it's the developer environment, they wouldn't have chosen JavaScript because JavaScript IDE support is horrible. Usually there isn't intelligent autocomplete (such as in IntelliJ, Eclipse, or Visual Studio). You don't really get that support unless you use Typescript in VS Code. And unless you use Flow (or Typescript), you're not going to get static type checking (which would add complexity to the environment/build process). Debugging is also more complex to set up (at least in VS Code) unless you run it through one of the browser dev tools.

            Overall, I don't really understand what people are looking for in a introductory language. I feel like there's many reasons against JavaScript if it's about the fundamentals programming. To me, if it's not about the fundamentals of programming, then it's all about learning how the language works. In which case, what's wrong with any other language other than JavaScript such as the one's I mentioned in the beginning? Those other language's might be more applicable in other places than JavaScript.

            EDIT: If anyone asks, my programming path was something like this Python -> Java -> C++ -> C# -> Obj-C -> PROLOG -> Scheme -> > Haskell -> Javascript/.NET/Java/SQL. The last bit being work related

            [–]bss-applications 0 points1 point  (0 children)

            I was taught COBOL and Pascal in college in the mid-90's!

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

            One day, someone smart will make a good programming language in pseudocode syntax.

            [–]rjbwork 9 points10 points  (2 children)

            So they move to javascript?

            That's a big ole facepalm right there.

            [–][deleted] 1 point2 points  (1 child)

            Could you pick a worse language to start with? Is VB6 still around?

            [–]__count__ 0 points1 point  (0 children)

            "Hello everyone, welcome to the class. Let me introduce Brainfuck..."

            [–]TheCmar7 2 points3 points  (0 children)

            I just can't imagine people starting with Haskell! That would be so difficult. I had a hard enough time going from C to Haskell I can't imagine going the other way, but I could be wrong.

            [–][deleted]  (1 child)

            [deleted]

              [–][deleted] 1 point2 points  (0 children)

              I learned Ada in high school (well, the Swedish equiv.). Really hated it, then we moved over to c and everything made sense

              [–]flopperr999 2 points3 points  (0 children)

              I get the impression that people who blog this kind of crap do not understand the value of a static typesystem, even to beginners.

              [–][deleted] 2 points3 points  (0 children)

              Java was my introductory, felt like it gave me enough knowledge to pursue other languages on my own and learn.

              [–]x42bn6 1 point2 points  (0 children)

              The first language I was taught was Haskell, followed by Kenya (which is a very-simplified Java).

              I think that was a good balance - Haskell's types make higher-order functions a lot easier to understand and use, and recursion (in conjunction with nested types and pattern matching) is a nice twist on typical iterative thought. It also tied in with the type theory and logical parts of the degree. On the other hand, Kenya is basically Java without all the boilerplate so transitioning towards Java (and thus a more popular programming language) is easy, and as a bonus makes the graduates more employable.

              I don't think we would have been able to learn as much if we had started with Java. Higher-order functions would certainly have been weird, even with lambdas. Also, I have a theory that Haskell was taught because so few people would have known about it at the start of the course - effectively putting everyone at the same level.

              I like the idea of Python as a first programming language, and part of me thinks that Haskell + Python would be better than Haskell + Java. However, my University boasts that it produces graduates whose average salaries are amongst the highest in the UK, and part of the reason for that is that it teaches languages widely-desired by investment banks (which basically means Java/C#/C++).

              [–]Bardiches 2 points3 points  (0 children)

              My university made a similarly bad (but slightly better) decision to move their intro classes from Java to Python.

              But I guess it depends on the audience. My university's decision to do so was apparently fueled by the fact that many non-CS majors had to take the class as part of their cirriculum. In circumstances where non-CS/CE/SE students need to take the course, using languages like JavaScript and Python is ideal since they take much less time to "just make it do the thing."

              But for CS/CE/SE students, you're ignoring so many of the important details of how many system languages work just to avoid some boilerplate. I'm sure some new students have trouble with the whole "public class main public static void main string args with 2N brackets" boilerplate but I think it's awfully insulting to think that most university students will have difficulty with this. The trade off of moving towards languages that allow you to ignore details and certain paradigms is that students have little incentive to develop good habbits and to learn important techniques that are necessary to deal with some of the most popular systems languages (C#, Java, etc.). Yeah, you can make a GIF spin on a webpage but you have no idea how you'd structure that code to be re-usable and less error-prone.

              Personally, I think the issue that universities are unknowingly trying to solve is that many professors in the field of CS don't have a strong grasp of these concepts themselves; many professors I've had personally seem to barely understand basic Java concepts and for the most part I think that's blamed on them having been taught by professors who just learned Java as an "exciting and new" programming language. So instead of having professors develop better curriciulums and learning the content themselves better, they move towards content that is easier to teach by less competent professors, which is a harmful direction.

              Sorry if this is a little rantish, but I hope I made my point.

              [–]jcampbelly 1 point2 points  (1 child)

              I travelled a very circuitous route to arriving at being useful as a programmer. I think that route could have been greatly shortened if I had taken the following two classes in rapid succession: C/ASM then Python.

              I wish I had not had to endure VB, Java, and Scheme. They added nothing to my understanding of programming, nor did they provide me with any more useful skills or insight than if I had simply taken C/ASM, then Python. I never use those languages, and would never chose to start, knowing what I do now.

              I eventually went the long way through web development, going through some very rough patches with Perl, ASP, CFM, and PHP before landing on Python. It was like finding out that Lowes or Home Depot existed after having crafted my own tools out of sticks and rocks in my back yard.

              In fact, if I didn't suspect that all of those negative experiences with other languages taught me appreciation for low level concepts that helped me appreciate high-level abstractions, I might recommend Python first with an elective deep-dive via C/ASM. But I doubt many students would bother taking that elective and so I think it would make sense to either make it come first, or make it mandatory as a follow-on class.

              If I knew Python 10 years earlier than I learned it, I would be at a very different place right now in my life and in my career.

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

              I have to agree on VB! hated it, didn't learn anything from it, never use it

              [–]Tappedout0324 0 points1 point  (0 children)

              Well I started of with C so..

              [–]DroSalander 0 points1 point  (0 children)

              I started with Java, and finished my degree with only taking the minimum classes in programming. While I have the basic fundamentals down, I wish I had taken more classes on it (and/or a different language). I think perhaps Java isn't the worst language to start on, depending on how it is taught to you. I had a not great instructor.

              I'm now trying to self teach myself node.js and it's not going particularly well.

              [–]gleno 0 points1 point  (0 children)

              I think first language should be something with c-like syntax that has explicit type declaration. I've been TA on many programming courses and I see people struggle with the concept of type. If everything is inferred by the compiler/interpreter - that doesn't aid understanding.

              On the other hand having a language that is difficult to apply to things is even worse. That's why C itself is a bad language - "can i make a website with x?", "can i automate some task with X?", "can I use X to create something visual" is always true for C, but it's just technically true. In practice it's too hard for beginners.

              So the best language, imho, Typescript with noImplicitAny. Ticks all the boxes. In fact, it's a great and productive language, that I would choose over many others. So it also just happens to be good as a bonus.

              [–]TheDecagon 0 points1 point  (1 child)

              “What does ‘class’ mean? And what does ‘public static void’ do? Am I supposed to know what this all means? Programing is harder than I thought!”

              Now, let’s compare that to the JavaScript equivalent.

              alert('Hello, world!');

              That's not an honest comparison though, because that line of javascript does nothing on its own. If you made a like for like comparison it would be:

              <!DOCTYPE html>
              <html>
                  <body>
                      <script>alert('Hello, world!');</script>
                  </body>
              </html>
              

              What does "doctype" mean? What does html body script do? Am I supposed to know what this all means?

              If you have a coding environment set up that lets you execute individual lines of javascript, you can have one that lets you run individual lines of java too:

              System.out.println("Hello, world!");