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."
They should be teaching PL/1 or FORTRAN.
When I was in school we had to use ECMAScript!
Given the uncertainty surrounding the future of Javascript.
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??
And I was angry when schools switched from C++ to Java..
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 :)
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.
Surely if it is a 101 - that's binary and we should be using assembler
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.
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.
CS101 is for non-techies - it's basically "how computers work". CS105 is a more detailed introduction to programming for non-techies.
CS106A/B is the techie's programming class, and the actual start of a CS degree.
It's great that we have one language to do everything, server side, client side, etc. But it's terrible that it's javascript.
Thank God, we have transpilers, and new languages popping up on top of it, such as Coffeescript.
More flexible and expressive syntax (ala python or ruby), more functional capabilities, better performance, jquery...
Better standards, widespread adoption. This is starting to look good after all.
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 the way to go.
The class that the vast majority of students who plan to continue in the CS track take at Stanford is CS 106A, which is Java-based, and is designed with students who have never seen a line of code in their life in mind. This may be /an/ introductory class, but it is not /the/ introductory class.
(A full listing of classes under the CS department at Stanford can be found here: http://explorecourses.stanford.edu/CourseSearch/search;jsessionid=C05909CBF4C2E990D48059C809E93A19?view=catalog&catalog=&page=0&q=CS&filter-catalognumber-CS=on&filter-coursestatus-Active=on)
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.
In 1990, Huddersfield University in the U.K. were starting students off with JS on software engineering courses.
.. without escaping the HTML.
http://www.stanford.edu/class/cs101/syllabus.html
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
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?
and the dishwasher for free.
I hated shit PL/1. Had to learn it for a course another a(sshole)IBM language. When something has everything iut becomes shit to everybody. JAVA in today's shit COBOL.
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.
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.
Did any of you go look at the course? It is actually pretty fun. I will recommend it to people who would like to touch their toe in the programming waters.
I love that they are using non standard DOM components, so that the homework assignments cannot be done in Internet Explorer.
Sergeant Major.
Bloody programmers! Don't know what the world is coming to!
Only a person that doesn't know either Lisp or Scheme would equate Javascript to a "Lisp/Scheme in C's clothing." It's sad how often this saying is repeated by the Javascript community.
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.
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?