×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Head First JavaScript

samzenpus posted about 6 years ago | from the read-all-about-it dept.

76

stoolpigeon writes "Head First JavaScript is one of the latest entries in O'Reillys Head First series. Like the other Head First books, it takes a somewhat unique approach in conveying information. The stated intent of the series is to help readers learn and retain material by formatting it in a manner that assists in meeting those goals. This means that the book is full of graphics, exercises and humor. There is also a refreshing note on who will benefit from the book. I've pretty much always thought of these sections in books as entertaining, in that I get to see what new way a publisher has found to say, "Everyone should buy this book!". Head First Javascript actually does a decent job of describing who this book will help, and who it will not help. That alone had me intrigued right from the start." Read on for the rest of JR's review.Who is this book for? It is for someone looking to learn JavaScript, with access to a computer and a desire to learn the material through writing code and working through a variety of written exercises. The book begins with the very basics of scripting and as it states, is probably not going to be enjoyed by an experienced programmer who is looking for a JavaScript reference guide. There is a lot of white space, drawings, pictures and opportunities to do the exercises I mentioned as well as the answers to those exercises. For the experienced coder just looking for an api or methods and properties, this will probably feel like a bloated waste of time.

Someone like me on the other hand, who would like to take a JavaScript class but just doesn't have the time, this book was just what I needed. I have done some programming, so I did breeze through some portions of the book, but in others I didn't mind the review. I like having new information and ideas soak in over time. This book is paced just for that kind of learning. It is possible though for someone to be too new to the topic. Some understanding of html and css would really be helpful. Someone who doesn't have at least an idea of how those technologies work may struggle a bit. Though I would think a little time with google would provide everything necessary to be up to speed.

There is an 8 page introduction that explains the reasoning and methods behind the books approach. The "Read Me" portion gives some great insight into just what this book is like. It begins, "This is a learning experience, not a reference book." and follows that up with seven main points. To summarize them, the book teaches what someone needs to know to get up and running. It is not exhaustive, it does not go over the history of the language. There are many finer points not addressed. Using multiple browsers would be helpful to the reader working through the book. Skipping activities will greatly reduce the value of the experience. There is quite a bit of redundancy, it is on purpose and beneficial. The examples are as slim as possible to focus on what matters and finally, not all exercises have definitive answers. If any of that turns your stomach, this really may not be for you.

The format does pretty much make reading straight through the book without working the exercises a waste of time. This was my biggest challenge with the book. If I wanted to read it I needed a pencil, my laptop, free time and somewhere I could work through at least a whole exercise at a time. This wasn't something I could fit in 20 minutes a night before bed. The authors recommend making it the last thing read before bed, but the end of my days are too busy to fit an exercise in. I found that a lunch hour, or a quiet week-end afternoon were my best opportunities for learning.

When I found those times, the book was thoroughly enjoyable. The humor was corny at times but almost always funny. I even chuckled out loud more than once. The exercises are widely varied as are the interspersed scenarios and stories that accompany the examples. I downloaded the necessary images for examples from the books web site though I avoided using downloaded code. It caused more errors due to typos, but I felt like I did better typing in the examples myself. I enjoyed working the cross-word puzzles and reading the 'interviews' with various pieces of technology. The time invested was much greater than for any other tech book covering similar ground, but I felt like the return justified the added time.

The style and humor reminded me quite a bit of the Dietel and Dietel How to Program books. I think that the scope is similar as well, as far as beginning from the very basics and building with each chapter. Head First starts with a basic description of just what JavaScript is and what it adds in the form of interactivity and finishes with a chapter that gives a good introduction to Ajax. In between the reader learns about all the basics like variables, looping, user input, validation, control flow, functions, code reuse, objects, etc.

As a hobbyist I felt like this was a great introduction to JavaScript. I think it gave me a foundation to build on and the ability to use more of the materials freely available on the web. Sometimes there is just so much of that out there, that it is difficult to know where to start. One of my primary goals in reading this book was to put together a couple simple web apps for myself as well as to get a better understanding of using the DOM for some Firefox plugins I would like to write. This book met those needs.

I think it is good to mention though, one last time, this is not a no-nonsense reference manual. In fact there is lots of non-sense and it is actually quite a bit of fun. But if the idea of 2 or 3 pages of big pictures to get across a couple simple ideas about data types bothers you, don't spend the money on this book. It will just annoy you and you will probably feel ripped off. On the other hand, if you've picked up hefty programming manuals and found that you didn't make it a quarter of the way through, and didn't remember much of the quarter you did finish, this approach may be much more friendly and give you a taste of success. And what good is a more information dense book if you don't read it or learn from it?

The table of contents gives a short summary of each chapter and a breakdown by section. The section titles are good for finding a place you read or stopped but wont always help find a topic. They are often named with the name of the exercise, not the subject they address. The index is good though and will help quickly track down topics. Like many new O'Reilly books, this one comes with 45 days free access to the electronic version of the book on Safari. The books site, linked above, has the table of contents, index, code examples and the complete second chapter available for viewing and/or download.

You can purchase Head First JavaScript from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

76 comments

ANyone who needs... (-1, Troll)

Anonymous Coward | about 6 years ago | (#22870718)

... And entire book just to learn good javascript isn't worthy of any programming/web design job.

Re:ANyone who needs... (4, Insightful)

Millennium (2451) | about 6 years ago | (#22870788)

Anyone who isn't willing to do whatever they need to do to learn good JavaScript isn't worthy of any programming/web design job. Even if that means using a book.

Re:ANyone who needs... (4, Funny)

techpawn (969834) | about 6 years ago | (#22870964)

Anyone who isn't willing to do whatever they need to do to learn good JavaScript...
Well... there IS a limit *wipes mouth*

I agree though, sometimes there's a new trick that you never though of in a book and it's always nice to have a reference library that doesn't rely on Google.

Re:ANyone who needs... (0)

Anonymous Coward | about 6 years ago | (#22871356)

Home Depot offers a discount on knee pads for IT workers. Go check it out.

Re:ANyone who needs... (1)

The_reformant (777653) | about 6 years ago | (#22871538)

Anyone who isn't willing to do whatever they need to do to learn good JavaScript isn't worthy of any programming/web design job
I hope you meant any Web programming job. Some people still write applications which don't run in a web browser.

Re:ANyone who needs... (5, Insightful)

larry bagina (561269) | about 6 years ago | (#22871114)

Javascript (and php, vb, etc) gets a bad rap from copy/paste "programmers". You could read the ecma specification and mozilla has adequate documentation, but using google as a tutor is a lot like digging through a septic tank in the hopes someone shit a quarter.

Re:ANyone who needs... (1)

zullnero (833754) | about 6 years ago | (#22872628)

However, there is a considerable difference between a script kiddie looking for a chunk of code that performs a particular task then copying and pasting it in and someone looking for an api reference or examples to see if they're maybe not thinking of doing something in a totally back-asswards way.

But hey, it sounds like a better soundbite when you talk about shitting a quarter.

Re:ANyone who needs... (0)

Anonymous Coward | about 6 years ago | (#22875398)

there is a considerable difference between a script kiddie. . . and someone looking for an api reference or examples

You could read the ecma specification and mozilla has adequate documentation

Your indignation is simply amusing, in the face of a perfectly sound counterargument that exists in the very post you were replying to.

Re:ANyone who needs... (1, Informative)

Anonymous Coward | about 6 years ago | (#22873896)

It seems that this book won't help with the copy and paste programs you get all over the net. Looking at the sample code they seem to focused on the DOM rather than the language itself, and they use plenty of DOM0 (i.e. non-standard) methods and use "</" in places which should actually close the script block in a standards compliant browser. There isn't anything that really exploits the OO features of ECMAScript and shows you how to write a properly structured program.

I think that its a lack of understanding about the powerful ECMAScript features (such as scope chains and prototype based inheritance) actually works that leads to things like prototype.js, which is just a drain on physical resources (not that many people care) without any really useful features.

Re:ANyone who needs... (1)

larry bagina (561269) | about 6 years ago | (#22875750)

That sample chapter reminds me of second grade.

There's a lot of cool (and powerful) things, but I wonder if there's a book that delves into it.

When it comes to programming... (1)

v(*_*)vvvv (233078) | about 6 years ago | (#22879068)

There is often one best way of doing something. That is the gist of the argument against software patents.

Google is a great tool for finding that one way if you know how to use it. Reference docs provide no shortcuts, and can often mislead learners into an abyss of trial and error, often ending in hacks that just barely get the job done.

Re:ANyone who needs... (0)

Anonymous Coward | about 6 years ago | (#22871120)

Yes, the sane choice for any business needing some of their employees to learn javascript is to have them invent the proverbial wheel instead of reading a book. You, sir, are clearly a mastermind when it comes to corporate investment.

Head First! Apply Directly to the Javascript! (5, Funny)

spun (1352) | about 6 years ago | (#22870720)

HEAD FIRST! APPLY DIRECTLY TO THE ow! OW! Why are you all throwing things at me?

Re:Head First! Apply Directly to the Javascript! (1)

Bucc5062 (856482) | about 6 years ago | (#22870830)

This was the best laugh I have had in a while. If I had mods I would give +5 funny.

Still Much Peferable... (4, Funny)

Jeremiah Cornelius (137) | about 6 years ago | (#22871016)

to "ass-first" JavaScript.

Supply your own bag and hose...

Re:Still Much Peferable... (1)

Dogtanian (588974) | about 6 years ago | (#22872884)

to "ass-first" JavaScript.
Well, since we're talking about body parts, I assume that O'Reilly put a guy on the cover this time because of the infamous case where the "Head First Design Patterns" model [pastiche.org] also turned out to be advertising a cream for itchy girly bits :-6

Re:Still Much Peferable... (2, Funny)

BollocksToThis (595411) | about 6 years ago | (#22874554)

Judging by most of the websites I visit(/endure), Ass-first Javascript is the freakin' industry standard.

Not a fan (2, Interesting)

LeonardsLiver (885268) | about 6 years ago | (#22870854)

of the Head First books. I tried Head First Java, and Head First OO Analysis & Design. I found them so silly they distracted me from learning the material. Give me a concise, dry book like K & R... or for JavaScript, the "Definitive Guide" any day.

Re:Not a fan (3, Insightful)

moranar (632206) | about 6 years ago | (#22870968)

Why try two of them? It's not like the style differs from one to the other. Plus, it's clearly stated in the first pages what the style will be (or you can infer it from the text anyway), and that the books are not meant as references like "Javascript, the definitive guide" is.

Seeing how every O'Reilly book has a free chapter for download at the website, I don't think there's any excuse to feel ripped off, even when buying from a digital store, where it is harder to check the book (not that I imply this is your case).

Re:Not a fan (3, Insightful)

DaveV1.0 (203135) | about 6 years ago | (#22871078)

Different strokes for different folks.

This is why I always advise people looking for a book on a computer topic to pick up two or three from different publishers and read a little bit of each one. That way they get a feel for the tone of the book and can choose the one that fits best with them.

Re:Not a fan (2, Informative)

CRCulver (715279) | about 6 years ago | (#22872312)

I agree. All the whizbang graphics and jokes in the Head First books don't translate to more efficient learning. The most friendly language tutorial I've ever seen is Mark Pilgrim's Dive into Python [amazon.com] , which with its simple typesetting initially seems dull as dishwater, but which is excellently worded and combines friendliness with rigour. A pity O'Reilly never commissioned Pilgim to come abroad and write more resources for developers.

Re:Not a fan (1)

element-o.p. (939033) | about 6 years ago | (#22873016)

I haven't tried the "Head First" books, but the concept sounds a lot like the "Dummies" books, which I really didn't like. There is a fine balance between being friendly & approachable and taking far too long to finally get to the point. I always thought the "Dummies" books were on the "too long to get to the point" end of the spectrum, and therefore usually picked the "Sams Teach yourself...in 24 Hours" books, instead.

How do the "Head First" books compare to the "Dummies" and "Tech Yourself" books?

Re:Not a fan (1)

chromatic (9471) | about 6 years ago | (#22874244)

How do the "Head First" books compare to the "Dummies" and "Tech Yourself" books?

Head First books tend to be technically accurate.

Re:Not a fan (1)

DuckDodgers (541817) | about 6 years ago | (#22877932)

The Dummies books breaks the information into tiny chunks and feeds it to you at a sixth grade reading level, give or take. There are graphics and pictures, but they're almost all simple illustrations of concepts.

Head First tries to make things interesting by using funnier images, plays on words, puns, and pop culture references (mainstream stuff, not obscure) to get your attention. Every few pages they also include a creative quiz or simple programming exercise to test your knowledge. The examples are also a little bit more oddball, like beer selection programs or a program to transfer more money to the authors.

They make it clear at the start that the books are not intended as reference manuals. They're also more annoying than useful if you're already moderately comfortable with the subject material. But for someone totally new to the subject, I think they're good. I definitely don't regret buying Head First Servlets and JSP, it was extremely useful to me.

Re:Not a fan (1)

theshowmecanuck (703852) | about 6 years ago | (#22874580)

I wish there was something in the middle. I agree that the head first books are a bit over the top. But they seem to be accurate. On the other hand, I can't stay awake for more than 10 or 15 minutes when I read something like, say, the gang of four book. It's like having Henry Kissinger as a professor when you have a hangover and two hours of sleep.

Re:Not a fan (1)

kaens (639772) | about 6 years ago | (#22875468)

I agree. I used to turn to books like the sams "Teach yourself" series, or spend time on a language tutorial on the web, but nowadays I just want a good reference material. I don't need chapters explaining what variables are or what loops are anymore - I need a language reference, and I don't really want any fluff in it.

The exception is when the language is outside of the "normal" programming paradigms, or really syntactically different, in which case I probably want a more gentle introduction.

Re:Not a fan (1)

gmiley (975720) | about 6 years ago | (#22876518)

I would tend to agree, the "Definitive Guide" DHTML reference manual is one of my favorite and most used books in my collection for doing just about any client-side web programming. If I could find a book like that for every programming language I would own them all. Although those manuals are not for everyone, since I have turned some people I work with on to that one, they too use it constantly and swear by it just as much as I do.

Can't get on with cartoons (1)

youthoftoday (975074) | about 6 years ago | (#22870952)

Doing a course on design patterns last semester we were directed to the Head First Design Pattern books. I refused to open it as a matter of principle so I can't vouch for the quality. It's just impossible to concentrate with all that noise on the page.

Instead I went straight for the G.O.F. book (the canonical book for design patterns) 'and never looked back'. I don't think I could have got that kind of understanding with cartoons and colour.

I would really like to know who reads these?

Re:Can't get on with cartoons (1)

CastrTroy (595695) | about 6 years ago | (#22871074)

I guess it's kind of like that little windows XP search dog, and clippy. It doesn't really make the product work less well, but it's kind of demeaning to have a little cartoon character pop up and guide you through the process.

Re:Can't get on with cartoons (1)

Dogtanian (588974) | about 6 years ago | (#22872932)

I guess it's kind of like that little windows XP search dog, and clippy. It doesn't really make the product work less well, but it's kind of demeaning to have a little cartoon character pop up and guide you through the process.
I'm not the first to mention this, but what makes it really bad is the fact that you tick the box saying "No, I don't want that ******* animated dog", and to mark this choice they show an animation of him running off anyway!

Re:Can't get on with cartoons (4, Insightful)

Mongoose Disciple (722373) | about 6 years ago | (#22871094)

I actually mostly like the Head First Design patterns book. There is a lot of noise there, but they do a pretty good job of explaining the patterns and illustrating cases in which you'd want to use them. Most of the developers I've worked with could benefit from it -- the only thing worse than a developer with no exposure to design patterns is one for whom a small selection of patterns is a hammer and everything looks like a nail.

I have the Gang of Four book also as a reference manual, but it is just that. I would say that trying to read it straight through, to me, is like trying to read a dictionary, except I honestly consider a good dictionary to be much more approachable. It's a book I have handy because it's the definitive work, not because it's easy to read or the best way to learn the concepts.

don't buy it (2, Insightful)

acidrain (35064) | about 6 years ago | (#22872402)

I have a copy of the previous version of this book and as a senior engineer I found it terrible. It's targeted at people who need to be coddled into thinking about simple technical things, and that coddling (read: stupid jokes and silly pictures) just gets really annoying when you are actually in the mood to read useful information. The JavaScript "nutshell" book is an amazing reference however, in that it gets right to the point and doesn't gloss over useful details. It is hard to believe they were printed by the same publisher.

Re:don't buy it (1)

notamedic (1236734) | about 6 years ago | (#22875138)

But you're a senior engineer, the book isn't targetted at you. I've worked with people who are totally new to programming and the Head First books are great for them to get started with and then you buy them one of the dry (and frankly dull) Nutshell books that are great once you know what you're doing.

Re:Can't get on with cartoons (3, Insightful)

mysqlrocks (783488) | about 6 years ago | (#22871162)

Doing a course on design patterns last semester we were directed to the Head First Design Pattern books. I refused to open it as a matter of principle so I can't vouch for the quality. It's just impossible to concentrate with all that noise on the page.

I used the HFDP book to teach a class on design patterns and it was a great resource. I'd recommend it over a dry text book any day. My take is that most people who dismiss the HF books are intellectual snobs who think if learning isn't painful it means you're not learning. The HF books are based on solid learning principles and, IMHO, they work.

Re:Can't get on with cartoons (0)

Anonymous Coward | about 6 years ago | (#22871578)

I agree, as am instructor I like the books, unfortunately I find that my students hate them. Really too bad, since the little notes that they make in the margin are exactly the sorts of things I say to my students all the time.

Re:Can't get on with cartoons (1)

youthoftoday (975074) | about 6 years ago | (#22871734)

I'd be the first to agree that it is partly intellectual snobbery. But *only* partly.

As an educator you know about 'learning styles' (or whatever they're calling it this week). I wouldn't hand in a piece of work with pictures of dolphins swimming through the paragraphs, every fourth word in blue, and with the first line of every paragraph highlighted except for vowels. Partly because it would be tricky in LaTeX but mainly because it would be impossible to read and detract from the content (at least, to my eye).

It may be caricature of HF books, but it's not that far off.

I'm sure a lot of people find the HF style fun and approachable. But as a student, if you can't approach a dry text book (pain or no pain) then ... well. Also GOF isn't *that* dry...

Re:Can't get on with cartoons (3, Informative)

edalytical (671270) | about 6 years ago | (#22871988)

AFAIK, the HF Java book is used for the Data Structures course a UC Berkeley. If it's good enough for Cal students, it should be good enough for anyone.

HFDP is a disaster for teaching (0)

Anonymous Coward | about 6 years ago | (#22874500)

I used the HFDP book to teach a class on design patterns and it was a great resource.

That doesn't say much for the quality of your students. (I'm a CompSci lecturer too.)

I made the mistake of buying HFDP, thinking it might have some updates on GoF material, but it was a disaster on all fronts. The greatest indictment of all is that HFDP teaches nothing. Instead, it makes students go through the motions of finding a solution, and hopes that they find the gem of insight desired among all the noise. Well that's a very haphazard teaching method, and even an IQ 200 student can miss the point through distraction. The lack of precision and focus (and *pride* in it, jeez) is just distressing.

If you foist HFDP on your students, please ensure that they have GoF on hand as well, not as an option. HFDP works as use case development, but the use cases it makes are a total shambles, and GoF is needed to sweep away the mountain of crap.

And no, your point about snobs is a total straw man. The HF approach is simply ineffective teaching, except possibly for the 3-minute attention span brigade, who shouldn't be doing CompSci anyway.

Re:Can't get on with cartoons (1)

kaens (639772) | about 6 years ago | (#22875512)

My take is that most people who dismiss the HF books are intellectual snobs who think if learning isn't painful it means you're not learning.

That may be true for some, but I'd suspect that most of the people that dismiss the HF books are people who are already fairly familiar with the software engineering / computer science / programming domain.

Personally, I haven't read any of them, but I suspect that I would get a lot less out of them than a reference material at this point. 5 years ago, this would be a different story.

Maybe I'm wierd (3, Insightful)

scubamage (727538) | about 6 years ago | (#22870954)

I love the head start books from a purely learning perspective. I've reccomended Head First Java and Head First Design Patterns to at least 5 people so far who are just getting their feet wet with programming, and if this book runs along a similar vein I can imagine it makes a great FIRST book. Obviously these aren't good reference books, but they make it easy and pretty fast to get the basic material across for people who don't like the lack of personality in traditional "Learning XXXXX" books. I may have to check this out.

Re:Maybe I'm wierd (2, Informative)

crosstalk (78439) | about 6 years ago | (#22871308)

I like the HF books as well, Even the head Rush books have been good. The head rush ajax book was very well written. and helped show how some of the basics worked. The cartoons and color and everything kept me interested. In my team here we use them pretty heavily, as there is no formal education here.

Re:Maybe I'm wierd (1)

teabag_46 (1106783) | about 6 years ago | (#22874828)

Well, if you're wierd, then I must be too! I got the Headfirst Javascript book; and then because I learned well from it, I went out and bought the Java book too. They must just both suit my sense of humour, and preferred learning style. As acomparison, I've looked at some of the 'For dummies' books in the past, and chucked them out, 'cos they were just crap,and had so much waffle in them, that you didn't actually learn anything, the HF books are different,as is only to be expected from O'Reilly.

They start out good, then get tiresome (1)

Octorian (14086) | about 6 years ago | (#22871238)

I tried reading the Head First book on Design Patterns due to a friend's suggestion a while back. I'll have to admit that the first couple chapters tend to unfold pretty well. They present the information in a way that doesn't make any assumptions and is quite accessible to someone new to the material.

However, once you "get it", the style becomes increasingly tiresome. After a while you just want the damn information, not some cartoony scenario that dances around the issue before *finally* getting to the point. You then say "I'm not an idiot, I'll just go get the real book on this subject." In other words, their style works well for the first few chapters, but not for a whole book.

Re:They start out good, then get tiresome (0)

Anonymous Coward | about 6 years ago | (#22875998)

After a while you just want the damn information
With "Head First Design Patterns", I just want the cover. That chick is hot...

beware the index (1)

virchull (963203) | about 6 years ago | (#22871374)

I used the HeadFirst HTML book a couple years ago, and found it very helpful. I think and learn visually, so the pictures etc., helped me learn and retain the concepts. However, the index was a big problem, and O'Reilly's disclaimer about the index and references should be taken with a grain of salt. Well learned concepts don't write much functioning code. A good index is necessary to get back to that concept page and look at the syntax, etc. The HTML book caused me to waste a lot of time (leafing through pages 1 by 1) as I tried to get functioning code on new projects (not in the book), even though I have another HTML reference book. Very recently, O'Reilly emailed out an expanded index section to the HTML book. It seems that others have encountered the same problem. Before I buy HeadFirst JavaScript (which I may), I will give the index section a thorough checkout. I don't want to waste time again.

Javascript? (0)

Anonymous Coward | about 6 years ago | (#22871492)

Javascript? I take it that's head first... against the wall?

Not a good fit for me (1)

SageMusings (463344) | about 6 years ago | (#22871688)

I found the "Head First" series to be a bit of a bore. I read half the one on design patterns (borowed it from a co-worker) and thought it a little "silly". This method of learning may be just what some people need. Other's (most?) would want something more traditional.

I really applaud the effort and like to see new modes of learning experimented with, however.

Work of the Devil(tm) (3, Funny)

Toreo asesino (951231) | about 6 years ago | (#22871722)

For those looking to shorten their life-span due to stress; program in JavaScript over HTTPS with URL rewriting.

Satan would be proud.

Damned Safari. (2, Interesting)

SanityInAnarchy (655584) | about 6 years ago | (#22871744)

I'll gladly pay as much for a simple, un-DRM'd PDF as I would for a physical book.

What I don't like is this 45 days free access to some HTML/Javascript monstrosity intended to allow you to read the book (in a standard web browser, no less) without downloading it. And then they have the gall to offer you PDF downloads of a few chapters every month you're subscribed -- yeah, I'll finish the book in less than a month, so that's way too slow, and the single gigantic PDF I pirated was easier to manage and search through.

I'll take the Pragmatic Programmer approach over this any day...

Here's how it works instead, now: The company buys the book, often a hardcopy if there's no decent electronic version. Then we go out and find a PDF version to pirate and share on the local network. It's a small company; it's not as if all of us are going to be trying to read the book at once, but it's much better to simply search through a PDF than to have to go read the index...

Re:Damned Safari. (1)

jsebrech (525647) | about 6 years ago | (#22874220)

What I don't like is this 45 days free access to some HTML/Javascript monstrosity intended to allow you to read the book (in a standard web browser, no less) without downloading it. And then they have the gall to offer you PDF downloads of a few chapters every month you're subscribed -- yeah, I'll finish the book in less than a month, so that's way too slow, and the single gigantic PDF I pirated was easier to manage and search through.

My company got me a safari subscription, and I must say I've been really satisfied with it.

Upsides:
- Thousands upon thousands of solid tech books. If I want to learn about a subject, they have a good book on it.
- Instant access (I don't have time to run to a book store every time I need to read up on a subject.)
- Full text search, through their entire library of books (way better than searching pdf's).

Downsides:
- At times it's slow
- Not possible to copy and paste text.

All in all, Safari's a good deal, for me at least.

Re:Damned Safari. (1)

Star Stealing Girl (586833) | about 6 years ago | (#22875108)

Actually, you can copy the text from some books to paste elsewhere. There's a toggle at the top between Fidelity View and HTML View. For the books that allow HTML view, you can highlight and copy the text in that mode.

Re:Damned Safari. (1)

SanityInAnarchy (655584) | about 6 years ago | (#22877092)

You forgot "Requires Internet access, all the time."

And while searching through all books might be nice, I generally know which book I want to be looking in, if Google isn't helping. And within one PDF, KPDF's search, at least, is far better than Safari's.

I found it helpful (3, Informative)

Nerdposeur (910128) | about 6 years ago | (#22871864)

I have also read (most of) Head First Javascript, and at the beginning of it, I fit the description of their ideal reader: knowledge of HTML and CSS, no programming experience.

I bought Headfirst JS at the same time as O'Reilly's "JavaScript: The Definitive Guide," which I've hardly cracked due to its dull style and assumption that the reader is already familiar with other languages. The difference between the two for a beginner is night and day - although of course they serve different purposes.

The way they explain things may seem childish at first, but it makes things memorable, and the times when I did the "busy work" of filling out crosswords of terms and penciling in missing code in examples were the times I learned the most.

For example, in explaining data types, they have you circle items in a drawing of a city street and tell what kind of data type would represent them: boolean for a car's blinker, string for the title of a shop, number for a 3-way traffic light. The concept of data types had not been clear to me in The Definitive Guide, so I appreciated HFJS's approach of representing real-life information as data types.

A few concepts seemed unclear at first - like the difference between writing a function and actually calling it - but overall this is a very helpful introduction to Javascript, and fairly painless to read. Once you get the basics, other books would be better for reference.

Re:I found it helpful (1)

grahamd0 (1129971) | about 6 years ago | (#22874212)

I bought Headfirst JS at the same time as O'Reilly's "JavaScript: The Definitive Guide," which I've hardly cracked due to its dull style and assumption that the reader is already familiar with other languages. ...snip... Once you get the basics, other books [than Head First Javascript] would be better for reference.

You're going to be really glad you bought that Definitive Guide in a year or two. It's (IMHO) the best reference for javascript out there.

I recommend reading up on the work of Douglas Crockford [crockford.com] and John Resig [ejohn.org] when you want to get into more advanced javascript.

Re:I found it helpful (1)

siDDis (961791) | about 6 years ago | (#22875030)

You're absolutely right! I have both books and the HF Javascript book is great for the beginner, and once you're done with it the The Definitive Guide is just a fantastic book to evolve your skills with. I would also recommend a third book called Pro Javascript Techniques by John Resig which is an exellent book for when your JS application becomes several kilobytes and you need some structure. Object Oriented Javascript is great ;)

Re:I found it helpful (1)

grahamd0 (1129971) | about 6 years ago | (#22876388)

Yeah, I read Pro Javascript Techniques as well. There's nothing in it that you can't find on the web, which is I why usually don't recommend it, but it definitely has a lot a valuable information and practical examples for folks who prefer to have a physical book.

Re:I found it helpful (1)

siDDis (961791) | about 6 years ago | (#22880060)

The thing I like about books is that you sometimes come over topics about stuff you never thought about. For example the Pro Javascript Techniques book has a chapter about Canvas/Graphics programming in Javascript. I didn't know about that before I actually read about in that book :)

It's pretty cool to be able to render graphics from javascript so you can keep the amount of requests loading a website to the minimum. I guess it's awesome for game programming in Javascript also :)

Re:I found it helpful (1)

kaens (639772) | about 6 years ago | (#22875578)

Hell yes on all suggestions.

Kids, if you know a few programming languages already, don't learn javascript from the web unless it's from Resig or Crockford. Buy the definitive guide (or pirate it if you can't afford it). Most of the web tutorials for javascript are really really bad.

Fond of the Head First books (2, Interesting)

mello151 (1262770) | about 6 years ago | (#22871890)

I read "Head First Java" back in college and have been reading "Head First Design Patterns" here lately. They're some of the only books on programming that don't put me to sleep.

Javascript vs LISP? (1, Interesting)

Anonymous Coward | about 6 years ago | (#22872140)

I've heard Javascript is actually quite powerful and in some ways very LISP-like. In what way is Javascript LISPy? Anybody ever use it outside of a browser environment?

-ec

Re:Javascript vs LISP? (1)

Tangent128 (1112197) | about 6 years ago | (#22872410)

It supports the basic functional programming stuff- closures, for instance. You can define a function within a function, return it, then call it anonymously. Like such:

function generateAdder(incr) {
function add(oprand) {
return incr + oprand;
}
return add;
}
alert(generateAdder(2)(3)); // Pops up "5"
alert(generateAdder(20)(3)); // Pops up "23"

Re:Javascript vs LISP? (1)

larry bagina (561269) | about 6 years ago | (#22872680)

functions are objects, so you can pass them around, return them, create anonymous functions, etc.

Firefox/Mozilla/SpiderMonkey have been adding functional Array functions (as have opera and safari).

eg:

[1,2,3,4].map(function(x){ return x * x; }); --> [1,4,9,16]

[1,2,3,4].filter(function(x){return x & 0x01 == 1 }); --> [1,3]

(Of course, implementing themself for ie or older browsers can be done in ~4 lines of code).

Re:Javascript vs LISP? (1)

Ambidisastrous (964023) | about 6 years ago | (#22878754)

It doesn't have Lisp-style macros, but it does have eval, lambda (a.k.a. function), map, etc. Functions are first-class values. Typing is dynamic, with optional static declarations and a variety of exciting scoping declarations. Closures work. Last I heard, call-with-current-continuation will not be available per se, but there will be a nice range of flow-control constructs. Maybe continuations and coroutines; not sure. History: Javascript was originally written by Lisp hackers.

This review didn't specify whether Head First is written for Javascript 1.7 or the upcoming 2.0 (ECMAScript 4.0), which annoys me, as the latter is much more exciting. I'm pretty much holding out on really delving into Javascript until v2.0 is released... that seems to be the point where the designers really got it "right".

The two noncommercial standalone interpreters I'm aware of are SpiderMonkey and Rhino. Unfortunately the urge to use Python for any productive scripting is too much for me to resist, so I've mainly played with Javascript via Greasemonkey scripts. There, I found it to be about as easy to use as Python, but with everything slightly kludgier (e.g. "Foo".toLower() instead of "Foo".lower()).

WTF Good Grammar in a SL Review!? (1)

cromar (1103585) | about 6 years ago | (#22872602)

Very well written, concise review. Bravo! One of the most well written and informative reviews I have seen on here. Kudos for speaking English well and being able to organize your thoughts ;)

Bonus points for not summarizing each chapter and/or being redundant.

Wrong term (1)

BenoitRen (998927) | about 6 years ago | (#22876044)

some Firefox plugins I would like to write

It's extensions, dammit! Or add-ons. I'm tired of seeing people use the wrong term.

Re:Wrong term (1)

ElAurian (133656) | about 6 years ago | (#22877284)

Kudos to you, sir. You pick your battles well.

Now, for mis-spelling damnit, I'll have to take your eyes. You understand.

JS does not make me chuckle!! (0, Troll)

v(*_*)vvvv (233078) | about 6 years ago | (#22879122)

Javascript is truly complex when it comes to cross-browser compatibility and object management. The ambiguity of type in the syntax is also horrible, and the handful of built-in functions needed workarounds until recently (most notably date related functions).

For the web I would avoid javascript wherever possible. If you want to do anything serious on the client use FLASH. If you want to pickup AJAX tricks then buy a book on the topic, not on JavaScript.

If you feel the need to buy a book like this then you probably aren't getting the most out of google, or looked into server-side scripting yet. Which is a shame, because starting with js is definitely the wrong foot. You'll end up learning a ton of language specific quirks and hacks that are useless elsewhere, and will end up with the impression that half of everything is broken, or that they cannot be done. Try PHP. Java is even easier than JS.

Anyone with a clue knows that beyond simple mouse-overs, libraries like this [aculo.us] are the way to go. Any book that states otherwise is FYE: For your entertainment only.

Re:JS does not make me chuckle!! (1)

Lincolnshire Poacher (1205798) | about 6 years ago | (#22879814)

> Javascript is truly complex when it comes to cross-browser
> compatibility and object management.

That's not Javascript's complexity, that's the DOM.

{Java|ECMA}script is an elegant language that can implement just
about any programming paradigm that you desire ( functional,
OO, AO, procedural... ).

``Cross-browser compatibility'' has nothing whatsoever to do with
the ECMAScript spec. Here I am, executing some commands in the
see-shell interpreter. I see no complexity.

Re:JS does not make me chuckle!! (1)

v(*_*)vvvv (233078) | about 6 years ago | (#22882776)

Obviously you are beyond the targeted skill level of this book if you are using javascript for shell scripts. I have heard good things about javascript for shell scripting, but that is not what this book is about, nor is it how most people are forced into javascript.

To most people and most authors of books such as this, javascript equals client-side web programming. Just look at the cover of the book [amazon.com] . "Slicing and dicing HTML" is easier, simpler, and faster if done on the server. Those things usually matter.

Sure you can blame the DOM, but the environment in which you are forced to program has just as much to do with the task at hand, and the use cases of the language in question. The sad reality of client-side javascript is that you cannot trust the code that you write. That is a very serious problem.

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...