Remember your basics!

written by Tobie on January 27th, 2007 @ 12:52 PM

Using a JavaScript framework is great. Knowing JavaScript is better!

After working on the documentation for Prototype’s new website, I spent a little more time then usual hanging out in the Prototype IRC channel. Some of the questions that popped up where clearly due to a poor understanding of JavaScript rather than of Prototype. Now, that is fairly understandable, Prototype and script.aculo.us (both libs share the same IRC channel) are great tools to play with - and you do get amazing stuff working really quickly. But if you want to dig deeper - or not pull your hair off when something goes wrong - you have to know your basics.

First step: learn JavaScript.

And I mean, know it inside-out!

For a nice tour of JavaScript and a good introduction to the Prototype Framework check out Amy Hoy’s JavaScript Bootcamp Slides.

There’s also a lot of very useful information on Mozilla’s Core JavaScript Reference and on PPK’s Quirksmode. If you prefer paper, O’Reilly’s JavaScript, The Definitive Guide is a must have.

Finally, if you want some best-practice advice, you can also check-out my JavaScript quick-tips.

Second step: learn CSS and HTML/XHTML!

Seriously, if your don’t write standard compliant CSS and HTML/XHTML, you’re going to get some bizarre things happening, debugging will be nightmarish, and you won’t be able to blame anyone but yourself!

If you don’t know anything about web standards, the place to start is most probably A List Apart. In particular, check out the following articles: Better Living Through XHTML, How to Read W3C Specs and Separation: The Web Designer’s Dilemma.

Whenever someone complains about a strange bug, either on IRC or on the Prototype mailing list, nine times out of ten, it the markup that’s to blame. Do yourself (and others) a favor. When something goes wrong, validate your markup! That’s often all you need to do. (And if your smart, you actually do that before things start going wrong!)

Third step: learn how to program!

Yes, that might sound surprising, but programming by coincidence won’t get you very far with modern JavaScript frameworks. The days of copy/paste browser scripting are over. Better get that straight right now! If you don’t know anything about programming: do some reading, research, google, whatever, but do what it takes to get there! You won’t regret it!

Dear reader, if you have any good references to complete some the above, let me know. Which books are right next to your computer when you work ? Which websites are open in your browser while you code… Where and how did you learn all that you know ?

Comments

  • Roots
    Roots says:

    I gave some advice to a friend the other day (she’s been talking and talking about wanting to learn some basic programming for eons) .. told her to just pick ONE simple thing .. do a “hello world” echo in PHP .. even sent her some code to help her accomplish this .. it was a small confidence booster for her and she’s now happy to feel that she’s a budding programmer .. I use the same technique for myself .. doing it now with javascript (which I’m weak on) .. anyaway, thanks for the helpful tips and nudge in a sensible direction !

    Tue, January 30 at 06:57 AM

  • Wilfred Nas
    Wilfred Nas says:

    One thing I am doing lately, is writing js code in a library (which is jquery for me), but before that writing it in plain javascript. This makes maintance more easier as I include the original code in comments. It helps me organize my thought better while writing and lessens the learning curve for whoever has to debug my code later on. You can not count on them to know you library of choice…

    And I write functions in a library, to make maintance easier, not harder.

    Tue, January 30 at 10:22 AM

Comments are closed