Stanford CS101 Adopts JavaScript
mikejuk writes "In case further proof were needed that JavaScript shall indeed inherit the earth, we have the news that Stanford has adopted JavaScript to teach CS101 — Introduction to Computing Principles: 'The essential ideas of computing via little phrases of JavaScript code.' You can even try it out for yourself at Stanford's course page."
When I was in school we had to use ECMAScript!
For utter newbs not going into CS, JS is a good choice, because any machine with a web browser is a dev box, but for actual CS students, a debian boot disk is probably more appropriate.
You should have heard the screams of pain in my cobol class many years ago. What, you mean a "dos" application? And the alternative is a AS/400 that doesn't even support telnet? Someone who suffered thru that kind of experience probably went to the other extreme in selecting JS.
JS isn't even all that bad of a language for newbies to learn the basic concepts.
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
Does anyone really get admitted into Stanford without being able to program already??
Why wouldn't they use javascript? I think it's a much better learning language than most of the alternatives (java) because not drowning in crufty committee-designed latest-fashion constructs. It's got all of the iterative basics, but it's also got it's lispy functional side. And it's simple.
cs101 without even seeing a compiler? Tragic :)
Hey! I had FORTRAN for my introductory Programming course at PennState in 93 :(
This might be a good thing. We might actually have some people learn how to develop proper java script instead of most of the junk that is churned out now. My first real language was pascal (I knew the old apple soft basic but that was a kludge at best), granted it wasn't the easiest to learn but you did get a feel for structure using it.
Time to offend someone
Douglas Crockford explains why you think JavaScript is a bad programming language: http://www.crockford.com/javascript/javascript.html
Wh47 d1d j00 541, 31337 15n't t3h r0xor5 ne m0r3???
[curvy bend] Task 4.2.31: Write a LALR parser for MIX in Javascript
While MIT used Scheme as an introductory programming language, as seen in the legendary Wizard Book, in 2011 Stanford have dumbed down CS introductory classes to ... what? JavaScript? Sad, just sad.
cpghost at Cordula's Web.
Linked lists. Recursion. Calling by reference. Strong typing. Explicit declaration (or at least the need of it). There are some ways around those, but these hacks are even going to warp their minds worse than not learning those things would.
Of all the languages out there, why JS? Aside of VB there's no worse choice to learn programming. Sure, it offers quick satisfaction, but when you hit the wall (and you do soon in JS), you hit it hard because what you learned will not translate well into a more powerful and flexible language.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
The James Webb Space Telescope - if it's ever actually launched - will run its onboard science operations using scripts written in a tailored version of JavaScript.
PL/1? That was my intro lang in 79 @nyu. I had no prob with the lang it was great to
learn on, the real snag was punch cards and only getting 2 - 3 runs in in a 12hr day at the
data center.
for non cs majors. But there's a big gap between javascript and languages like C++, Java, etc, and it seems like you'll just waste time in future CS courses having to make up for that.
I was trying to remember what my CS101 equivalent was 30 years ago.
Turns out, I didn't have one. I got to skip it because the programming and math curriculum in my high school was strong enough that the university credited me.
So, then question became, "WTF do they teach in a CS101 class?"
Turns out, a whole bunch of miscellany. Rudiments, elements, cats, dogs, little green ponies. Stuff I though people picked up by osmosis nowadays.
So, if they're not trying to teach Architecture and Organization (mainframe assembler, and later VAX assembler), or data structures (PASCAL, C, etc.), or Objects (pick your OO poison), I don't think language-of-choice is particularly relevant.
But that's just my crusty old-man opinion. Looks harmless from my lawn.
Welcome to the Panopticon. Used to be a prison, now it's your home.
It's a reasonable language in its modern form. It has a reasonable, if not great, syntax. (Compare Perl.) Someone wrote that it doesn't support recursion. Yes, it does. It even supports closures. The object model is adequate, if not inspired. It's a memory-safe language. About the only thing it doesn't support is concurrency.
The current generation of JIT compilers do a reasonably good job on performance. Free implementations are easily available. So there's no problem running it.
The problem with Javascript is mostly that the code quality seen on many web pages is appallingly bad. (Or, alternatively, the source code has been run through some obfusicator/compressor.) That's not the fault of the language. Javascript's interface to browsers is also rather clunky; the primitives for manipulating the DOM were ill-chosen. But, again, that's not a language problem.
Pl/1 was the language for all non-computer types back in 1975 at UCLA. The computer types took FORTRAN
Geology - it's not rocket science; it's rock science
.. without escaping the HTML.
http://www.stanford.edu/class/cs101/syllabus.html
Oh good glub that brought back some horrible memories.
If I could think of a language with a syntax worse than JS, it would be PL/1. I just LOVE letting programmers use keywords as variable names, throwing up my hands and saying, "let the compiler figure this isht out!"
Excuse me while I go kill myself.
This sig is false.
To clarify, this class is a cursory overview of how computers work, a few basics on whats makes them tick and how to make them do fun things. This class is meant as a general education "learn about computers" effort, this is NOT their intro to CS class. Look at CS106X for programming, CS103X for discrete math, ...
To repeat: Stanford is NOT teaching CS majors javascript, they are showing off what computer can do for humanities students with CS101.
On a side note: I can see why most commenters would not catch this but how did the editors miss this obvious fact? Do a tiny bit of background research (aka click their link) and you will see how this summary is entirely misleading.
It's a first semester course, introducing elementary concepts in programming such as variables, data types, control structures, and input and output. Any programming language which has those standard features and isn't too far from the mainstream of programming languages really ought to fit the bill, and the simpler, the better.
The introductory course in programming I took used C++, but really, most of the material was in pseudocode; the idiosyncracies of C++ were a distraction, for the most part.
APL / CDC Cyber
just kidding, HPBASIC on HP 2000C time-share
assembly on IMSAI 8080
Pascal was my intro language ('81), and a good one it was. I had the honor of using PL/1 on my first job. A real kitchen sink language.
I would rather have them learning in Javascript than Java. Probably better Javascript than C++, too, but that could go either way.
Straight C would be best, imo. Less noise and clutter getting in the way. I think getting people writing simple programs as fast as possible is important, so that they can keep their interest, so that they can play. If you start trying to teach programming by first trying to force people to use more abstract concepts, such as OO, many of them will just hit a brick wall.
If you want your kid to learn carpentry, you give them a lot of wood, nails, a hammer, and a saw, and let them spend a year just playing. Learning the most basic concepts. You don't start by discussing building codes.
Repeat after me: "JavaScript is Scheme in C's Clothing."
Ok, let's test this claim:
Score: 1/4. I call this a failing grade.
Are you adequate?
The first few examples do not appear to be Javascript. It's implemented in Javascript, yes, but Javascript does not have the BASIC-like functionality that is used in the examples.
The above is a title of a book.
IF you read the above book and just use the subset specified, it's not bad in my opinion.
I don't actually program in javascript but may eventually. Intodays world you have to realize it exists. It's like a standard language that you will have to use sooner ot later.
Before reading this book I thought Javascript was the shit. The language to me was a fsckn mess but after reading the above book everything became golden..
Personally I like Ruby.
IBM had PL/1
With syntax worse than JOSS
And everywhere the language went
It was a total loss
I am TheRaven on Soylent News
Well, no, you can optimize efficiency within the constraints of an environment without any of those things, if you know the performance characteristics of the elements of the language you are using. You can analyze and optimize the efficiency of algorithms in languages in which things like strong typing and explicit declaration do not exist.
And, while optimizing algorithmic efficiency becomes important, its only important after you know how to analyze a problem and implement a correct solution in code. So even if knowing those things was necessary to be able to learn how to do that (its not, in general, though of course it is when you are working in an environment in which those things are present.)
By using iteration. Which tends to be safer than recursion in most languages where learning any of the other things on the list would be meaningful, because they tend not to feature tail-call optimization, and so even the cases of recursion that are safe to use without worry in languages that feature tail-call optimization aren't safe. (On the other hand, the poster upthread was wrong to feature recursion on the list, since recursion in JavaScript is just as easy as in most modern languages.)
I think its a matter of focus. Its important for people who are going to be CS majors to understand computers at a low level, and that should probably happen fairly early on in the major (maybe in the introductory class using a model like you describe hear, maybe a little later, but definitely the coding part of that should use things that are fairly low level for the platform they are implemented on, like C/C++ for most platforms or Java on the JVM.)
OTOH, I think for non-majors -- and possibly for a first course in the major, with the lower-level course as a second course -- the important thing is to focus on the higher level analytical and programming process of building and validating correct (whether or not optimal, from a performance standpoint) solutions to problems.
If you aren't majoring in CS, its quite likely that the main value you will get out of learning programming (assuming that you end up working in whatever field you are majoring in) is doing solo projects to support whatever your field is, or doing requirements analysts on a project where professionals are doing the actual coding; in either of those areas, its more critical that you can analyze a problem and understand how to approach a correct solution (and, in the first case, that you can actually implement that correct solution) than that you can optimize performance.
What do you mean ?
New things are always on the horizon
Hah... same here - CS201? Intro programming for engineers? My CS friends all had CS101 in Pascal at the same time.
The only reason JavaScript is still JavaScript the way it is now, is because doing radical changes with all the old browsers still out there would be hard to do.
Compatibility is the price you pay for popularity (or atleast widespread use).
New things are always on the horizon
Apparently, Microsoft is pushing the use of HTML5 and Javascript for UI elements in Windows 8. It's looking like the future of Javascript is fairly bright.
lets start with print out a string. Lets introduce a variable and a loop then lets go directly to screwing around with images.
WTF!
Hey KID! Yeah you, get the fuck off my lawn!
According to this, Javascript wasn't developed until 1995.
http://en.wikipedia.org/wiki/JavaScript
Or did you mean some other JS?
I was at another place and like all the engineering students learned FORTRAN and LISP while the CS students taunted us for using dead languages instead of Pascal or Modula-2. That's very funny in hindsight.
People who've used FORTRAN will understand why I've spelt "count" with a "k" above.
it's a type error. (Whether or not that type error should be caught at compile time or run-time is debatable. This is about weak vs. strong typing, not dynamic vs. static type checking.)
Weak typing is a horrible, horrible idea with almost no redeeming value whatsoever.
HAND.
I just LOVE letting programmers use keywords as variable names
The idea lives on, though - XQuery does that today. Coincidentally, it also happens to be a language where there's no straightforward way of separating the lexer and the parser (because you need parser context to know how the lexer should parse tokens - in effect, you need two different lexers switched on the fly by the parser).
That gives a whole new meaning to the phrase:
GOTO considered harmful.
Good thing you never got into the ADVANCED language, with its COMEFROM statements.
Where are we going and why are we in a handbasket?
WE had to run error correction codes on the smoke signals to even have any hope of having ones and zeroes!
And only if the wind was favourable and the tinder dry.
And you tell that to the young people today, they wouldnay believe you.
Where are we going and why are we in a handbasket?
You might try this handy reference book: "Monads for Morons" [Amazon.com]
It's the 23rd in an ongoing series of books attempting to explain the elusive concept behind and application of Haskell Monads.
See also:
"A Monad is a Wrapper"
"A Monad is syntactic Sugar"
"A Monad is an (endo-)functor"
"The Analogy between Monoids and Monads"
"A Monad is a Box"
"A Monad is a Composable Computation Description"
"A Monad is a Burrito"
and the classic
"Spam, Spam, Spam, Monads and Spam"
Where are we going and why are we in a handbasket?