Archive for May, 2009

Recent work – entirely non-UI focused

Wednesday, May 20th, 2009

When I created this blog, I wanted it to be about user interfaces, CSS, and maybe a bit of client script and design. That’s what I do and what I love doing, truly it’s what I got into this business to do. My last few months, however, have been spent dealing with all sorts of other technologies that exist nowhere near the front end.

The technology I’ve been using has actually been quite fun. I’ve been dealing with the .NET Entity Framework, which is an auto-generating data access layer similar to LLBLGen or Hibernate for Java. It’s free, works very well and has saved me a heap of time on this project. There are quite a few problems with it though, namely handling of scalar stored procedures, mediocre data model updating and the usual Attach/Detach context problems that it shares with Hibernate. It could do with some “scaffold” functionality too, but I think that’s included in .NET MVC Framework.

I’vealso  been playing with .NET AJAX which works ok, though it’s not as lightweight as doing the posts to another page (or in another language, damned viewstate), it has built-in fallbacks for non-javascript users, which is exactly what you want to do when making a AAA accessible site! I’ve had exposure to iTextSharp, a .NET PDF assistant. I found it very easy to use and getting .NET to populate some PDF form fields was very easy. Having to use Adobe Acrobat Pro to make the PDFs was not as fun :-(

I’ve also been playing with SQL database mail, SQL’s bcp function,  and fighting with Visual SourceSafe and IIS. Yes, I’m working for a client who likes Microsoft ;-)

In reality, I’ve been sidelined from what I like doing because I can also do the server-side gubbins. Some days I’d rather not know how to do it, but I’ve now been a programmer for nearly 6 years (!!!) and I’ve realised that I know quite a lot about the entire process of building a system architecture that works (I know the following languages, Java, C#, CSS, HTML, JavaScript, PHP, Ruby, SQL, Objective-C, Haskell, Prolog, and lots of specific libraries like DirectX, OpenGL, jQuery).

My next project looks like it will be iPhone based, so whilst I need to brush up on my Cocoa, I may get back to doing what I love: creating beautiful, usable interfaces that improve the way we work with technology.

I’m looking to complete work on an article on “Designing for Touch” soon. Looking good so far…

Classitis (class-eye-tiss) – The new CSS disease

Thursday, May 7th, 2009

CSS has gone through many trends and phases in web development. Certain trends are welcome, like conditional stylesheets and developers refusing to do them for Internet Explorer 6. Other trends can have leave a web application with a disadvantage for the rest of its life, yes, in-line styles, I’m looking at you.

This is all well and good, people learn from their mistakes and in the end, best practice comes out. The latest trend seems to have brought us full-circle.

About a year ago, HTML was plagued by a trend known as divitis (div-eye-tiss), a syndrome where a web page was seemingly marked up entirely in <div> tags, making a mess of the markup and producing un-readable pages. This was mainly produced by new web developers who had just moved away from the safety of table-based design and into the world of web standards and can be easily remedied with some education on elements other than <div> and <br/>.

This disease now seems to have mutated and crossed over to CSS in a trend I’m calling classitis (class-eye-tiss). It’s easy to diagnose: the first sign is in the HTML. Look closely at each element, it may have a class attached to it. If it does, does the one above have the same one? If this repeats all over the page, you may have classitis. In the navigation of your site, do all the list items have the same class name? You may have classitis. The way to tell for sure is to dive into the CSS: If the styles are predominately classes (i.e. are “.className”) with ancestor selectors being few and far between, then you have classitis.

The root cause of such a syndrome relates to modern web programming languages, notably ASP .NET. I’ll try to explain:
ASP has a number of helpful server-controlled elements which when processed turn into regular HTML elements. These all have their own unique identifier, but this is the reference for the server, not for CSS. Therefore, each of these elements can have a CSS class applied to it, and developers use this constantly. The real kicker is that ASP encourages you to use its own controls rather than standard HTML elements, making this disease especially prevalent amongst users of ASP. What makes this even worse is that ASP has been the default option for enterprise level applications for a while now, and Microsoft have made ASP accessible to new users with the Express editions of Visual Studio. It’s now easier than ever to start coding badly.

Is classitis really that bad? Well, no, but it’s what it comes with that can cause problems. A recent web site template that I was given by a company that shall remain nameless, was riddled with classisits, even so far as that there was an individual class for each font type and size. Surely setting a single class for the body would be easier and using ancestor selectors after that would provide for simpler HTML. The real problem here is maintainability: my task was to add another page which used a three-column layout rather than their two-column one. I’ve ended up duplicating their code to make my new layout fit, even then, changes made to their stylesheet won’t be reflected in my layout.

It’s a sorry state of affairs, but the remedy is simple, learn to use HTML elements properly. Some developers seem to forget that <html> and <body> are tags like all the rest and can be used to dictate the styles of the whole page. For users of frameworks like ASP, remembering that there are more elements than the ones the framework provides is very important; though don’t rely on the visual designer. Classitis is curable, and education on its prevention is important. Lets hope it’s caught before it becomes a pandemic.