back to article Stanford Uni's intro to CompSci course adopts JavaScript, bins Java

In early April, Stanford University began piloting a new version of its introductory computer science course, CS 106A. The variant, CS 106J, is taught in JavaScript rather than Java. "[CS 106J] covers the same material as CS 106A but does so using JavaScript, the most common language for implementing interactive web pages, …

  1. Anonymous Coward
    Anonymous Coward

    Is there any correlation between "popularity" and

    Appropriateness?

    Trustworthiness (robustness and security and...)?

    Likelihood of on-time delivery?

    Likelihood of on-budget delivery?

    Likelihood of meeting project performance targets?

    I'm sure contributors can think of others to add, if required.

    1. gv

      Re: Is there any correlation between "popularity" and

      As it's a computer science course, the actual implementation language used should have no bearing on the overall objectives.

      1. Mage Silver badge

        Re: Is there any correlation between "popularity" and

        It's like using BASIC instead of ForTran.

        I hope it is a Computer Science course, a programming course teaching programming, not just a computer language course teaching Javascript. If the previous version is merely teaching Java, then it's a failure anyway.

        It does have the advantage that you can write stuff on a phone and upload it to website. Here is example of demo on a website intended to be implemented on a PIC micro in assmebler, JAL or C:

        Roman Digital Clock top left

        Select, right click and "view selection source".

        This could be brilliant or rubbish depending on the lecturer and course design.

      2. Voland's right hand Silver badge

        Re: Is there any correlation between "popularity" and

        As it's a computer science course, the actual implementation language used should have no bearing on the overall objectives.

        Sorta.

        I suggest reading Joel On Software: The Perils of JavaSchools. It is even more valid for Javascript. There are concepts which you simply cannot teach in either language - they do not exist.

        Now, a lot of this material is not taught in "Intro to Comp Sci" nowdays (again - probably a mistake, in my days they hit you on the head with linked lists around the middle of the first semester). So in theory you can teach intro in a language which offers a reduced set of concepts - Java, JavaScript, etc. This, however, means that before teaching any of the really deep stuff which separates your average 25£ per hour webmonger from a software engineer you need to teach one more language. All of your recruits arriving at "Boot Camp Data Structures and Algorithms" will need to be retrained first. IMHO that's a waste - it would have been better to use a language which has most concepts in the first place. In fact, python is more suitable than either Java or JavaScript - it is cleaner syntactically and semantically while still giving access to all key concepts needed to teach CS.

        1. Anonymous Coward
          Anonymous Coward

          Re: Is there any correlation between "popularity" and

          During my higher "education", we covered C, Pascal, Modula-2, Smalltalk, 6502 assembler, Ada, SQL, as well as a few more obscure, specialised languages for functional programming and AI.

        2. alisonken1
          Alert

          @Voland's right hand - wrong link to Joel

          Link mistype - The link you posted for Joel's article actually goes to a register article about Russian hackers.

          The correct link should be https://www.joelonsoftware.com/2005/12/29/the-perils-of-javaschools-2/

          1. Anonymous Coward
            Anonymous Coward

            Re: @Voland's right hand - wrong link to Joel

            Arrrgh! Nailed by the infamous IDN homograph attack AGAIN! Web of Trust, my ass!

      3. Anonymous Coward
        Happy

        Re: Is there any correlation between "popularity" and

        As it's a computer science course, the actual implementation language used should have no bearing on the overall objectives.

        It is better to walk away after the course knowing a computer language which is actually useful. e.g. if two introductory courses teach the same computer science, but one incidentally teaches students Oberon-2 and the other JavaScript, then students from the first course will now have to go out and learn a useful programming language to catch up with the people who took the second course.

      4. handleoclast
        Stop

        Re: Is there any correlation between "popularity" and

        "the actual implementation language used should have no bearing on the overall objectives."

        So, teach it in befunge, or brainfuck, or intercal, or malbolge, right? They're all Turing-complete.

        Hint: one of the overall objectives is that a large percentage of students complete the course knowing how to program.

        1. Daniel von Asmuth
          Paris Hilton

          Re: Is there any correlation between "popularity" and

          The Java programming language is complex and takes long to completely learn by heart, when HTML is the most popular language for e-mail and web pages.

    2. Anonymous Coward
      Anonymous Coward

      As everyone in Silicon Valley knows

      If you want the best locally educated programmers, you hire San Jose State grads, not Stanford grads.

      1. Ian Michael Gumby
        Boffin

        Re: As everyone in Silicon Valley knows

        If you want the best, you head to the Midwest.

        1. JOKM

          Re: As everyone in Silicon Valley knows

          If you want the dope, head to Europe.

      2. Anonymous Coward
        Anonymous Coward

        Re: As everyone in Silicon Valley knows

        Having graduated from San Jose State (while working at Stanford!), I must wholeheartedly agree.

    3. kschrock

      Re: Is there any correlation between "popularity" and

      I love articles like these. The comments show religion is not dead.

  2. AMBxx Silver badge

    Introductory

    An introductory course needs a language that is provides skills that are easily transferable to other languages. At a basic level, that's just control structure (conditional stuff and loops). Javascript is fine for that.

    As you become more advanced OO stuff is important. Really don't think JavaScript is useful for that! My first exposure to OO was in VB5 - a really bad way to learn OO. I didn't really understand what was going on until I studied Smalltalk as part of an OU course. Easy to transfer those skills to C# and Java.

    I just wish C# and Java were as strict about OO as Smalltalk (adding strings!).

    Of more concern is that most serious JavaScript stuff is now done using 3rd party frameworks as the language isn't up to scratch.

    1. Lee D Silver badge

      Re: Introductory

      I'd be concerned if it wasn't for my own computing degree.

      At the time, Java was still quite "new" but it was the course language.

      As part of the three year degree I had to do a programming course that covered the whole three years.

      It literally started at Hello World (fair enough), but at that point I realised that I could do it all without having to be in the lecture at all.

      I skipped three years of programming courses by the simple precept of downloading the coursework from the FTP server, knocking something up on the train on the way in, making sure it compiled and run (pretty much, always did once you take account of the missing semicolon or whatever - and I was the only person I knew who logged the dual-boot machines into Linux and ran it in there, the number of people who wrote programs that only worked on one OS was amazing, given it was Java), and then emailing it in.

      I don't think once that I struggled to do what was asked, with zero reference to the course material. There was nothing fantastically difficult there, that wasn't covered in literally the only reference material I had - a copy of the O'Reilly book for Java, complete with 1/3rd of the book being nothing but a class / function reference (which is why I bought it, really).

      As such, what language you choose to do THAT kind of stuff in, it really doesn't matter.

      I still remember sitting in the IT labs as a 1st year, and being consulted by the master students on why their Java minimax implementation for a game of draughts wasn't working. I literally debugged it with one glance, it was that obvious from the code.

      I'm not anywhere near an expert programmer, but it was quite worrying that Masters and 3rd year pure-computing students were struggling with that stuff.

      1. Jay 2

        Re: Introductory

        For the lot doing MSc it would depend on what they're actually doing. Whilst I was doing my BSc we shared lectures with some MSc who were effectively on a 1 year IT conversion course. As a result they were significantly less experienced than us. In hindsight maybe we shouldn't have been so harsh on them. Though I'm sure for many a HR department an MSc would trump a BSc...

    2. Tom 64

      Re: Introductory

      > "most serious JavaScript stuff is now done using 3rd party frameworks as the language isn't up to scratch."

      Wrong. Personally I avoid those 3rd party bloatware fests like the plague.

      Its not the language that isn't up to scratch, its the quality of the developers.

      1. JLV
        Trollface

        @Tom 64

        >I avoid those 3rd party bloatware fests like the plague.

        I can only agree with disdain for the attitude that layers modules on top of modules, from essentially unknown developers and with also unknown commitment to maintenance, for the most trivial of tasks in JS (or Python for that matter). This what got them the left-pad fiasco. So, yes, 100% with you there.

        However, taken to the extreme, you are also foregoing all the ES6 (i.e. "modern JS") goodies. Normal class OO semantics might be just be syntaxic sugar on top of prototypical inheritance.

        But basic building blocks of non-trivial modern software like import/exports are not supported by core current JS in browsers. You need either an in-browser module loader or a something that packages it up on the backend. And ES6 support in the large is also reliant on a backend pre-processor, pending full browser support.

        And, are you telling you'd cook up something with the functionality of ReactJS/Vue, d3, or even the much-maligned jQuery from scratch? Cross-browser? Pull the other one.

        There is a large grain of wisdom in what you say, but it is far from the complete story, though it does make for a brilliant soundbite ;-)

    3. Anonymous Coward
      Anonymous Coward

      Re: Introductory

      JavaScript is fine for learning about object orientation. Prototyping isn't the same, but it's good enough.

      (But my JavaScript experience was over 10 years ago, for all I know it now has optional inheritance.)

      And otherwise, I think it's also fine as a way to learn about programming. It has everything you need.

      In fact, the syntax means it has _more_ than you _need_, so it should actually be a good language for programming instruction.

      1. bombastic bob Silver badge
        WTF?

        Re: Introductory

        "JavaScript is fine for learning about object orientation."

        and spawns some of the WORST! PROGRAMMING! HABITS! EVAR!!!

        I particularly cite what was already mentioned, the 3rd party bloatware typically downloaded from CDNs to support worthless "functionality" that could easily be done with style sheets and tables and "old school HTML".

        If you want to teach "object orientedness" it's better to do it with C++, In My Bombastic Opinion. The problem with the BASS-ACKWARDS way that it's being done all too often nowadays (i.e. multiverse:universe:galaxy:system:planet:continent:nation:district:person:molecule:atom and you start with 'multiverse' to get 'atom') promotes GROSS inefficiencies, like the ones inherent in ".Not".

        If you design objects in C++ instead, you can start with something that makes a LOT more sense (interestingly enough, the basics *behind* how COM works in OLE 2.0 is actually pretty good; how they implemented it, no so much in many ways, but the basics behind it are worth paying attention to).

        And of course, good C++ code looks a lot like good C code.

        Instead we'll be "teaching" the next generation how to create CRAP code using JavaScript.

        What ARE they smoking over in Palo Alto these days?

        "Welcome to Stanford. Here's your BONG"

        [there's way too much "programming" in web pages already. we don't need to excrete a bunch of people from colleges that are confused into believing that 'all that javascript' is a GOOD thing]

    4. Boris the Cockroach Silver badge

      Re: Introductory

      Quote

      My first exposure to OO was in VB5 - a really bad way to learn OO. I didn't really understand what was going on until I studied Smalltalk as part of an OU course. Easy to transfer those skills to C# and Java.

      Dont tell me you suffered M206 and those f***ing frogs?

      <<<also suffered the delights of Jean Bacon and M301... a rghhhhhhhghghghghhghggh

    5. Vic

      Re: Introductory

      most serious JavaScript stuff is now done using 3rd party frameworks as the language isn't up to scratch

      I'm not entirely sure that's correct.

      Most serious stuff is *started* using a third-party framework, but then things need "modifying", because the framework doesn't actually do what you wanted.

      I've seen projects where the framework over-rides are double the size of the framework...

      Vic.

    6. Dyson Lu

      Re: Introductory

      JavaScript is more object-oriented than Java. Java is "class oriented" -- the inheritance hierarchy is a relationship between classes. In Javascript, relationships are all about links between objects. You create objects out of thin air and can link them other objects through a prototype chain. In Java, you create objects using a class as a blueprint. Javascript's "class" is simply syntax sugar to make look more familiar to the horde of programmers who were taught classical inheritance.

  3. John Smith 19 Gold badge
    Unhappy

    Biggest problem is the name.

    File I/O in Javascript?

    Spent a while trying to dig that out.

    Handy hint. Real programming languages for actual applications involve

    File reading and writing.

    Printing (I know "printing is dead" yet printers, printer cartridges and paper still seem to sell well).

    If these (apparently) simple tasks are buried deep in the manual my BS detector is going to start pinging like a Geiger counter around an anti-Putin journalist.

    1. Anonymous Coward
      Anonymous Coward

      Re: Biggest problem is the name.

      You've highlighted another issue with Javascript, and that is the runtime. Javascript that most people know is client-side browser-based Javascript, suitable for in-browser applications that don't need file access and is in fact sandboxed by the browser.

      If you were writing an application (out of the browser), you'd use Node.js, which is basically an entry point to Chrome's V8 JS engine on the command line. There you get file IO: https://nodejs.org/api/fs.html

      But surely for newbs, this is only going to muddy the waters, yes it's Javascript, but not *THAT* Javascript. The Uni will need to be crystal clear on what type/platform Javascript they are teaching and make sure students are aware of the alternatives and how they differ.

      1. bombastic bob Silver badge
        Facepalm

        Re: Biggest problem is the name.

        "If you were writing an application (out of the browser), you'd use Node.js"

        oh my various gods, I HOPE NOT!

        Python would have been a somewhat more reasonable choice (if it must be simplified AND interpretive). But the "mensa candidate" dim-bulbs at Stanford chose Javascript instead.

        /me facepalms

        1. a_yank_lurker

          Re: Biggest problem is the name.

          @bombastic bob - I agree that the intro language should be one that is generic and useful for many applications and with a relatively easy syntax to learn. Python is a good choice and I would give a nod to Ruby also. If those two are unacceptable I would probably go with Java even though its syntax is convoluted; it is too useful a language and will around awhile. JavaScript (a better name is JackassScript) is not a well designed language outside of web applications a pain to use. With it you are likely to have taught beginners bad habits out of necessity. That necessity reminds me of a comment Dykstra made about Basic (paraphrasing): if a student learned Basic first he was a lost cause as a programmer.

    2. Mage Silver badge

      Re: Biggest problem is the name.

      Initial learning of programming doesn't need any file i/o or printing.

      This could only be useful as an introduction. Other modules would need I/O on a microcontroller with no OS and designing simple schedulers etc, security, database access, networking, and desktop OS file I/O and printing. Javascript is unsuitable for those and Node,js as no place in leaning programming, it's a dubious web application enabling framework that only happens to use javascript.

    3. Anonymous Coward
      Anonymous Coward

      Re: Biggest problem is the name.

      Real programming languages for actual applications involve

      File reading and writing.. etc..

      Pascal had the same problem, great for teaching but crap for actually implementing real stuff. Every implementation had its own, different, system-specific IO stuff. Of course, the students who were taught in it always tried to use it for their real work, for a while anyway.

      1. AMBxx Silver badge

        doesn't need any file i/o

        Rubbish - file handling and managing data is important early on. I seem to recall having to write objects to file to reinstantiate on the next run at a very early stage of a Java course.

      2. John Smith 19 Gold badge
        Unhappy

        "Pascal had the same problem, great for teaching but crap for actually implementing"

        Not entirely.

        Embedded system were quite viable provided you could find a variable size that mapped to bytes and map the whole address space as an array.

        IIRC the big issues with ISO Pascal were that you had to pass the array size to procedures, so array size was set at compile time and you couldn't right array processing libraries easily. The other was you could not take and store the address of a procedure IE pointer to procedures.

        Being able to set up a "jump table" in a high level language is a very efficient way to call such things (it's basically the key implementation feature of EMACS) and while a compiler might well you collapse your case statement or 10 level deep If/then structure into it eventually it was damm handy to be able to just set it up directly. IIRC TubrboPascal did not offer this till V5.

        1. Phil O'Sophical Silver badge

          Re: "Pascal had the same problem, great for teaching but crap for actually implementing"

          Being able to set up a "jump table" in a high level language is a very efficient way to call such things

          It's also a very easy way to send your program off into the weeds if you get it wrong, which is why Pascal (designed as language to teach good programming techniques) didn't have it. If you need such a thing (and yes, it can be useful) use a language that supports it natively, such as Pascal's successor Modula-2. Don't try & kludge it into one that was never designed to have it, that just leads to crappy, non-portable, undebuggable, code.

      3. This post has been deleted by its author

    4. Anonymous Coward
      Anonymous Coward

      Re: Biggest problem is the name.

      If these (apparently) simple tasks are buried deep in the manual my BS detector is going to start pinging like a Geiger counter around an anti-Putin journalist.

      <pedant mode><apologies>

      Assuming you're referring to Polonium 210 poisoning, the difficulty with that is that its such a weak alpha emitter you cannot detect the poisoning with just a Geiger counter. It doesn't get through the skin. Something more sophisticated is required. This is why it took so long to work out what had done for Litvinenko...

      So you're Geiger counter would be ticking away at the normal background count rate.

      </pedant mode>

      The idea of a whole generation of youngsters growing up not knowing how to write a file is indeed horrifying....

      1. Anonymous Coward
        Anonymous Coward

        Re: Biggest problem is the apostrophe

        So you're Geiger counter

        <pedant mode><many apologies>

        All that radiation ha's frie'd you're brain (and mine).

        </pedant mode>

        "The idea of a whole generation of youngsters growing up not knowing how to write a file is indeed horrifying...."

        Indeed. As is the idea of them not knowing how to rwrite a grammatically correct correctly spelt sentence.

        Fortunately, there's often enough redundancy in an English sentence for the meaning to usually be obvious to the reader, and if it isn't obvious, mostly it doesn't matter

        Less so in a computer program.

        1. A K Stiles
          Headmaster

          Re: Biggest problem is the apostrophe

          I'm now left wondering whether your typographical and spelling errors were entirely deliberate or not - I believe 'spelt' is a type of wheat whilst 'spelled' is related to one's capacity for correctly arranging letters to form words.

          1. Anonymous Coward
            Anonymous Coward

            Re: Biggest problem is the apostrophe

            @A K Stiles,

            "I'm now left wondering whether your typographical and spelling errors were entirely deliberate or not - I believe 'spelt' is a type of wheat whilst 'spelled' is related to one's capacity for correctly arranging letters to form words."

            <pedant mode, well and truly up my own arse><many humble apologies>

            In defence of AC, all the words were correctly spelled but were inappropriate for the intended meaning of the sentence.

            </pedant mode, well and truly up my own arse>

            Pop!

            1. Anonymous Coward
              Anonymous Coward

              Re: Biggest problem is the apostrophe

              Hello different AC, it is AC1 here, AC1 what wrote the 'apostrophe' thing. Nice to meat you.

              "In defence of AC, all the words were correctly spelled"

              There was at least one non-word which a spell checker should have spotted and a human might have auto-corrected on reading, but no matter, you got the real point anyway:

              "but were inappropriate for the intended meaning of the sentence."

              Exactly.

              TL;DR: Language can be hard, English especially so. Why make it even harder by encouraging (or at best, tolerating) carelessness where carelessness is inappropriate.

              1. Anonymous Coward
                Anonymous Coward

                Re: Biggest problem is the apostrophe

                There was at least one non-word which a spell checker should have spotted

                Pedantic AC2 here. A spelling checker would have spotted it. A spell checker would be more useful to Harry Potter & friends.

              2. Displacement Activity
                Happy

                Re: Biggest problem is the apostrophe

                Hello AC1 what wrote the apostrophe thing, nice to meet you.

                I should probably warn you that meating AC0 may not be a nice thing to do, and is probably illegal.

            2. Displacement Activity
              Meh

              Re: Biggest problem is the apostrophe

              @AC: +1 for assisting Mr. Stiles with his enema. However, I would like to point out that 'spelt' *was* probably appropriate (anywhere outside the US, anyway).

              And I have to wonder whether anyone defending JS has actually used it. It's an extraordinary mismash of the obscure, esoteric, and downright inane. It was knocked up in a weekend (Ok, more or less), and has been constantly added to ever since. And, whatever you write, there's always some tosser somewhere who'll refuse to run it because you clearly intended to break out of their browser and trash their system, despite your inability to access any files.

              Still, on the plus side, there won't be much competition from Stanford graduates in the jobs market.

            3. Vic

              Re: Biggest problem is the apostrophe

              Pop!

              Stack underflow!

              Vic.

    5. Infernoz Bronze badge
      Facepalm

      Re: Biggest problem is the name.

      Agreed, and static typing and defined interfaces are critical for quickly picking up type/interface errors, and enable reliable static analysis and refactoring. This feedback teaches design and coding discipline.

      Java 8 provides extensive filesystem, concurrency and functional support which Javascript definitely can't do as-is, maybe not even with external support or fast enough.

      Also, Web developers are often not the best paid developers.

      Javascript like a lot of duck-typing scripting languages (including Python) are nearly as dangerous as pointer maths. and void * in C/C++; I know this from personal experience with all these languages!

      1. Anonymous Coward
        Anonymous Coward

        Re: Biggest problem is the name.

        @Infernoz,

        "Also, Web developers are often not the best paid developers."

        I guess that's only because there's so many of them. All the more reason to not encourage more to emerge, better off learning something like Java, C++, C# even. At least if one learns C/C++ there's a lifetime's employment in real time embedded systems, where there is a dire shortage of engineers (and some really cool projects).

        If one is wanting to chase occassional but highly renumerative opportunities, ADA isn't a bad thing to have on the C.V. When an outfit wants some ADA done, they're 1) desparate, 2) probably got a lot of money, 3) willing to pay whatever it takes, and 4) they'll probably let you watch the rocket launch / explosion / press the start switch on of a new nuke / etc, and 5) get you a security clearance which is a good ticket to lots of other well funded jobs. Kerrrrrrrching!

        COBOL probably has some value, even now, if one can stand the tedium...

        "Javascript like a lot of duck-typing scripting languages (including Python) are nearly as dangerous as pointer maths. and void * in C/C++; I know this from personal experience with all these languages!

        I couldn't agree more firmly with that point. Every time I've watched an experienced Pythonista coding away they've ended up being bitten by that, sometimes very painfully.

        In contrast I've yet to have a variable used uninitialised in my C/C++/C# that the compiler hasn't already warned me about. My paying attention to it is another matter...

    6. Anonymous Coward
      Anonymous Coward

      Re: Biggest problem is the name.

      > File I/O in Javascript?

      You are aware of course that the C specification¹ does not cover file I/O?

      > If these (apparently) simple tasks are buried deep in the manual

      I am not quite sure you understand how language specifications² work, or the difference between specification and implementation.

      ¹ The standard library does, but you can write a fully compliant C implementation without any file I/O functionality.

      ² For languages that do have one, such as so-called JavaScript.

      1. Paul Shirley

        Re: Biggest problem is the name.

        re: "¹ The standard library does, but you can write a fully compliant C implementation without any file I/O functionality."

        That's only true for a freestanding C implementation or non-compliant hosted implementation. A compliant hosted implementation is required to support the C standard lib. If you aren't learning on the most basic embedded hardware you'll have file io.

        1. Anonymous Coward
          Anonymous Coward

          Re: Biggest problem is the name.

          > That's only true for a freestanding C

          I know, Paul, but are we talking about the language or the whole environment? The above comment was meant to point out that I/O is not always part of the language's specification, even (and perhaps especially so) for highly formal languages.

    7. Colin Wright

      Re: Biggest problem is the name.

      HTML+JavaScript makes it _really_ easy to take input and display output.

      No need for file io in an introductory programming course.

  4. Stripes the Dalmatian

    Javascript: the obvious choice...

    ...because closures and prototype based inheritance are just what you need in an introductory programming course.

    1. Infernoz Bronze badge

      Re: Javascript: the obvious choice...

      Yes, they can be confusing and more opaque, thus harder to write/debug.

    2. Anonymous Coward
      Anonymous Coward

      Re: Javascript: the obvious choice...

      > ...because closures and prototype based inheritance are just what you need in an introductory programming course.

      No, but asynchronous execution is. Keeps them on their toes. >:-)

      1. Anonymous Coward
        Anonymous Coward

        Re: Javascript: the obvious choice...

        Dit soit en passant, if you are intimidated by closures and prototype inheritance you really did not want to be around back when LISP was considered a perfectly acceptable candidate for introductory CS courses.

        (I tend to think of JavaScript as LISP with a C-looking syntax)

  5. Alan Bourke

    I thought we needed to encourage new developers ...

    Any language that needs the like of TypeScript or CoffeeScript to impose some readability and sanity on it is probably not the best choice for an introductory programming course.

    1. Dan 55 Silver badge
      Devil

      Re: I thought we needed to encourage new developers ...

      I couldn't think of a worse language to switch to, you can't even reliably compare variables in JavaScript without something tripping you up. The only way to teach JavaScript (like PHP) is to have a huge list of things which are labelled "DO NOT USE AT ALL" or "DO NOT DO IT THIS WAY, DO IT THE OTHER WAY".

      1. TRT

        Re: I thought we needed to encourage new developers ...

        Ah, but it does teach you a LOT about type casting and the hazards around that.

      2. Adam 52 Silver badge

        Re: I thought we needed to encourage new developers ...

        "I couldn't think of a worse language to switch to"

        Perl.

      3. Anonymous Coward
        Anonymous Coward

        Re: I thought we needed to encourage new developers ...

        > you can't even reliably compare variables in JavaScript

        Could you name a few languages where you can reliably compare variables?

        1. bazza Silver badge

          Re: I thought we needed to encourage new developers ...

          "Could you name a few languages where you can reliably compare variables?

          ADA?

          1. Anonymous Coward
            Anonymous Coward

            Re: I thought we needed to encourage new developers ...

            >> "Could you name a few languages where you can reliably compare variables?

            > ADA?

            Can you show how to compare two floats for equality in ADA, and perhaps (if knowledgeable in the language), how to do the same operation in JavaScript?

        2. Dan 55 Silver badge

          Re: I thought we needed to encourage new developers ...

          Any language that doesn't have several truthy/falsy values which compare bizarrely depending on how JavaScript decides to cast them and their order either side of the equals operator.

          link

          1. Anonymous Coward
            Anonymous Coward

            Re: I thought we needed to encourage new developers ...

            If you need strict comparison, use strict comparison.

            1. Dan 55 Silver badge

              Re: I thought we needed to encourage new developers ...

              === can't deal gracefully with objects. You can't compare an object with an object as two objects are always not equal even though the object type is the same because JavaScript doesn't have the brains to realise you want to strict compare the exposed values, it just strict compares the object addresses.

              As a result of this you can't compare a string/number literal with a string/number object. You might handwave this away as different types but you can't even compare a string/number object with another string/number object.

              And there is no <== or >==.

              In JavaScript there's always an exception that proves the rule.

          2. Anonymous Coward
            Anonymous Coward

            Re: I thought we needed to encourage new developers ...

            > Any language that doesn't have several truthy/falsy values

            Specific examples have already been asked before, I believe, yet none have been provided. That makes it rather difficult to know what the original poster meant by 'reliably comparing variables'.

            Comparisons are deterministic in JavaScript (with the exception of IEEE floating point values, as in many other languages, ADA included). The rules may be somewhat complex due to the three-valued truth tables and type casting rules, but they are nonetheless deterministic.

      4. bazza Silver badge

        Re: I thought we needed to encourage new developers ...

        @Dan 55,

        "The only way to teach JavaScript (like PHP) is to have a huge list of things which are labelled "DO NOT USE AT ALL" or "DO NOT DO IT THIS WAY, DO IT THE OTHER WAY"."

        And with the remaining and nearly useless subset, one could use that kinda like an opcode set, and build a compiler back end for it for GCC, CLANG, or something like that! What a neat idea!!!!! Oh, wait...

      5. Vic

        Re: I thought we needed to encourage new developers ...

        The only way to teach JavaScript (like PHP) is to have a huge list of things which are labelled "DO NOT USE AT ALL" or "DO NOT DO IT THIS WAY, DO IT THE OTHER WAY".

        This image says it all...

        Vic.

    2. snoggs
      Coat

      Re: I thought we needed to encourage new developers ...

      I suppose that MIXAL is out of the question?

      1. bazza Silver badge

        Re: I thought we needed to encourage new developers ...

        @snoggs,

        "I suppose that MIXAL is out of the question?"

        It's a long way from the worst option on the table! I was thinking of something like Whitespace. Hard to learn, but at least you can legitimately hand in a blank piece of paper as coursework and get top marks...

  6. Anonymous Coward
    Anonymous Coward

    Odd. I could see the reasoning if this was just a standalone 100-level course designed to teach non-technical students the fundamentals of control structures and basic algorithms. You've got none of the overhead of a type system or real OO or having to go through a write-compile-debug cycle or setting up a build environment.

    If it's anything more than that, as a course, then JS is entirely inappropriate, exactly because it lacks all of those things.

    As an aside, frankly the Java ecosystem has never been stronger. It's the lingua franca of data engineering, and Spring Boot has given it the shot in the arm it needed for web dev. Modern Java is a very pleasant experience, not your slow and crufty Java of old.

  7. Stephen Booth

    Tells you what the real aims of the course are

    Ecmascript (aka javascript) is an important language in that is the most widely supported language for running code in a browser. If that is what you want to do then its the right thing to learn. I really don't see the point in running it elsewhere, though I will concede that there are some advantages to using the same language in both client and server I personally don't find the argument for its use on the server side compelling.

    Though I'm hugely impressed by the performance of modern javascript engines and the utility of libraries like jQuery I actually don't like the underlying language much.

    I recently went through the process of porting my 20+ year old classic fractal hack

    https://spbooth.github.io/xmountains

    to javascript. Once I got past the superficial resemblance to Java the language actually reminds me more of perl. Very useful in the appropriate context. Large number of powerful libraries available. But you spend far too long debugging small problems that would have been flagged as compiler errors in most languages.

    Not knowing any javascript can be limiting, only knowing javascript more so but heck everyone has to start somewhere and at least if you teach javascript first you don't have to worry about students installing the development environment and also gives immediate access to pretty graphical results. Kids these days just don't find hello world impressive any more.

    1. Anonymous Coward
      Anonymous Coward

      Re: Tells you what the real aims of the course are

      "Kids these days just don't find hello world impressive any more."

      I'd agree, which is why I'd probably teach Scala or Python (or both, Scala for software engineering, Python for a data-centric course) in a notebook environment. Solves the build environment, IDE and immediate feedback problems in a stroke and provides the perfect platform for authoring and distribution of courseware.

    2. Whitter
      Meh

      Re: real aims of the course

      "... transition for the past five years, writing a new textbook ... Roberts wrote the Java textbook still used in CS 106A, The Art & Science of Java..."

      I think you'll find the real aim is to maintain sales of a textbook written by Roberts to his students.

      There will be benefits to all without doubt, but in further education one should always question the alleged reason for anything.

    3. John Smith 19 Gold badge
      Unhappy

      "spend far too long debugging small problems that would have been flagged as compiler errors"

      I'm guessing a lot of the time that would be a type mismatch.

      Javascripts idea that the variables type is whatever the you want it to be that the function needs is very flexible, as long of course as what you think it should be matches what Javascript thinks it should be.

      This smells like the PL1 implicit type conversion rules to me. Not a good smell at all.

      I'd also suggest that for many people who've had to maintain it being "pearl like" is not an advantage either.

    4. bazza Silver badge

      Re: Tells you what the real aims of the course are

      @Stephen Booth,

      "Ecmascript (aka javascript) is an important language in that is the most widely supported language for running code in a browser. If that is what you want to do then its the right thing to learn."

      For the moment. With the recent work done by a few researchers to use Javascript to unwind operating system ASLR, there's a real possibility that the world will go off the whole idea of client side execution of unknown code in web browsers. ASLR unwinding probably makes browser exploits far more reliable, and therefore more potent.

      We have yet to find a client side arbitrary code execution technology that has survived the test of time. Flash / Java had a lot of problems, ActiveX did too, and now we're beginning to wonder if Javascript is as "safe" as the modern Web needs it to be.

      1. Stephen Booth

        Re: Tells you what the real aims of the course are

        I have similar concerns to some extent. In principle JS may have a security advantage because it started with a much more limited scope than a general purpose language. A language whose only purpose is to manipulate a DOM tree might be easier to secure. However everybody seems set on expanding this scope to general purpose compute and the JSON parsers are so complex they may very well contain potential exploits. Only time will tell.

        1. patrickstar

          Re: Tells you what the real aims of the course are

          It's a horrible language if you need a stable, secure runtime with high performance. Which incidentally would be three of the major requirements for using it in web pages.

          The various behaviors and quirks of the language really makes any implementation a mine field. Part of this is outside the language itself but rather things like the DOM APIs, but the fundamental language design certainly plays a big part as well.

          Because of fundamental misdesigns like the type system, today's JS engines really have to jump through hoops and perform black magic to achieve the sort of performance needed, and this comes at a great cost.

          No harm to Brendan Eich intended - anything designed and implemented in a couple of weeks in 1995 would have its share of issues when people decided it's a good idea to use it for general purpose applications 20 years later.

  8. Anonymous Coward
    Anonymous Coward

    Just teach them Python

    Job done.

    1. Paul Crawford Silver badge

      Re: Just teach them Python

      Python looks to me as a good choice. But it, along with JavaScript, both have one serious aspect that is lacking - strong (maybe any) data typing.

      Yes, it is really handy not to worry about small details like is it integer, float, character string, etc, when you still have to grasp the basic concepts (maths, branching, subroutines, not to re-implement libraries) but I have met people programming in C++ with "more than a year experience" and they don't understand the fundamentals of what types mean to the CPU, etc.

      Get my day's rant in early!

      1. Anonymous Coward
        Anonymous Coward

        Re: Just teach them Python

        Python is strongly typed, it's just duck typed. It's a fair point though that types are relegated to an implementation detail. Go with Scala. It's as type-y as you're going to get.

        1. Infernoz Bronze badge
          Facepalm

          Re: Just teach them Python

          No it isn't when methods/function arguments are not typed!

          Duck(not) typed, often doesn't give enough type hints to an IDE, so just try and search for type/method/property usage with an IDE and fail hard, and good luck getting any drop-down help in any class/method not directly creating the object used!

          Even the Python designer finally awoke to the idea that typed method arguments maybe a good idea (actually compulsory for sane people)!

          Just try to pin down the type usage in a large Python project like Calibre; damned frustrating!

      2. Anonymous Coward
        Anonymous Coward

        Re: Just teach them Python

        If the instructor of the programming course is at all competent, they'll easily be able to show how data types affect performance.

        JavaScript has data types. But variables are variants and it will readily do implicit conversion so you have to manage types yourself to get best performance.

        1. Anonymous Coward
          Anonymous Coward

          Re: "manage types ... to get best performance."

          "[ecmascript has datatypes and ...] you have to manage types yourself to get best performance."

          Not just to get best performance. Also to get application behaviour that 'does the right thing' (unless things have changed since this 2012 video):

          https://www.destroyallsoftware.com/talks/wat (four minutes)

          or since this 2014 bogpost:

          https://blog.chewxy.com/2014/01/27/javascript-wat-again/

    2. SolidSquid

      Re: Just teach them Python

      I'd probably go with both python and C# so they get experience of two different languages, including a compiled one. That should expose them to a decent range of programming concepts while also giving them two languages used in industry already. Much as I'd like to encourage C++ or something else a bit closer to the metal, you'd spend a lot more time on getting them through the initial setup than I think would be worth while

      1. Richard 81

        Re: Just teach them Python

        Personally I'd swap C# for Java, but otherwise I agree.

        1. Anonymous Coward
          Anonymous Coward

          Re: Just teach them Python

          Yep, C# is a Microsoft product, and only works with there products.

          Why tie yourself in to one vendor?

    3. thames

      Re: Just teach them Python

      I have to agree with the recommendation for Python when teaching the basics. Anyone planning a course has to deal with the reality that there are a very finite number of hours in which to teach, and the toughest decisions are which of the "essentials" to leave out of the course rather than what to include.

      The design of Python allows the basics to be covered without requiring knowing the advanced features. Knowledge of syntax and features can be added to the course incrementally, instead of requiring the student to learn a large amount of what they would see as "mumbo-jumbo" up front.

      The standard library is very comprehensive, which allows topics such as simple databases, regular expressions, string formatting, file and directory handling, socket I/O, servers and clients, graphics, simple GUIs, etc. without using third party libraries. The syntax of the language itself supports dictionaries, lists, sets, etc. Teaching all of these would be impossible in the time available, but it gives the instructor a good selection of topics to choose from without a lot of teaching overhead.

      The on-line documentation for Python is superb, being some of the best that I've seen for any language.

      Another big advantage of Python is that it is more or less self contained. It comes, as the saying goes, "batteries included". Installation is simple (if it is not already pre-installed). Again, this is very important from a teaching perspective, as there needs to be minimal overhead involved in the students installing it on their own.

      No IDE is required, and none should be used in the course. There are many simple free text editors available which will do syntax highlighting and auto-indenting and require minimal time to learn. I have seen how introductory courses go where some students are still struggling to get their complex IDEs working three classes into the course and as a result haven't complete the first assignment yet. Class assignments are short and simple, so you aren't dealing with searching across massive code bases. If you "need" an IDE in order to use a language effectively in a classroom, then it's the wrong language for this application.

      The Python compiler rigidly enforces a set indenting style, which again is a big advantage in a classroom environment. This means the style of code as taught by the instructor will be close to that written by the students, so the instructor doesn't have to wade through a mess of unindented code ("I was going to clean it up after I got it working" is the typical excuse) when students come to him with problems.

      Python is also very likely to be more useful to engineering and science students than Javascript is. One of the major areas of application for Python, and one of the reasons the language is so widely used in real life, is that there are large, high quality numerical analysis libraries which are intended for use with it. Many people learn Python specifically so they can use these libraries.

      Overall, the reasons for using Python as a teaching language are quite compelling. For someone who is going on to take a degree in computer science, Python, or indeed any other single language, is not enough. I would expect them to learn a number of different languages, giving exposure to different concepts. 'C' is very important for a "serious" programmer to learn, but I don't think it's appropriate these days for an introductory course.

      So far as this particular instance at this university goes however, the CS 106J course appears to have some very limited objectives. There are a couple of other courses (e.g. data visualisation) which require knowledge of Javascript as a prerequisite, and this course appears designed to fulfil that. Courses oriented to engineers and scientists require knowledge of Python.

  9. Buzzword

    No, COBOL is dead

    A quick search through my usual job ads website reveals exactly three jobs which want COBOL skills; two of which only require the ability to read it, not to write it. The same site turns up approx. 1,200 jobs each for Java, C#, and Javascript.

    Besides, for a new starter today, the correct question is "Will my COBOL skills still be in demand when I'm 60?"; to which the answer is emphatically no.

    1. bazza Silver badge

      Re: No, COBOL is dead

      Sure, but if someone really, really wants that COBOL read they're going to have to pay a rate to attract someone to do it. They're probably a bank, and probably getting increasingly desparate and willing to part with quite a lot of money to get themselves out of a hole. For the right money even I'd be willing to learn it.

      Those few guys/girls left who know it can fill that diminishing niche, for the right price. The last COBOL man/woman left standing could become quite well off on the back of it!

      Admittedly it is the coding equivalent of the undertaker charging for the coffin, burial services, cortege, lillies, etc. It's not exactly the sort of analogy one ones to take into one's own retirement given that one's own end is drawing nearer. Still, there's good money in burying corpses when done officially; the rates for unofficial work include a lot of danger money...

  10. Anonymous Coward
    Anonymous Coward

    Obsession with web pages...

    "[CS 106J] covers the same material as CS 106A but does so using JavaScript, the most common language for implementing interactive web pages, instead of Java," the university website explains.

    I think that tells us all we need to know. This is not designed to start real developers on the road to producing useful workable as bug free as possible useful programs.

  11. This post has been deleted by its author

    1. Anonymous Coward
      Anonymous Coward

      Re: Android and the "Language of Choice".

      "Everyone I know who develops for Android does the bare minimum of Java forced on them by Google and jumps into something better as soon as possible."

      You can't know many Android developers that develop apps that aren't just a full screen surface then.

      1. This post has been deleted by its author

  12. Anonymous Coward
    Anonymous Coward

    Education

    Education is not training.

    And if I had a bunch of CVs to sort, the maths graduates would go top, followed by anybody with a hard science degree, followed by the CS grads.

    1. Brian Miller

      Re: Education

      And training is not education.

      Recently, I worked with a developer who didn't know the difference between a C precompiler macro and a function. I had to write sample code to show him the difference. He had been writing C in the same job for 18 years.

      I have worked with mathematicians who did not know programming data structures. They were somewhat competent, but did have a ways to go.

  13. Unep Eurobats
    Boffin

    US courses are more modular

    Comp-sci majors will learn enough other things to avoid being spoiled by this. The hope is that it could tempt people from other disciplines.

    The big advantage of JavaScript is its low cost of entry. Notepad and a browser? You're ready to program. It's so straightforward to start that students who are mainly interested in another subject might give it a go.

    The result could be that graduates in, say, literature, philosophy and economics leave university with at least some understanding of programming in addition to their other skills. Contrast this with the situation in the UK where the Classics and history graduates who run the country seem to think that any kind of technical knowledge is best avoided in case it somehow dirties their minds.

    1. Anonymous Coward
      Anonymous Coward

      Re: US courses are more modular

      Exactly - It's only the PPE graduates who think they run the country!

      (From a former civil servant)

    2. Anonymous Coward
      Anonymous Coward

      Re: US courses are more modular

      Programming anything non trivial without an IDE is frankly stupid druggery and gets exponentially worse as a project grows.

      Anyone using notepad or Vi much looks like a masochist to me, even Notepad++ is only a little more useful with it's plugins.

      The arts may make life more pleasant and add refinement (or damage via bad politics/law and bread & circuses mass media) but are expendable luxuries without the input of the real productive people who actually build and produce stuff, and those who defend our territory and way of life; the arts people really need to get their fat heads out of their arses fast, because times are a changing!

    3. Phil O'Sophical Silver badge

      Re: US courses are more modular

      The big advantage of JavaScript is its low cost of entry. Notepad and a browser? You're ready to program.

      So it's the BASIC of the 21st century? Fair enough, if we remember that the B stands for Beginner's.

  14. KarateMonkey

    "JavaScript, the most common language for implementing interactive web pages, instead of Java"

    Oh here we go again. I'm experiencing this pain at work right now - so many contemporary approaches to software development assume you're developing web pages FFS. In fact most enterprise software development consists of complex heavy-weight processing server-side, with some Javascript/HTML client-side to provide a user interface.

    "JavaScript is lighter weight and easier to pick up than Java"

    Having used both, I find this assertion hard to believe.

  15. Kubla Cant

    Easier to pick up? Not really.

    JavaScript is lighter weight and easier to pick up than Java, so it's a better fit for an introductory course, particularly when a lot of the students won't go any farther than building websites anyway

    JS is only "easier to pick up" and use for "building websites" in a very limited sense. It's all a matter of what you're picking up.

    Once upon a time, when web pages were mostly HTML, JS was mainly used for enhancements and tweaks, and scripts didn't contain much beyond procedural code and simple inheritance. The language specification scarcely changed for ten years. It sounds like the course is teaching this kind of antique JS.

    These days, JS is a hotbed of crazes, functional programming enthusiasms and novel frameworks. There are at least three language versions in common use. Knowledge gained on version N of a framework will be useless when version N+1 is released. Web sites now consist of large single-page applications, and their syntax and code organisation will be utterly baffling to someone who's been taught "window.alert('Hello world')" scripting.

    Regardless of opinions about the relative merits or potential longevity of the two languages, Java has more overall consistency between APIs and stability between versions. Students who have completed an introductory course in Java stand a better chance of finding their way around real-world applications than they do in JS.

  16. John F***ing Stepp

    Advatage/disadvantge

    Almost same syntax as C C++ but has way too much DWIM built in; I have seen far to many Javascript programs missing simicolons that still ran.

    The language will turn your arrays into objects on a moments notice causeing hard to debug errors (at least at first) and has hard to find different gottchas from one browser to another. What it will teach very well is that life is unfair and that you need to take notes.

    1. patrickstar

      Re: Advatage/disadvantge

      Javascript/ECMAscript syntax actually only requires the semicolon when it's needed to resolve ambiguities.

      Which might avoid cancer of the semi-colon, but leads to fun situations like:

      return { foo: "bar" };

      and

      return

      {

      foo: "bar"

      };

      not doing the same thing.

  17. JRStern

    Algol-W

    On punched cards.

    1. Herby

      Re: Algol-W

      The 60's called. They want the chad back.

  18. Kevin McMurtrie Silver badge

    The first step is to see what you have done

    JavaScript integrates with the most familiar UI of all - the web browser. It gives starting students a way to visualize what they're doing. I think it's a great starting point even if the language details are a bit of a mess.

    Java's native UI sucks. It started out as a bunch of randomly arriving callbacks and semi-documented magical containers then evolved into heavyweight event-driven layers of code-generated-code that you were wrongly assured would look right on each system. From there it only gets worse if you want to touch pixels and sound samples. This is why (non Android) Java became mostly a server language.

  19. Herby

    What is an "intro" course for??

    It is to get young minds full of mush some understanding of what really goes on. Unfortunately the problems encountered in such a course have little bearing on "reality". Stanford has gone through many languages in its "intro" courses, some which really don't exist outside of the given course work. They started out with:

    1) Algol on a Burroughs 5500

    2) Algol-W on an IBM 360/67

    3) Pascal on TOPS-20

    (and as the author says):

    4) C

    5) Java

    6) Javascript, the latest.

    Most of these are nice "teaching" languages, but are a bit difficult to get going in "real life". The problem is that the techniques taught in the first course of programming just don't translate well. One of my experiences was helping a younger sister (student at Stanford!) with an assignment in Pascal. Kinda obtuse the problem, but it did teach some programming concepts. I also helped out a roommate work the same problem (in a different way, don't want to give it away!) which was based on the notes from the professor. They were two different programs in the end. Now that we all have computers, the problems encountered seem to be along the lines of "how do I format this in Excel" or some such. Most who USE computers don't have a clue about what work goes into the various programs they use. For the most part, it really doesn't matter. Sure we do actual "programs", but being in an IT profession is but a fraction (and a very small one) of the workforce.

    Life goes on.

    Maybe the intro course should be how to do macros/database in Excel. Combine with "elementary Word" and you might even have a course.

  20. Anonymous Coward
    Angel

    I thought the purpose of an introductory CS class ...

    ... was to teach students the fundamentals of computer programming, and not "design your own Javascript web page in 12 easy steps".

    > Java, released in 1995, debuted at Stanford in 2002. For the decade before that, Stanford's computer science department focused on the C programming language, according to The Stanford Daily. And before that, CS 106A was taught in Pascal.

    That's the problem right there. Went from C to Java to Javascript.

    When learning C, one learns much more than fundamentals of programming per se. An introductory class in C is also an introductory class in computer systems in general: memory management, addressing, calling convention, argument passing, return value, etc.

    I don't know how one can convey these difficult concepts through Java or JavaScript. And starting off with OO programming before having a good grasp of an imperative programming language seems kind of backwards to me.

    Even if one doens't want to become a C programmer, learning C as a first programming language is much more useful in the long-run than starting out with something like JavaScript.

  21. Ilsa Loving

    Not necessarily bad

    My initial knee-jerk response to this was, "WTF, are you kidding me? How is javascript a good language to learn on?"

    But if I think about it, and as others have mentioned, the language you learn doesn't really matter because it's the concepts and techniques that are important. The language is secondary.

    Additionally, Javascript is (unfortunatley) becoming a dominant language, despite the fact that it's a god-awful pile of shit. That means we can expect even more lousy, security-nightmare code. If Javascript becomes front and center in Comp Sci curriculums, then people can at least be taught to code more defensively and be mindful of Javascripts sometimes unbelievable quirks.

  22. bombastic bob Silver badge
    Stop

    C-pound? ANYTHING BUT C-POUND!

    "I'd probably go with both python and C# "

    C-pound? NO. NO.

    Both Python and JAVA. That will do (for an intro course). But NOT C-pound. NO. It's an abomination, a bastardized clone of Java with a bunch of Micro-shaft excrement and ".Not" thrown in for entrapping developers into "the Microsoft Way" of doing things, a gateway to UWP and "the Metro". NO. It's the epitome of bad programming habits, unnecessary complexity when none is even REMOTELY needed, etc. etc.. NO. Just NO.

    C-pound is to object oriented programming as snake oil is to medicine

    (stick to Javascript before going down THAT hell-hole)

    1. patrickstar

      Re: C-pound? ANYTHING BUT C-POUND!

      Uhm, you are aware that there is a fully open source implementation of the .NET runtime?

      You can run your C# applications on Linux just fine.

      And that the languages is basically Java but with the worst mistakes fixed, and some nifty new features?

      It's not the best thing since sliced bread, but I'd certainly prefer it to Java...

      1. bombastic bob Silver badge
        Devil

        Re: C-pound? ANYTHING BUT C-POUND!

        "You can run your C# applications on Linux just fine."

        Again, NO. Just NO. I'm aware, and I want _NOTHING_ to do with that. I was angry enough when Tomboy was included with gnome on Debian. It took effort to remove it. I took the effort to remove it. I never want to see anything like _THAT_ polluting a perfectly good Linux distro, EVAR again!

        /me checked, no troll icon. you must've been serious.

  23. Anonymous Coward
    Anonymous Coward

    Graph Vallys

    Two pages and no one has commented on that graph. They trend differently but seem to have matching regular valleys. Anyone know why? The period seems odd. Its probably something really obvious but I cant see it.

  24. Richard 92

    Myopic and misguided

    "Roberts, who was not immediately available to discuss the change, told The Stanford Daily that Java is showing its age and that JavaScript has taken its place as a web language."

    I'm sorry, but I don't care if Eric Roberts is emeritus professor of computer science. He is simply plain wrong. First of all, Java's importance in the IT industry is NOT as a web language but as a general-purpose language. It's widely used everywhere, including web, desktop, mobile, games, numerical computing, data science, machine learning, Internet of Things, cloud computing, etc. Java was never native to the web browser, whereas JavaScript has always been.

    Second, the purpose of university is to provide a sound academic foundation, not to cater to "vocational" expectations. Freshmen should be taught basic programming skills using a good teaching language. No matter how you may paint JavaScript, it is definitely not a good teaching language. In fact, it's one of the worst programming languages ever "designed" (and I use that term charitably). Read https://hackernoon.com/the-javascript-phenomenon-is-a-mass-psychosis-57adebb09359

    That any university should teach JavaScript as a first programming language to beginners is an utter travesty. I wrote about a university's responsibility here: https://medium.com/p/an-open-letter-to-all-universities-ad98af4a96b3

    Second, JavaScript is primarily for web programming. (It has limited traction server-side with Node.) Everywhere else, better alternative languages are more commonly used...Java, Python, C#, Ruby, Scala, Go (server-side)...Java, Swift (mobile)...Java, Python, C++ (desktop)...Python, R (data science, machine learning)...C++, C# (games)...Python, C++ (numerical computing, financial industry)...and so on. Stanford's course assumes that web programming is all there is to general programming for freshmen. This is an extremely myopic and misguided attitude.

    Even if you think Java is too heavy for freshmen, JavaScript is not the answer. Python is a much more sound language that is used far beyond the web. I believe the ideal teaching language is Smalltalk: read https://hackernoon.com/what-makes-a-programming-language-cool-f40401f0f929

    1. Anonymous Coward
      Anonymous Coward

      Re: Myopic and misguided

      I agree. javascript is a horrible language.. I much prefer python or scala.

      If you want to TEACH.. hey, java is more verbose.. and better structured. Sorry, I mean it has a proper structure and is strong typed...

      Now, these days I prefer to use nodejs with javascript... but I would prefer to have the equivalent in java or scala.. proper equivalent.. as I do use maven, spring if needed, etc. For microservices both javascript and python are way faster, use a ton less resources and are not encumbered by Oracle.

      Still, NOT for teaching..

  25. EveryTime

    CS requires exposure to multiple languages

    I think it's important for CS students to understand multiple programming approaches.

    Perhaps C shouldn't be the first language, but it has many instructive attributes. Especially teaching that objects are really structures, and that not everything should be an object.

    And of course teach the 'bad idea' programming languages such as Prolog. Because sometimes innovative ideas are simply bad. (For those that don't know, Prolog is a declarative language. But the only way to write a usable program is to order the declarations so that they considered in the correct sequence. At which point you've written a procedural program that still risks going off into the weeds and taking infinite time.)

    1. Aitor 1

      Re: CS requires exposure to multiple languages

      I would also teach them lisp. Just for fun...

  26. Anonymous Coward
    Anonymous Coward

    Javascript is a great flexible, versatile and powerful programming language but it's not for everyone (especially those who can't get over the type thing and make a big deal out of it), and probably not for beginners.

  27. Richard 92

    Wrongheaded Thinking

    "Roberts, who was not immediately available to discuss the change, told The Stanford Daily that Java is showing its age and that JavaScript has taken its place as a web language."

    First of all, JavaScript and Java are the same age. Both came out in 1995. Why is Java showing its age and not JavaScript?

    JavaScript has been updated with ES7 and soon ES8, but Java has been updated with Java 8 and soon Java 9. Both languages are continuing to evolve.

    Second, JavaScript has always been the language of the web browser; Java never was (or at least Java applets were a failure 15 years ago).

    Today, Java is still a crucially important server-side web language for the enterprise. If Professor Roberts thinks the enterprise will dump Java for JavaScript, he’s totally deluded.

    Third, if he’s so concerned with Java’s future, why not teach Python instead? It’s a far better language than JavaScript. Easier to learn. Syntactically cleaner. Just as useful (Django for the web), or at least far more useful outside of the web space.

    In fact, most universities teach either Java or Python to freshmen (https://medium.com/@richardeng/an-open-letter-to-all-universities-ad98af4a96b3 ). How did Professor Roberts miss this???

    Fourth, JavaScript is a deeply flawed programming language. I don’t suppose Professor Roberts realizes this. Its semantics are internally inconsistent. It exhibits horrific runtime behaviour (JavaScript can even fail silently!).

    Did Professor Roberts ever see this talk from MIT’s James Mickens?

    https://youtu.be/D5xh0ZIEUOE

    Here is something else for Professor Roberts to chew on: JavaScript is only good for web programming. Everywhere else, it plays second fiddle to other languages, if it plays at all.

    And Node.js? It’s mostly used in a web programming context.

    Python is far, far more useful. It’s used for numerical computing, data science, machine learning, natural language processing, Internet of Things, desktop, mobile, animation, gaming backend, operations management, telephone infrastructure, neuroscience, payment systems, media storage and processing, etc. What the hell is JavaScript used for???

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like