Tuesday, July 15, 2008

Facebook Not Displaying Content In Firefox

If you live on Facebook - like I do - and use the Firefox browser, you will soon run into an issue that goes something like this: after browsing around on Facebook for a while, clicking links no longer displays the desired content. The browser may have a 'busy' mouse cursor, but most times, it'll report 'Done' in the status bar.
To make sure I'm not going nutz, I did a few sanity tests:
(1) If I open the same link in a new tab (right-click on link -> open in new tab), all is great - the content displays just fine.
(2) If I close and reopen Firefox, then reenter the link, all is well.
(3) I have seen this on more than one computer - at work, home, on friends' machines, and elsewhere.
(4) It doesn't matter what plugins - or add-ons - you have installed. A bare FF install behaved the same way.
(5) It's a Facebook-only issue. You can immediately use the same tab for other websites just fine.
(6) There are no errors generated - whether they be scripting or browser exceptions.
(7) I haven't seen this issue in IE.
(8) If you clear the active cache (both memory and on disk) for the browser, it clears the problem.

I suspect two things:
(1) AJAX history management, since it tends to happen after a lot of browsing on Facebook. Could it be cache/memory managment in the browser?
(2) Timeouts while switching the various DIVs. I did capture a trace of traffic generated when a link is clicked, and all asynchronous requests are returning successfully, as far as I can see. The next thing would be to hide/unhide divs loaded with content - which doesn't seem to be happening in this issue.
(3) Browser's Javascript engine or DOM engine - something might be amiss. Haven't investigated.

Maybe someone else out there has seen this inconvenience, and know how to fix it - if it totally isn't a Facebook issue. I've tried FF 2.x.x.15 and FF3. Or maybe Facebook will investigate.

Friday, July 04, 2008

Trends In Web Development

Any interactive website you visit on the Internet these days has web applications running behind it. The applications do all the work and most content is generated on the fly - as opposed to the old model where static pages were served from a web server somewhere. Gone are the days when plain HTML was sufficient to give you a web presence - users demand (and deserve) a highly dynamic web experience now, complete with multimedia and personalized browsing.

How you make this happen is beyond basic HTML skills; it calls for pooling graphic design, database, object-oriented programming, and scripting skills in the mix to get even the simplest web applications up and running. I just finished a small AJAX webapp at work, but it used a variety skills including HTML, Javascript, XML, DWR (or JSON oriented client/server transport mechanisms), Java (with servlets, JSPs, and JavaBeans), SQL (database) and data access methodologies (DAOs, connection pooling, keep-alive), Perl (for the user scripting aspect), C/C++ (for access to OS and native libraries using JNI), and security (session and identity management). For such a small project, it sounds like a lot of skills to pour in - but this is the trend in the web development world. No longer can you survive on one particular skill; your technical worth is directly tied into how diverse and related your skill set is.

There's also an increased shift to developing web applications using regular software development cycles and models. Websites are now versioned in content management and versioning systems just like your typical enterprise product. Build cycles exist and well as integration cycles and such.

Web development tools also continue to take prominence. No one writes code from scratch these days - that's under-productive, like reinventing the wheel. Instead, serious developers maintain templates or use rules-based code generation engines. I particularly like tools that can take all my UML junk and produce code from it - all the classes and stubs I will need. So much time savings there.

In mentioning tools, you've got to consider IDEs and plugins. It is no longer sufficient to know how to use only one IDE because projects come in all shapes and sizes. I routinely use NetBeans and Eclipse on the same project, for example, because of the various benefits each offers (especially in the area of add-ons). Mind you, each skill you will need to use may have its own IDE, so you've got to stay on top of it all.

Building the application itself isn't sufficient - it has to be tested: performance, usability, security, and stress. I don't care how good a developer you are, but there will always be bugs in written code. I've stuck with Java for a long time because of JUnit and other testing fameworks. NetBeans has a profiler, and Eclipse has code optimization for various platforms. I often write a test suite that leverages Javascript's power for each web application I develop. Suites such as this are good for regression testing whenever changes are made to the site.

Here's where experience does some good: on a few projects, we've been able to write large chunks of webapps as Java code only and have CSS, HTML, and Javascript generated on the fly - using rules. This is becoming a huge hit because it eliminates having huge code bases: essentially the application server "knows" how to produce content at the point of request. It also reduces coding errors greatly and aides maintenance. Such systems are highly scalable because you can retask them, for example, by simply changing the rules. They are harder to design though.

Something to always remember is that web code is no longer proprietary. It is easily reverse-engineered (look, functionality, etc without legal consequences) that there's no point in trying to protect Javascript and other client-oriented features. I laugh at people that try to prevent downloading images, for example, by disabling browser menus. Do they forget that if you can see it on your computer, it IS on your computer? Waste of time. If you have to protect something, leave it at the server.

Finally, it's a can of worms when you consider personalized browsing. Everything from targeted ads, to personalized look & feel, to presentation of related content and session management fall under this umbrella. It's a sort of social engineering done in software, once again eased by rules-based computing. Beyond that, reporting strategies, tracking, data warehousing, and all that crap I don't do well - the web application isn't complete until most of this stuff is in place. Web development is no longer a piece of cake.

So those are just a few observations from my latest project. I'm actually relieved it's over - it was beginning to drain the life out of me.