Ten good practices for writing JavaScript in 2005

Bobby van der Sluis has put together a guide to Ten Good Practices for Writing Javascript in 2005. I suspect that most of my readers here will already know that we should be doing this stuff: Bobby talks of making your pages accessible using unobtrusive Javascript, writing scripts that are easy for other developers to apply, future-proofing your work with object detection. This is all sensible stuff; read his article for more. The key point is that there is a difference between knowing that we should be doing this stuff and actually doing it. All too often I find myself quickly and temporarily chucking in an onclick attribute on a tag, rather than attaching the event handler properly from JavaScript, and I’ll bet a nice shiny Bank of England pound that I am not alone. Using proper techniques, rigorously, does make the initial construction of a project a bit more complex, a bit more laborious. It’s (and you know this bit as well) when you come back to it in six months and you have to walk through the HTML fixing it to add new functions that you’ll think: I wish I did this properly the first time around.

That is, of course, unless you are all paragons of programming and I’m the only one who isn’t. Shiny Bank of England pound available for anyone who proves that that’s the case.

So, read Bobby’s article, pick up any tips you don’t already know, and then (and this is the important bit) apply that knowledge all the time. We’re all about to start playing a great new game, where things work and we can use Ajax techniques to speed up sites and browser manufacturers are working with us to find what we want and web services are out there just waiting to be integrated. Make it your mantra for today that you’ll do things The Right Way. Go on. For me. And for everyone else.


Category: javascript Time: 2005-04-19 Views: 1

Related post

  • Good security practice for writing a php/mysql web app 2013-05-10

    I'm about to create a web app that is php/mysql based. It should contain multiple users and two levels of admin accounts. It will most likely not be very likely to be attacked in any way. Still I am concerned about safety since I'm nowhere near an on

  • Best practices for writing Blu-Ray discs on Linux 2011-03-18

    I recently bought a Blu-Ray writer and am wondering how to best write the discs. The scenario is: I have a directory full of files and want to put them on the disc, read them back once to verify, and then put the disc on a shelf (i.e., the main purpo

  • Good Practices for development team in large projects 2012-09-19

    Since I started learning C a few years ago, I have never been a part of a team that worked on a project. I am very interested to know what are the best practices for writing large projects in C. One of the things I want to know, is when (not how) do

  • Good environment for writing math examples 2011-04-04

    I am writing a mathematical report. where i need to include some examples, e.g., solving odes. is there a package which provide a good environment for writing examples? --------------Solutions------------- One possibility is to add amsthm package and

  • Are there any good practices for designing web pages with a possibility of a very large amount of info? 2015-05-04

    I'm building a user profile page that sometimes displays huge amounts of text (depending on how much the user has created). It's basically a bibliography. Are there any techniques or good practices for a good way to display or work with huge amounts

  • Good practices when writing a parser for a standard file format (such as ePub) 2012-12-05

    I am considering writing an Android reader software that can read ePubs and display them. I checked the ePub standard documents. However, these contain a lot of information. So I am wondering what is the process of implementing a standard for a file

  • Good practice for eCommerce sites where you don't directly buy online? 2011-05-02

    I have a client that wants to sell jewelry, and she wants a website to advertise her collection there. The thing is, she doesn't have any means to sell them directly online. So the site is almost like a flyer -- you can't click on a "add to cart"

  • Good practice for unit testing with large or complex fixtures? 2011-07-14

    I am trying to use JUnit to test a class (FooWriter) that is responsible for writing my application's data to disk using a custom file format. The data set being written is potentially very large, and I want to at least be able to test simple things,

  • Is this good practice for making subdomains 2011-11-21

    I'm trying to create subdomains with my web application, however, I'm not experienced in nginx that much, I've been trying to find a stable solution from SF, but unfortunately I can't find any good solution. The problem I'm trying to do is create fle

  • Good practices for backing up MySQL on a large scale 2012-01-06

    I am a newbie to DB and in particular to MySQL. Are there any good practices to backup MySQL on a large scale? For example, there are a few things I've already found. Use mysqlbackup (physical backup) instead of mysqldump. increase key_buffer_size to

  • Good practices for packaging Python programs 2012-05-02

    I've been using Python for a while now, both in the context of personal and professional projects. One thing that occured to me recently is that I had never thought about a good way to deploy Python programs. Basically, since it's mostly a bunch of s

  • Good practices for large scale development/delivery of software 2012-09-10

    What practices do you apply when working with large teams on multiple versions of a software or multiple competing projects? What are best practices that can be used to still get the right things done first? Is there information available how big IT

  • Good Practices of writing release notes 2012-10-05

    At the delivery of every version of software we have to write a release note. For example, here are some of the terms I add when I write a release note: Release Date Bug Solved Is that enough, or is there anything else? --------------Solutions-------

  • What are good practices for traces on the "mains" side of a relay? 2013-02-07

    I'm trying to switch a reasonably sized load (800W at 120VAC), so let's call it 7A using a PCB interfaced to a microcontroller. Obviously I need to make sure that the relay I'm using can support this load, and I can use the circuit calculator to figu

  • Good practices for updating a server? [without affecting current running services] 2013-02-19

    There are some servers that have a task delegated to them. For instance, imagine a scenario where there are web servers, data servers etc. that together provide a service to a client. Now how should I make sure the servers are up to date with new sof

  • Is pyramid link building a good practice for SEO? 2013-03-18

    Can someone help me to understand please? Is pyramid link building a to do practice for SEO? Does it work as per example below? Tier 3 pyramid building for SEO... Tier 3 site, links to Tier 2 site... Tier 2 site has keyword links to profile site Prof

  • URL good practice for category sub category? 2013-10-14

    I have developed a application and I need to work for SEO-friendly URL. I have following URL structure: http://localhost:3000/posts/product/testing-with-slug-url-2 and http://localhost:3000/posts/product/testing-with-slug-url-2-4-23 Is this a good pr

  • Is "Redirecting via DNS" a good practice for positioning a website? 2014-01-19

    In order to position a website project I'm planning on getting 3 domain names (example.com, example.org and example.net). Whenever a user goes to "example.org" or "example.net" he/she would be redirected to "example.com". All

  • SEO: is it a good practice for 2000 pages to redirect to 20 pages? 2014-07-04

    My task is to redirect ("301 redirection") 20 groups of 100 pages (2000 pages) with duplicate content to 20 pages in inner blog at the same domain. I know how to do it but is it a good idea from SEO perspective, or it is a bad practice? --------

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 2.375 (s). 13 q(s)