Web Developer Musings

Introducing the originally titled, Open Source 'Chat'

15 July 2009, 15:05 Comments (1)

Over the last week I have been working on a small project called with the highly imaginative working title 'Chat'. This is a simple (but totally modern) chat room I aim to release as an Open Source product that can stand-alone or be worked into an existing website.

I started 'Chat' to learn, experiment and refine various web development technologies. Most importantly for me it is based on PHP 5.2 and is neatly arranged into a single class. I have found stepping up to a more recent version of PHP really stands out when manipulating files for the self-installer as it has created a more streamlined process, and hopefully using a single class it will make the program secure while also being an easy platform for developers to work with.

This is also the first time I have built a program specifically with AJAX functionality in mind. Actions such as posting a message and logging in are all controlled in a simple file that is able to work individually so it can be called directly by Javascript. As it turns out sending form data and pulling content from a database is not nearly as difficult as I had imagined, requiring less than 1KB of - admittedly of fairly obtuse - code, and by starting the Javascript last 'Chat' should degrade neatly if anything goes wrong. This is also the first time I have written any code to work with JSON which isn't exactly exciting or interesting but should be useful for me in the future.

Lastly and least importantly the default template of 'Chat' uses CSS3 for rounded corners, drop shadows and zebra striping.

I hope to start up a project page soon (I'm not sure whether to use Google Code, GitHub or Sourceforge - any thoughts?).

chat.jpg

In favour of Flash, Part 2

25 June 2009, 10:38 Comments (1)

For several years rather than adding to or aiding website functionality, Javascript was infamous for flashing rainbow text, snowflakes and rockets that follow the cursor. Flash can also be held equally responsible for many moments of eye trauma, often with the added benefit of sound effects. Flash (until the last 18 months or so) held the upper hand in abusing the user because it was so much easier to implement. Popular Javascript copy-and-paste websites still list their array of scripts alongside a tally of legacy browsers they are compatible with, an unpleasant reminder of trying to make that cursor-following-screen-shaking-firework-mega-effect work when I was 14.

Frameworks have taken the hassle out of Javascript, particularly jQuery which removes almost all regular Javascript syntax. This makes it much faster to develop with when learnt. It allows a developer to traverse elements without worrying about nodes, get into AJAX without any hassle and all at the same time as taking care of most browser compatibility issues. At 18KB Gzipped it is no surprise that it has huge popularity. jQuery is easier to use than Mootools and YUI (they still follow roughly standard JS syntax) and tiny when compared to the huge Prototype library.

However, as mentioned in my earlier article the ease of development has led to ignorance about degradation, SEO and accessibility so nothing really has changed. There's a mass of websites with massive frameworks attached just so the website can have some tabs, a slide show or have an element animate in - any of which some CSS and 1KB of basic JS can sort out. While I am not against JS frameworks as a rule - for instance when they are working to provide a large amount of functionality - it is when they are being used to complete basic tasks in a fundamentally bad way that makes me want to confiscate them. The over reliance on JS is annoying, Orange have one of the most frustrating and unusable websites around; and they're a communications company.

So what about Flash? It is too an ideal basis to create an over-the-top web interface when really a simple HTML page would have done but when animations can aid a user's understanding, enjoyment and flow around your website it can be ideal. Creating a text based but highly interactive site will usually weigh-in below 50KB - less than most JS frameworks - and at least your interface will be consistent, there will be no widgets begging for attention, no developer tools popping-up because debug code was left in or any problems with an element just not showing up from time to time. What's the best thing about learning Actionscript? It makes creating well structured, degradable Javascript really easy.