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, …

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.

20
0
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.

18
0
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.

4
2
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.

19
1
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.

11
0
Silver badge
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.

8
1
Silver badge
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.

6
0
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.

2
0
Silver badge
Boffin

Re: As everyone in Silicon Valley knows

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

0
0
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/

5
0
Anonymous Coward

Re: As everyone in Silicon Valley knows

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

1
0
Bronze badge
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.

0
7
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!

0
0

Re: Is there any correlation between "popularity" and

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

0
0

Re: As everyone in Silicon Valley knows

If you want the dope, head to Europe.

0
1
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.

14
3
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.

2
9
Bronze badge

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.

15
3
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.

3
1
Bronze badge

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
1
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

0
0
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]

3
9
JLV
Silver badge
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 ;-)

0
0
Vic
Silver badge

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.

0
0

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.

0
1
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.

16
4
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.

12
0
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.

2
5
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.

8
1
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.

10
0
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.

0
3
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....

5
0
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.

3
0
Silver badge
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.

3
0
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!

2
0
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.

2
1
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

4
1
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...

3
0
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!

2
0

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.

3
0
Silver badge

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
0

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.

1
4
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
1
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
0
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.

0
0
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.

1
0
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.

1
0
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.

0
0
Vic
Silver badge

Re: Biggest problem is the apostrophe

Pop!

Stack underflow!

Vic.

2
0

This post has been deleted by its author

Page:

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

Forums

Biting the hand that feeds IT © 1998–2017