• May 31st, 2009

    On the Challenge of Developing JavaScript Within a Team

    I find one of the most challenging aspects of developing JavaScript in a team environment is cracking open someone else’s code and being able to work with it as if it was my own. Within the scope of a programming language we tend, often subconsciously, to define our own dialect to describe the things we build. This dialect is expressed in the names we give to the classes, functions and variables within our applications. The position of an underscore, the use of verbs, nouns and adjectives, whether something is singular or plural — all of these things (and so much more) affect our understanding of the intent of the original developer.

    There can be vast differences between the dialects of two JavaScript developers on a single project, which is only amplified with each additional developer. Put together a team of five developers each working on different portions of the same application, or ten developers all working on various projects together, and without a set of coding standards and naming conventions, code quality and developer efficiency will quickly go down, replaced with a tangle of conflicting approaches that serve to undermine overall cohesion as developers inject their own dialect into the structures written in the dialects of other developers.

    As JavaScript is a dynamic language, naming conventions become even more important as almost everything can become anything else at any time; this means that part of our job as developers within a team is to encourage the correct use of what we create through the subtleties of naming conventions and standards.

    Aside: My biggest pet peeve is finding that a developer has named something “foo” in their application. Foo, an utterly meaningless word, describes nothing, and gives others absolutely no hint as to the purpose of that thing. The only way to figure out what “foo” might refer to is to follow that name back through the code, reading every single line, incrementally gaining insight into the intent of the original developer. Everything given a name should be named to expose the intent of that thing.

    Over the next week or so I’ll be sifting through my code in an attempt to codify my dialect of JavaScript. I hope to better understand my current approach and illuminate any shortcomings and inconsistencies. I’ll post an overview of what I find, along with code samples for illustration.

    Posted in JavaScript | 4 Comments »

  • Think you’re registered to vote?

    September 15th, 2008

    I just went to the Washington State Voter Registration website to check my voter information, and my status was set to inactive, and it listed me as not voting since 2006.

    This is frustrating because I was never informed that they had deactivated my voter status or given a reason as to why my status was changed. In addition to this, I’ve voted in every election between 2006 and now and never had a problem at my polling place. I have no way of knowing if my votes have been thrown out these past years.

    If you think that you are registered you might want to make sure:

    http://wei.secstate.wa.gov/OSOS/VoterVault/Pages/MyVote.aspx

    If there are any problems with your information, you can call King County Elections at 206 296 8683 (press 0 to talk to a human) an they can fix your information over the phone.

    Posted in Politics | Comments Off

  • Simulate Network Delays

    February 18th, 2008

    When developing web applications it is helpful to be able to simulate a slow network. This can help you see how your UI indicators, ajax loaders, etc., will operate in various network situations, unlike your local network which is generally free of any sort of interference.

    These little snippets of code will freeze the execution of your web application for three seconds:

    // PHP
    sleep(3);
    
    // .Net
    System.Threading.Thread.Sleep(3000);
    

    Posted in .Net, PHP | 1 Comment »

  • Fluent: PHP Data Types as Fluent Objects

    October 28th, 2007

    Introducing Fluent, a set of PHP 5 classes that make writing code happier. Fluent enables you to deal with data types as objects in the fluent api style, like you can in most other modern programming languages.

    // JavaScript
    "Hello There".toUpperCase().split(' ');
    
    // C#
    "Hello There".ToUpper().Split(new Char[] {' '});
    
    # Ruby
    "Hello There".upcase.split(' ')
    
    # Python
    "Hello There".upper().split()
    
    // PHP
    explode(' ', strtoupper('Hello There'));
    
    // PHP using Fluent
    S('Hello There')->toupper()->explode(' ');
    

    Read the rest of this entry »

    Posted in Code/Projects, PHP | 6 Comments »

« Previous Page

Un-Dumbify