7 things to remember while building a web application - Part I

code-ramblings

Don’t we all love building applications for the web. From the mundane page by page browsing, web development has come a long way - thanks to the web 2.0 mania. Building anything on the web these days require a good amount of HTML and CSS knowledge. Gone are those times when the “programmers” build the application and the UI folks plug it in. Most web based applications are Javascript intensive, which tag along a lot of CSS manipulation. And to top it all we have atleast 4 major browsers to support - one of which is a major pain in the ass.

The following things top my list of “remember-or-get-hurt”:

  1. Always specify a DOCTYPE

    I cannot tell you how much pain and misery not doing this would cause your development process. At one point we ended up writing completely different sets of CSS files for different browsers! - all because someone (read me) forgot to mention the document DOCTYPE. Here is a link to an ALA article if you want to know more.

  2. Never code for Firefox

    Okay this is a personal thing. Thanks to Firebug, we love developing on Firefox. Its incredibly easy to work on and it probably has the best development tools to boot. YSlow, dozens of FireBug extensions, Live HTTP Headers, etc etc. All said and done, you still need to support the other evil - Internet Explorer. After all, 70% of the world still uses it - don’t ask me why!. During development, it is wise to have both Firefox and IE running. I know a few CSS dudes who would never ever develop just for Firefox. They will always have IE, Firefox and Safari open at all times. It’s always easier to check first than fix later.

    Here are some tools that will ease your development on IE: (Just Google them for links. Too lazy. ;))

    • Debug Bar
    • Web Inspector
    • IE HTTP Headers
    • IE Web Developer Toolbar
    • Firebug Lite
    • Visual Studio Debugger
  3. Hacks are quick solutions, but better if avoided

    Hacks. Well usually this means - workarounds. It sometimes also means, things you need to do to please the evil goddess of IE. By now there are about a gazillion different hacks to make things work in IE - give or take one or two. They all work, but make maintainability a major issue. Moreover you never know IE8 could actually be good when it comes to standards. Or if you do use browser specific hacks, please make sure you put appropriate comments and don’t just write understandable code. :p

  4. Don’t use AJAX everywhere

    XHR calls and funky loading animations add that web 2.0 zing to your application, but don’t overdo them. With AJAX/XHR come a lot more lines of code in order to implement bookmarking, the back button, the page refreshes, etc etc. XHR will definitely speed up your page loads and will definitely make it look cool - but make sure you keep important pages of your application with linkable, bookmarkable URLs. And it would be better if doing this does not require a lot of JavaScript code.

  5. Graceful degradation

    This is another thing that a developer should keep in mind. What would happen to my application if the browser does not support JavaScript - or rather, if the user has disabled JavaScript? Agreed, this is a hard-to-come-by scenario and probably anybody using a web 2.0 website would never have JavaScript disabled, but it is something one should spare some time on. Your application should at least be “readable” when JavaScript is disabled. It need not be fully functional. Most new age JS frameworks are unobtrusive and degrade gracefully, but make sure your code does too.

  6. Not everybody is on freaking Broadband

    Yes, you heard it right. Don’t bloat your pages. Don’t clutter them. And for heaven’s sake don’t put videos, flash animations, big images all on one page. People designing websites which expect heavy traffic, go miles to ensure that their pages load fast. HTTP requests are minimal, external JS and CSS files are minimized. Interfaces which are light, load fast and are free of clutter are always better - even if this means sacrificing that cool gfx or Flash/JS effect. Yahoo’s performance benchmarks and YSlow are good to start with.

  7. Ditch support for IE6

    This is my personal favorite. Just decide not to support IE6. It’s release was probably the biggest mistake anyway. Supporting it will result in countless hours of frustration and an end result which will be less than satisfying. I know a lot of people use IE6, but as I said, I personally will never build support for it. And I am not the only one. (I know it ain’t a very bright idea while developing commercial web applications, but hey!, a developer has to have his say at some point ;))

These were some very basic points to keep in mind while making a web based application - all on the client side though. Part II will feature things that one needs to take care of on the server side. Keep watching this space. :)

17 Responses to “7 things to remember while building a web application - Part I”

  1. Mojah Says:
    August 13th, 2008 at 3:10 am

    I like you idea of no longer supporting IE6, it sort of forces users to upgrade to the IE7 version. However, depending on your target audience (website content, visitor age & technical knowledge) you might be forced to support it anyway … I know of several clients who insist on using IE6, even though (free) and better alternatives exist.

  2. Kia Kroas Says:
    August 13th, 2008 at 8:58 am

    Great points, I just have one problem with #2. Even though I code mainly for Firefox (I’m a programmer, not a designer) and I’m willing to make some adjustments for other browsers–Safari, Opera, iCab, etc–IE’s consistent lack of standards-compliance creates a lot of messy issues. So I’ve decided to just forget about IE altogether. Add in the fact that most of the browser hijacking is targeted towards IE, I consider it as doing my users a favor by not supporting it.

    Since your point #7 mentions ditching IE6…you do know that IE is in version 8 (beta) now right? (To their credit, version 8 tries to be more compliant.) It’ll just keep getting worse as Microsoft tries to make its own standards.

    That’s just my opinion though.

  3. Nitin Reddy Katkam Says:
    August 13th, 2008 at 10:23 am

    I would also add a “Never code for IE” to the list. Some users stay away from IE either because they think it is a security risk or because it’s already been hijacked by some spyware.

  4. zhandwa Says:
    August 13th, 2008 at 11:22 am

    @mojah,
    I know how frustrating it can get convincing people to ditch IE6 support - well they aren’t completely wrong either; as numbers still favor IE6 a lot. :(

  5. zhandwa Says:
    August 13th, 2008 at 11:25 am

    @kia,
    I never thought of looking at providing IE support that way. Next time my boss asks me to support IE, I will definitely tell him that by not supporting it we are actually doing a favor to our users. :D

    Yeah, I have been using IE8 Beta for quite some time now (as my tertiary browser, after Opera and Firefox ;)) and it seems pretty good.

  6. zhandwa Says:
    August 13th, 2008 at 11:27 am

    @nitin,
    I remember using adaware and all those adware/spyware removal softwares when IE6 hit the market.

    Ever since I ditched IE, I don’t even need installing those softwares. :)

  7. Keith Says:
    August 13th, 2008 at 6:48 pm

    Good points. I just started a new project and explicitly decided against IE6 support. That said, my recent work required not only IE 6 but 800×600 support. A real pain…

  8. Fabien Says:
    August 13th, 2008 at 6:49 pm

    It seems to me there’s a contradiction between #2 and #7.
    Right now, Firefox, IE6 and IE7 each have roughly one third of the market share, all the rest being nearly negligible.
    In #2 you say “don’t code for FF, two third of the world use IE”. And in #7 you say “drop support for a browser that one third of the world uses”.

    Either you can force your users to use a specific browser, and you develop for that browser, or you don’t, and you should at least support the three main ones. OTOH, support for Safari or Opera seems less vital to me.

  9. zhandwa Says:
    August 13th, 2008 at 7:02 pm

    @Fabien,
    Yeah, it does sound a bit contradictory. But, what I meant was, while development most people just stick to FireFox ignoring other browsers - till they finish their work. This approach is what I think should be avoided.

    As for #7, it is totally my personal opinion and I won’t disagree with you completely. But for me the browsers I try to support while development are IE7, FF, Opera and Safari.

  10. Rob Says:
    August 13th, 2008 at 8:13 pm

    You’re comment to not code for Firefox only causes confusion. You should use Firefox or Opera or Safari to initially test your markup. Then you know you are properly following the standards. Internet Explorer does not follow the standard well at all so if you code for it you are almost guaranteed a life of making small adjustments to make your buggy markup work in each of the more modern browser. Coding for IE is stupid. Code for the modern browsers, that is, everything but IE, and then you only have to hack for IE. But the bugs and quirks of IE are known, published by hundreds of sites, as are the hacks to fix them.

    Also, while you promote coding for IE due to market share, you then say to ignore IE6 which still, unfortunately, has 1/3 the market. As I said above, code to modern web standards. Test in the modern browsers that work. Hack for old, buggy, non-standard IE. Quit thinking IE8 is any better.

  11. zhandwa Says:
    August 13th, 2008 at 8:37 pm

    @Rob,
    What I meant was don’t ignore other browsers while development; which includes IE7, Opera, Safari… Each of them have their quirks and keeping track of things as they break will allow you to maybe find a better standard solution rather than going for a hack.

    I should have put that point probably in a better way. :)

    Ditching IE6 support is again as I said in my earlier comments, is totally a personal choice.

  12. Henry Says:
    August 14th, 2008 at 2:20 am

    Someone should write a worm to DELETE IE6 (and maybe upgrade to IE7/FF)! Wouldn’t that be nice!!!

  13. zhandwa Says:
    August 14th, 2008 at 10:48 am

    @Henry,
    I am pretty sure that is totally doable, considering how vulnerable IE6 is!!! :D

  14. Links For August 17th 2008 | .Net Says:
    August 18th, 2008 at 12:25 pm

    [...] System.Data.Services 7 things to remember while building a web application - Part I Thinking In Rest - Part 2 Debugging in .NET – Resources Encrypt Configuration Sections in ASP.NET [...]

  15. Patrick Says:
    August 21st, 2008 at 12:35 am

    IE6, yes, but its not always something a user can control. How many IE6 users are using their office computers with little control over their browser type?

    My current job (which I’m soon leaving — thank god) uses IE6 and there’s nothing I can do about it as I’m blocked from doing all kinds of things on this machine. How am I going to visit your website during the majority of the day if it doesnt support my browser?

  16. Yep Says:
    September 16th, 2008 at 5:01 am

    Yeah, as much as I hate IE 6, I disagree that you have to ditch support for IE 6. 28% of the retards out there still use it and you that is outside the scope of our control. 28% could mean a good market.

  17. Link Flood - 08/17/2008 | 1337hax0r.com Says:
    December 9th, 2008 at 2:29 am

    [...] techie links: Why Star Trek engineers suck, convert your Pinyin to unicode, good tips for web developers, charts for Javascript users, good functions for Excel users, categories for computer science (this [...]

Leave a Reply

Icons by N.Design Studio. Designed By Ben Swift. Powered by WordPress and Free WordPress Themes
Entries RSS Comments RSS Log in
Site design and layout modified by me.