Slashdot Mirror


Learn How to Program Using Any Web Browser

honestpuck writes "Harold Davis has started with a marvelous idea, teaching programming using a language available on all platforms, JavaScript, and an interface familiar to everyone, the web browser. Learn How to Program Using Any Web Browser is written for absolute beginners to learn the basic principles of programming -- or at least that's what the cover would have you believe." Read on for honestpuck's evaluation of that claim. Learn How to Program Using Any Web Browser author Harold Davis pages 396 publisher Apress rating 5 reviewer Tony Williams ISBN 1590591135 summary Not much programming, but well written

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.

20 of 456 comments (clear)

  1. Re:Best way to learn by Anonymous Coward · · Score: 3, Informative

    That's not what the universities would have you believe! Their way is to cram your ass full of math. Give dozens of math courses, with no real integration of ideas between them. Teach no practical applications, and then watch as employers start demanding university degrees for every job, and look at how much enrolling (or even more cult-like: recruiting) the univesities do!
    No, it's not about the money. No, they want to teach you... err.. something.

  2. Re:javascript is horrible by AKAImBatman · · Score: 4, Informative

    I *wish* JavaScript had Java like syntax. I can't count how many times I've typed this:


    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++) //do something with item
    }

    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++) //do something with item
    }

    (For those of you who don't know JavaScript, "i" will be global without that "var" definition.)

  3. Web Browser JavaScript for Beginners? by xxxJonBoyxxx · · Score: 3, Informative

    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.

  4. Re:javascript is horrible by Tablizer · · Score: 2, Informative

    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.

  5. An excellent idea by Tryfen · · Score: 2, Informative

    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?
  6. "Program"? by oneiros27 · · Score: 4, Informative

    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.
  7. Re:Badly titled. by drinkypoo · · Score: 2, Informative

    Mozilla or Netscape Communicator is, in fact, an IDE, as it has an HTML editor included.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  8. Re:Why teach programmers, period by kfg · · Score: 4, Informative

    I know how to program. It is not my trade. It never has been, and, God and the economy willing, it never will be (although I'm not averse to churning out some code for recompense now and again as part of a diversified professional portfolio and just for the change of pace).

    I do, however, find it a useful skill that allows me to use my computer to conduct business, perform scientific and engineering tasks and yes, on occasion, save a lot of money on programs and programers. Saved me from all that Quicken/Quick Books lockout nonsense too.

    KFG

  9. "I'm certain that this one isn't it." by kfg · · Score: 3, Informative
  10. Well, that's XXI century's BASIC by apeine · · Score: 3, Informative

    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.
  11. Mozilla by sl0wp0is0n · · Score: 3, Informative

    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.
  12. Re:Strongly disagree by haystor · · Score: 5, Informative

    Getting help learning Lisp is difficult for someone learning on their own. With no Lisp knowledge, it's hard to pick the right platform.

    For just learning Lisp, the path I took was:
    1. customizing a .emacs file
    2. customizing emacs packages
    3. writing my own emacs packages

    Most of my learning involved looking at someone else's code and trying to figure out how they did something. It's one thing to learn how a java feature like try/catch works by example, but trying to learn Lisp's defmacro by example is a path to madness. For that, Paul Graham's books are essential.

    The one major benefit to learning Lisp is that it can be bent to your will. This may require a change in mindset from C/Java where your spend the majority of your time conforming your will to fit the language.

    Only in learning Lisp have I again relived the "aha!" that came with the learning of a first programming language.

    --
    t
  13. Re:Challenge of finding a first language by Anonymous Coward · · Score: 1, Informative

    Squeak, an modern version of Smalltalk, meets and exceeds your four qualities:

    1. It's very easy to learn and use, and give instant results.
    2. It's a free download that's trivial to install and runs bit-indentical on more system than you can shake a stick at.
    3. It's practical, for it can be made to do very useful things. Only big limit here is that it's not exremely easy to make a stand-alone application with Squeak.
    4. It's completely OO, it's extremely consistant, and it's very simular in concept to more advanced languages.

    Squeak is ideal for kids and people just getting into programming.

    I'm 29. I'm trying to learn programming, but not as a hobby- I want to make two tools that I really want but don't have the money to pay someone else to make. And I've found that Python & Squeak have, so far along with learning some BASH stuff, helped me out a great deal.

    www.squeak.org

  14. Re:How about instead... by Abcd1234 · · Score: 3, Informative

    Squeak Smalltalk is quite excellent for this purpose, IMHO.

  15. Logo by Hollins · · Score: 4, Informative

    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.

  16. Re:HUH? by Kphrak · · Score: 4, Informative

    Yes, VBA is available on most computers, IF the computer is running Microsoft Windows with Microsoft Office.

    Yes, VB teaches beginners. It teaches them that the only system worth coding on is a PC running Windows, because otherwise they won't be able to click and drop their components. The first thing a beginner learns is that they can write programs that look just like the Windows programs (i.e. Internet Explorer, Access, Excel), without first hearing that the reason that they can is that they are, in fact, starting the Windows programs, and that little Access app they wrote using New Application.thisMethod and New Application.thatMethod just called two separate copies of an Office application. And guess what? If you forget to "garbage-collect" (well, really Application.Close), which 99% of beginners do, you won't get a warning of any kind. Rather, the applications will just stay in your system memory, waiting for a close command that will never appear. I've seen programs that could use 200K of memory (large in itself, but livable considering the VB interpreter environment) using almost 128 megs.

    That's just Visual Basic, which is pretty awful unless you're making a demo for your local suit. VBA is much worse; in fact, I think it's the spawn of Satan himself. At least you know when the application appears, because you have to open it to start your program, but since VBA is just macros within the main window, you cannot create menus, and the first thing you get to choose is the color of your window. This has spawned horrors of beginning GUI design such as magenta-colored windows, script fonts, and labels that respond to clicks to bring up more windows, just because programming is a last resort for VB and VBA; the star of the show is the decision of whether to make your font Script or Wingdings.

    This rant should be taken in view of my recent experiences; I have rewritten several programs built by budding VB6.0 programmers in the past few months, each one more horrendous than the last. VB should only be shown to programmers after they have used a programming language, not a set of GUI design macros. Make no mistake, VB is like the cardboard televisions at the local furniture store: for display purposes only.

    --

    There's no sig like this sig anywhere near this sig, so this must be the sig.
  17. Here is a free crossplatform alternative by Anonymous Coward · · Score: 1, Informative

    Sure, it's not packed with fancy crap, but it is simple and easy to learn and no Microsoft Tax!

    http://smallbasic.sourceforge.net/

  18. PHP is a great choice by Richard_J_N · · Score: 3, Informative

    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

  19. C++ as first language... by xenoxion · · Score: 3, Informative

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

  20. Re:That was my first goal by Leeji · · Score: 2, Informative

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