Christian Heilmann

You are currently browsing the archives for the General category.

Archive for the ‘General’ Category

Automatic merging and versioning of CSS/JS files with PHP

Thursday, December 14th, 2006

Over at Ed Elliot’s the man himself came up with a cool PHP script that allows you to create a single cached include automatically from all the JavaScripts or CSS files you want to include. Check out Automatic merging and versioning of CSS/JS files with PHP.

For those who wonder why the hey you’d want to do this: working on high traffic sites means you learn a lot about how to make pages perform and as Nate Koechley explained at @media 2006 every http request sent from page results in another DNS lookup and generally slows down the perceived loading time of the page. Furthermore, scripts loaded in the head of the document get loaded first and add to the whole page loading time as browsers start rendering after all the dependencies in the head were loaded.

Using Ed’s script actually means you can have the maintenance benefit of different includes without having to worry about the performance problems.

[tags]performance,javascript,php,speed,usability[/tags]

This one day, on twitter…

Tuesday, December 12th, 2006
Craig: I haven’t had a spam comment in about two months. Either my Akismet/BadBehavior combo is working or the spammers have learned to target POPULAR blogs.

5 out of 5 for good humour, Craig Cook

Yes, I also got hooked on twitter which is a system built by the people behind odeo that allows you to send 150 character long messages about what you are up to at this point in time either via a web interface, mobile phone or instant messaging.

Twitter also comes with the option to show your latest updates in a badge on your blog and has an API to play with (which I am going to do very soon). Jeremy Keith, non office meeting dweller that he is already did so and incorporated his twitterings into his stream of information that goes out to the web.

It is funny though how twitter is being abused as a replacement for IM (with a worse interface) or IRC and not as it is intended to be. What amazed me though is how fast you actually accumulate contacts (I don’t like to call people friend immediately) and how many people that are harder to track via normal communication spend a lot of time there. Want proof? Check my twitter page

A bit of an annoyance is that the web, mobile and IM interface gets out of sync from time to time which made me answer some of Veerle’s questions before they showed up.

[tags]twitter,social software,messaging,instant messaging,irc,contacts,buzz[/tags]

Have a random weekend

Tuesday, December 12th, 2006

During some research for a new product I just got a cool mashup site sent to me by a colleague. Random Day Out allows you to define a starting location and will add random locations around the area that can be visited in a day.

You get a map, photos, directions to and from each location and a weather forecast. The system is a bit rough around the edges now, but there is a lot of potential in this.

[tags]travel,london,tourism,maps,mashup,dayplanning[/tags]

Dear JavaScript Library Developers…

Monday, December 11th, 2006

After spending about three weeks finishing a chapter of the upcoming book introducing JavaScript libraries to non-developers I was quite amazed how tough it is at times to use different libraries.

It was frustrating putting together a set of example scripts for several effects for the oddest reasons, which is why I am now publishing my wishlist for any JavaScript library developers or maintainers. Before you start a new library or expect people to be able to use yours immediately you might want to give these points some thought. For library users this list might be a good “heads up� to see how much work has to go into using a library or how to pick the right library for the job at hand.

Here’s what drove me nuts:

  • Lack of offline documentation. I am writing a lot of code on public transport or in hotel rooms where they consider it still an option to charge me for every 10 minutes online. It is not hard to create a PDF or offer a ZIP of the library documentation even if it is Wiki based.
  • Lack of step by step instructions and examples for effects and elements of the library. Most of the time you either get no examples at all or a single example that shows all the options you have in one script (or a very complex form to play with all of them – which is only marginally better).
  • Lack of unobtrusive examples of code which are those that fall back to working and functioning HTML or HTML+server side script solutions. In the market you will have to develop applications in accordance with accessibility and SEO requirements and both of these require that the page does not rely on JavaScript. It is very easy to create fancy examples that work with JavaScript, but harder to enhance what is already there.
  • There is no problem with trying to improve JavaScript or DOM methods in addition to just fixing bugs and browser inconsistencies. However there is a problem if your extensions break conventions like the event model. I have encountered a library that had addEvent() and removeEvent() methods, but no way to stop the default behaviour of the element. This is an oversight that shows me that this library was never meant to be used unobtrusively or to enhance a server side driven application.
  • Lack of information about browser support and – even more importantly – fixes and updates for new browsers that might come along. This allows your users to update their library includes or subscribe to feeds that tell them about updates and fixes. As a lot of libraries advertise themselves as a helper to make sure you don’t need to know JavaScript this is the least you should do to gain the trust of users. It is easy to claim everything works, but when there are browser specific bugs you cannot expect library users to fix them inside your library.
  • Inconsistency in naming of methods and properties. There is a lot of good documentation on the W3C sites about what an event is, and if you call it action I personally get very confused. If you don’t know JavaScript or the W3C specs that is less of an issue but personally I consider libraries are step towards improving JavaScript and the DOM and not a replacement of them.
  • Trying to replace CSS with library methods. There is a reason why CSS is used for look and feel: CSS parsers are very fast and it is great for maintenance to centralise all look and feel in a spot using one technology. CSS is that technology as it was invented for it. Instead of battling CSS, scripting should piggyback on the CSS parser whenever possible (by adding CSS class names to parent elements) instead of changing a lot of style properties directly. CSS has a lot less options to access content and elements than the DOM has and we can use JavaScript to give CSS developers a helping hand to reach these. There is a reason why there are so many “CSS onlyâ€? solutions out there – people got sick of scanning JavaScripts to find the place to change a look and feel parameter.
  • Don’t play the “mine is smaller than yoursâ€? card. It gives the wrong impression to new developers as they might be tempted to think that your short wrapper methods are all that has to get executed. We all know that they have to be converted to native JavaScript and DOM methods before execution.

[tags]JavaScript,JavaScript libraries,comparison,annoyance,rant,webdevtrick,review[/tags]

Being silly with \”web2.0\” logos

Wednesday, December 6th, 2006

I don’t know what bit me but I had to have a go at some logos of the very much mentioned companies of any web standards talk in the last year:

Quick, let's start a company!

tank'd

Any other that spring to mind? If you’ve done one, just add it to the spoof20 flickr pool

[tags]parody,logo,web2sillyness[/tags]