Learn How to Program Using Any Web Browser
The language is suitably light and simple, the book well-structured and broken down into easily digested chunks. The order in which concepts are introduced is fairly traditional for a language tutorial: first we get types, variables and statements, before moving on to conditionals, loops, and functions, followed by arrays and objects before finishing with event-driven programming. Davis' decision to leave string handling till last seems a little perverse and personally I would have introduced functions earlier.
My real complaints about this book centre on the abstract nature of the discussion. There are very few real world examples that could be useful to anyone. The best you get is a version of "Rock, Paper, Scissors" in Chapter 3, and an 'auction' application. The book would have been improved dramatically if the end result of your study was a few things you could actually point to.
I also have a complaint about the target audience for this book. The web page for the book at the publishers states that "The target reader is likely a twelve- or thirteen-year-old, who is just starting to get curious about what makes a computer work -- or an office worker who has been using computer applications for years, and would like to spend some time delving deeper into what makes them tick." Most adults and even teenagers don't want to 'learn how to program' as much as they want to learn how to use a tool to perform a task. If your tool is JavaScript, then it's almost certain your task is related to building web pages, but this gets little real attention from Davis. For even younger students, this book totally lacks anything to hold their attention -- the lack of real-world examples hurts here.
I also take issue with the title: this book doesn't really teach 'programming' much at all. It certainly teaches you to write JavaScript, but where are the sections about the real lessons of programming, such as top-down vs. bottom-up design, or breaking a task up into chunks? Even debugging has little coverage -- a single thirty-page chapter, half of which is specific to JavaScript or the throwing and handling of exceptions. Since the work of Papert and others at MIT twenty-five years ago, we've learned a great deal about how to teach programming concepts in a simple manner, but Davis appears to have ignored all this and given us a language tutorial. The publisher's web page for the book says "very emphatically, this is not a book about programming JavaScript." If that's so then I'd argue that it isn't a book about learning the principles of programming either.
It is obvious from this book that Davis is an excellent writer; if he had tried to write a book to teach JavaScript and had focused on the tasks for which it is often used this, volume may have been superb. As it is, he has shot for a higher goal and fallen far too short.
If you would like to check it out for yourself, you can go to the web page for the book where there is sample chapter, the Table of Contents (though they call it a "Detailed TOC" as distinct from the 'Table of Contents,' which is just a list of 11 chapter titles) and index, all in PDF format.
I went looking for a book that I could give to my 11-year-old daughter now that she has become interested in "what Daddy does." I'm still looking, I'm certain that this one isn't it.
You can purchase Learn How to Program Using Any Web Browser from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Why this:
Harold Davis has started with a marvelous idea, teaching programming using a language available on all platforms, JavaScript
Why not this:
Harold Davis has started with a marvelous idea, teaching programming using a language available on all platforms, Java
Maybe because that book has already been written?
The best way to learn how to program is to sit down in front of a computer with a reference handy and dive in!
geeky shirts.. funny shirts
Why Java? Everyone knows VB is the language of certified professionals.
by someone who learned to code from JS :(
Having a programmer's first effort be a JavaScript pop-up with: "Hello YOUR COMPUTER IS BROADCASTING YOUR IP ADDRESS TO THE WORLD!" is just wrong
I bet this article is going to rise a lot of flames... come on.. javascript... slashdot? yeah sure...
document.write("First Post");
The last thing the world needs right now is more programmers. Teach them some other trade which won't be killed by cheap global labor.
I think the reviewer's premise that 12-13 year old wants to learn programming for a specific task is bull. I think what the book is trying to speak to is how I learned to program: BASIC. I wasn't trying to DO anything specific it was just a good way to start playing around because it came free w/ the computer and you could make it beep or say hi or whatever. I think that posing javascript as a replacement (now that basic does not come packaged with the OS) is a GREAT idea. It's free, there is a developing environment built right in (well with mozilla at least) and it's actually fairly powerful while still beaing easy to learn.
The web browser is *not* an IDE. You do the programming in vim/gedit/notepad. (emacs is a bit much for javascript IMO)
I know this was meant as funny, but Java is a normal accepted language. Because it is more structured then Perl or other languages, I highly reccomend Java to beginners.
Javascript, or ECMA script, is a terrible non-standardized (despite being created by a standards board) peice of junk.
I'm a good cook. I'm a fantastic eater. - Steven Brust
5/5? 5/10?
useless
I *wish* JavaScript had Java like syntax. I can't count how many times I've typed this:
//do something with item
//do something with item
for(int i=0; i<length; i++);
when I meant to type this:
for(var i=0; i<length; i++);
or even worse:
function func1()
{
for(i=0; i<length; i++) func2(i);
}
function func2(item)
{
for(i=0; i<length2; i++)
}
when I meant to type:
function func1()
{
for(var i=0; i<length; i++) func2(i);
}
function func2(item)
{
for(var i=0; i<length2; i++)
}
(For those of you who don't know JavaScript, "i" will be global without that "var" definition.)
Javascript + Nintendo DSi = DSiCade
I've done a fair bit of Javascript programming, I think it's an okay language. It certainly could be worse. But here are some random issues that I think may make it difficult for beginners to pick up:
1) No print() or echo() function. If you want to write something to the equivilent of stdout, you need to use document.write(). And if you use alert() as you're debugging something, you'll quickly get tired of boxes that pop up, I know I have.
2) Weird OOP syntax. If you want to create class foo, you first create function foo, then to create a method you go and create function foo.prototype.bar(). I think that's needlessly complicated. It also leaves the beginner open for a shock when they start studing OOP syntax of other languages, where a class is defined and its functions are actually defined INSIDE the class.
3) No file/database support. Good luck trying to interact with a file or database from Javascript. As the user learns more about programming, they're going to want to use these sorts of things. Javascript just wasn't designed for that.
Those are the biggest things off the top of my head on why I believe Javascript is not an ideal choice for beginners. (I don't claim to be a JS god, so if I'm wrong about any of the above, someone please correct me...)
Don't you get it, Emacs is the browser and the IDE all in one! It does your laundry too!
Ironic.
This is a crappy environment for beginners. The first thing they will bump into is crap-loads of IE vs. Mozilla vs. Netscape JavaScript inconsistencies. The second thing they will bump into is "how do I save information per user, not per browser". The answer is server code, probably in a different languages than JavaScript, so now newbies have to keep two things straight.
I'd have to disagree with you. The syntax is very similar to C/C++/Java - (don't flame me because its not *EXACTLY* the same - and it is more limited) - and secondly, "but it's full of exploits" - Maybe the interpretter on some platforms gives it power outside the boundries of the language but that is *NOT* the language's fault. Javascript is a tool and has its place and usefulness just like any other tool.
One of the oddities of JavaScript is string concatenation. It uses plus (+) for both concatentation and adding, and this creates confusion and kludges. For example, sometimes you have to say "foo + 0" to force it to "see" foo as a number. Other scripting languages have seperate operators for each. Plus JavaScript has a lousy set of string-handling functions, or at least the earlier versions did. Further, I don't like it's object-oriented tilt feeling that it was just chasing the OO fad stoked by Java, but I suppose this is a personal preference best left to some paradigm war in another place. At least it has user-defined functions.
Table-ized A.I.
Any suggestions for better introductory programming instruction?
What this world really needs is more web pages by 12-year-olds with funny little interactive images and little rainbow sparkly things that follow your mouse around. Thanks, Harold.
If the book's actual target audience is 12ish, I don't really see JS keeping the attention of children.
I also don't think most 12-14 year olds really want an in-depth discussion of programming principals, like the review suggest. I think they'd rather it be fun. That could just be me...
Though it's not free and only works on a couple of platforms, I think Flash and ActionScript are a great way to introduce people, especially young people, to programming. A few simple lines of code can replace the timeline based motion tweening and is a great, visual way to see how your code works. From there kids can add a few lines of code to make sound and images work interactively.
True, it might not turn them into kernel hackers, but most kids would probably more interested in learning to program if it kept their attention. Action script can be very easy with many neat things taking only a few lines of codes but it can grow as your young programmer learns more and seeks more challenging projects.
Otherwise, no need to be training any new programmers.
BC
- It has to be easy to learn and use. In order to build the novice's confidence, it should encourage early successes. It should be easy to debug.
- The tools have to be accessable to the student. Ideally, you want to use a language which is already installed on their computer, or at worse be a free download which will run on all major platforms.
- It has to be practical. If the student can't use it to do something which is useful TO THEM fairly early on in the learning process, they probably won't stick with it.
- It has to provide a good foundation for future learning. This means that it should support all the standard code constructs and have a syntax similar to other more advanced languages. It also means that it shouldn't teach them any bad habits they'll have to unlearn later.
I'm sure there are other qualities, but this is a pretty good starting list. On the basis of this simple list we can eliminate a lot of potential candidates as first language.Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
As many other posters have commented - JS comes "free" with Windows. Just like Basic did way back in my youth with a BBC Micro.
The greatest problem I have with programming today is that it's so damn hard to install the compiler! Java is probably just about the easiest, but you still need to add PATH statments.
XAMPP makes installing PHP as simple as it could be.
The last time I tried to install ANT or GCC or anything even vaugly complicated I had to wade through a hundred different URLs to find the right package, download, install, edit INI files and PATH statement, fiddle with the registry and GAAAAAAAAAAHHHHH!!!!!
We can all agree the JS isn't the best language on the block. But unless it comes in a ready to go package - most people just won't bother.
It's the same thing as Linux ('scuse me while I rant) you spend ages and ages installing and configuring the damn thing when all you wnat to do is work!
Right. Rant over. To conclude - JS bad, installing IDEs and compiles: worse!
If a square is really a rhombus, why aren't all triangles purple?
most program headers start off with something like
if netscape
if netscape3
else
else if opera
if opera5
else
elsif explorer
elseif mac
elseif explorer 5
elseif explorer 5.5
elseif explorer 6.0
else
nothing like a consistant clean language.... and this is nothing like one.
but then java has some of the same problems in some areas
The reviewer makes an excellent point. Programming is a *means to an end*. People don't learn how to program just so they can say they program. To not put the art of learning programming into the context of real-world applications is counterproductive.
Then again, pardon me for being cynical, but this seems reflective of the new type of motivation we have these days behind people choosing vocations. People go to law school, not because they have any interest in law, but because they're under the impression they can make money if they're a lawyer. The bottom line is that if you get into any vocation without having any passion or interest, you'll never be any good at it.
This reminds me of the arguments over which programming language is best. It's moot. The application and environment should dictate which tools be used. Likewise, if you want to learn to program, and don't know for what platform or application you're interested, you're on the wrong track... figure that out before you buy any books.
Most people haven't even figured out how to make a page look good in more than one browser.
See the Any Browser Campaign.
[And I don't mean 'detect what browser they're using, and serve them a page that's specially tailored to their browser', I mean making a single page that is written to the standards, and doesn't look like crap when some new unknown browser renders it]
We know JavaScript isn't good for 'Any Browser', as there are browsers that don't support it -- and it's even frowned upon by the WAI
Build it, and they will come^Hplain.
My real complaints about this book centre on the abstract nature of the discussion
I also have a complaint about the target audience for this book
I also take issue with the title: this book doesn't really teach 'programming' much at all
Yet the book review rates a 5? What gives? I would think a book with more than one "I have issue with" would rate a bit lower than "the best possible rating it could get."
Saying Android is a family of phones is akin to saying Linux is a family of PCs.
Yes, that's just what we need - every Joe, Shmoe, and Harry that surfs the web to start thinking he's hot shit on Sunday because he's a "programmer", and now he can go out and grab one of those elite tech jobs!
Of course, knowing the stupidity of HR, they'll likely get hired.
~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
No seriously.
It's easy, it's pretty, you get a grasp of functions and objects and you can do moderatly complex things pretty quickly which means that they'll get instant gratification.
If you want to introduce them to programming, given them something that can make them go "wow!" pretty quickly. Thats what made those Spectrum BASIC books so good - within 10 minutes you had lots of pretty squares up on the screen.
I'm sure a lot of people would shudder at the though and want their kids to start with C++ or Perl - but I think that it might do more damage than good. No one wants to be scared off by pointers or regular expressions.
Avantslash - View Slashdot cleanly on your mobile phone.
I keep seeing those "Fighter Maker" and "RPG Maker" PS2 games on the shelves. Seems like that would be the thing to give a 12 or 13 year old to get them interested in programming and maybe learn some of it's basics.
[Set Cain on fire and steal his lute.]
Here is a course I helped design to teach Javascript programming to CS170 students-- pre-business majors.
Javascript was our idea of a language replacement for what we were using True Basic. The idea was to have a language where the students wouldn't constantly question why they were learning it, and to pretend like we were doing some level of web enabled e-commerce site programming.
The problems we have found come from the lack of structure of the language, and combined with the browser's desire to fix as much as it can. While this is a nice feature for a real developer, it sucks when you have to tell a student "I know it works on the browser, but it's still wrong."
The other issue is trying to keep to a small set of structures for programming, and making sure the TAs for the course don't get too ambitious with teaching dozens of alternative ways to accomplish the same thing. For students at this level, they just get confused.
But it does work well, and it is nice not having to ask students to buy another piece of software to program with at home. (Unlike True Basic.)
I demand a million helicopters and a DOLLAR!
I began teaching my brother programming with Javascript. I also recommended to my department head that they use Java as a beginning programming introduction.
You need to learn the fundamentals of programming - not necessarily Assembly-level, but something that, upon completion of a beginning course, will be useful and applicable to other languages.
We spent three weeks learning conditionals, loops and case - in my Java course (specifically did not use the word "class" there, for anti-pun reasons...). The prerequisite courses were "intro programming" and another, such as VB. But all but three of students came into the class unable to understand an if-else. My time was wasted, my prof was furious and most students gave up.
You know what they learn in the intro programming class? QBASIC. You know how many people had a clue coming into Java or VB or C++? Two of us. We'd both been programming for ten years (and we were 20) and could teach the class. It was a req. for the major, so we had to take it.
Programming is best learned in front of a computer, with a task to do and a good reference to rely on. If that reference is a book, another programmer or freakin' Google, you can still learn the basics from there. I liked the idea of teaching my brother using Javascript because I could 1 - look at his code, 2 - point him at countless resources, examples, etc. and 3 - demonstrate that even if your code follows the rules, works on your machine and is well commented/indented, it won't work on everyone else's machine.
It won't teach you the inner workings of a machine (previous Slashdot post on Assembly as an intro language) but it will help prepare you for a real internship or at least for a class that will teach you more.
Instant Hacking
KFG
Sure Javascript can be used to teach programming, but if what you do is not at least a bit useful, it won't catch teenagers attention for long. And javascript is quite powerful, even though it lacks some functions that would make it perfect (external file reading, that could be made from the same url as .js file, for security reasons).
Or we con go back to basic, which could be handled on a disk (or CD), so learning to program would be quite easy!!!
Want to learn Manga P2P way? try www.mangaschool.com.
Newer versions of Mozilla have a complete debugging subsystem for javascript. You can step through the code and examine variables. All the fancy stuff that a debugger provides - that too wrapped in a nice GUI.
My other dog is a Wienerschnitzel.
Helps weed out the slackers ;)
This is not the sig line you are looking for... -- Old Jedi Sig Line Trick
Squeak Smalltalk is quite excellent for this purpose, IMHO.
I highly recommend "How to Think Like a Computer Scientist: Learning with Python." It's a great introduction to programming using a language that doesn't get in the way. Python is also a great language for starting procedurally and "graduating" to OO. Besides being a great book, it's available for free in LaTeX, PDF, PostScript, and HTML. Needless to say, both the language and the book are available "using any web browser." As for JavaScript, I have tried to keep it at arm's length for as long as possible.
Where can I download the "Any" browser?
Although it has many of the limitations that something like JS or JavaScript has, I personally think that PHP is a great first language. It does require an installation of the language (unlike JS), but I think that it has better syntax.
I am also far from being a pro, and much of my code really stinks in terms of readability (I am working on it), but speaking from the perspective of someone who had a really rough time with my one programming (we used C) class, I think PHP is better than Javascript for a first language.
"We don't know what we are doing, but we are doing it very carefully,..." Wherry, R.J. Personnel Psychology (1995)
I still think the best language to learn to program for kids (starting around 7) is Logo. Instant gratification, cool animation, you can make impressive patterns quickly and it teaches the basic control structures.
Then, they can graduate to StarLogo, an object-oriented version of logo which is easy to learn, but very powerful. A number of labs are using it for research simulation. Go with the turtle.
that it is free and the license built into the browser allows for development work. There aren't an awful lot of other programming languages/development that can boast this.
Having Javascript already available in the browsers is an advantage because a very great majority of computer tech teachers that I have met have troubles with even understanding the concept of directories and paths, let alone have a snowball's chance in hell of installing something like gcc under Cygwin.
Going off on a personal rant, I would like to see teachers be a lot more scrupulous with respect to licensing software. How seriously is a kid going to take the classroom instruction on not sharing other people's IP when the teacher tells them to download VB, QBASIC or some other clearly copywritten tool into their PCs?
As an added bonus, Javascript is not terrible to program in and you can come up with some good simple client side games. How about Pong, Tic-Tac-Toe, Minefield, Battleship, etc.?
I think that using Javascript for teaching programming is a step in the right direction, but it sounds like this book could have done a better job in making it compelling for kids.
myke
Mimetics Inc. Twitter
Why not choose PHP. It's a very nice language with clear syntax, no need for a compiler, can even be run on Windows, is perfect for the web, and also for scripting. It also has enough in common with C/perl to make it easier to learn these languages (whereas say VBscript is completely foreign). It also has an easy learning curve - it's looseley typed, and gives helpful error messages.
I can recommend the book: SAMS "Teach yourself PHP in 24 hours"
Richard
Hmmm, I assumed that this would be a person who had not done ANY programming.
I too just jump right into a new language. It is mostly just a different syntax. Actually I try to find out what you cannot do in a new language.
Mind you, I had to take a course to learn OO. And I found out that I had been doing OO anyway, just not in a formal sense. Now I find it hard to do non-OO stuff.
- - - - - - - - - - -
I am a programmer. I am paid to produce syntax not grammar. Deal with it.
The most you can do is help a student develop their skill. Skill is something that comes from the way your brain is wired. If you don't have it, no amount of learning will give it to you.
There are a lot of people with advanced degrees and little skill.
Bruce
Bruce Perens.
Anyone who actually suggests that learning programming should be made more difficult to prevent irresponsible use has got to take the cake for elitest bullshit.
I think the Processing tool/language/environment developed by Casey Reas and Ben Fry at MIT is a great place for young people to learn. Its based on Java syntax, but has a very fast and powerful graphics API that lends itself to quickly creating visual sketches in code. Its completely free, has its own environment and compiler that is simple and easy to get started with. The website has plenty of clearly commented examples teaching concepts step by step, a nice reference page with many illustrations of the core functions and control structures of Processing, and a very helpful message board community. Most people creating in Processing share their source code, so if you see something cool you wanna try out yourself (and there is a lot of really cool work featured on the site), its just a matter of reading through the code.
So if you are a more visually inclined novice programmer like myself, in my experience, playing around in Processing can be immensely insightful and rewarding. And a lot of fun.
Yes, Python and a host of other languages can be downloaded for no cost, BUT none of them are provided ready-installed along with the OS on 99.8% of all new desktop/laptop computers today, and with 90%+ of desktop/laptop computers sold over the last 5 years.
With this book and a computer running Win98 or later (can't remember if IE on 95 has JS), or OS X (dunno about earlier versions), the user has all they need to start writing code of their own. No downloads required - hell, they don;t even have to be on-line!
Never mind the 12-13 age group - I'll be giving this to a few 7-8 year olds for birthday and/or christmas prezzies...
This sig left unintentionally blank.
Pretty good book. Covers the C++ language, though it talks an awful lot about UML flowcharts and the like -- okay if that's your style, but for my purposes, farting about with pseudocode and flowcharts is more difficult than writing the damn code in a real language -- at least Applescript, and usually C++.
I just turned 14 and I'm learning C++ as my first language. I don't think it's overly hard, though pointers did take me a few weeks to get the hang of :/. My only gripe is that it's hard to make something that I'll actually use (and thus I sometimes lose interest), because I still don't know how to import/export/create files, and because I wanted to make a few simple games but after seeing some basic OpenGL code I know I'm not going to be doing that for a while (using the tutorials at NeHe I see that I need to write a few hundred lines of code just for a blank screen...).
that takes nothing away from the fact that javascript is a very good language to learn programming on. i learned how to use loops and functions in javascript way before i knew what a compiler was. i say 'YAY!' to the author for an interesting and effective thought.
I write code.
You're right-on there. I wrote an introduction to programming (w/ Javascript as the language) and thought about the IDE / language problem as well. I ended up writing a "Javascript Testbed" for people to use as their "IDE." Although I would have loved to use Java as the starting language, my main prerequisite was a _zero_ barrier to entry.
It all goes downhill from first post