2005-09-28

State of the art in programming web based applications

A while ago I blogged about web based applications. I wrote that I think they are the way of the future and offer many great advantages. But how does one go about writing those applications? I mentioned before that the current state of the art is a collection of technologies which goes under the name AJAX. To tell you the truth, I consider AJAX to be stone age. Web development needs some serious improvements. Why do I think that? When using AJAX you must use so many different tools. There is JavaScript, XML (which really isn't anything in itself, just a piece of common syntax) and some programming language of choice for the server side program. And this is if the program is small and well structured. A good example can be found in an article posted not long ago on /..

My point is that there are too many technologies that need to work in synchrony. If you want to change your application you need to fiddle in some JavaScript, perhaps some XML files and in your server code. And then you have to make sure they all still fit together. It just seems fragile to me. But I must be honest here. I don't have very much experience here, this is just an observation from my general impressions of the situation.

So, what do I propose as a solution? Well, I don't have the solution in my hand right now but I have a rough picture of what I think it should look like. What we need is a language where we can express pretty much our whole program with all its parts. We shouldn't need to worry about the exact layout of the messages sent between the server and the client. I care very little whether its formatted with XML or JSON or what have you. Of course it is useful to be able to control this at some point but if I don't want to worry about it I shouldn't have to.

Is there any work done in this direction then? Yes it is. I was not the first one wanting a better solution than the present. The thing which seems most promising is Ruby on Rails. I know next to nothing about Ruby on Rails but it seems to be a very nice framework for developing web apps. The only problem I see with it is that it is based on Ruby which is a scripting language which too few static checks in my opinion. But I know other people have other opinions about that so I'll stop whining about it.

There is also an academic effort to develop a language which can take the place as the language for web programming. The language, not yet fully defined, is called Links (it doesn't have any official homepage that I know of) and the initiator is non other than Philip Wadler. Since Wadler is the brain behind it I'm sure it is going to be a sweet language. What I am afraid of is that it will have rather little impact on the web developer community. You can check his blog where he posted an email I wrote to him about this.

Another thing I'd like to complain about, while I'm on the subject, is how to develop the interface of web based applications. Assuming that we're running the application in a browser, it requires vastly different technologies to develop the interface for a web based app compared to a standard one. My utopian dream of how this should work is that there would be no difference in how to specify the interface of a web based app and non-connected one. The only thing I should have to specify is a bit which tells the program where to run. In a browser or in a standalone interface. Well, perhaps a little more that one bit would be needed but not much more. But in this case I'm afraid I haven't seen any signs of reconciling the two camps. Or rather the gazillion camps since there are just so many ways of writing a standalone interface depending on what library you're using. I think some reconciliation here would be a clear win. But I also see that it is a very difficult task and that it's not likely to happen any time soon.

On a more abstract note all of what I've written here is about being able to expressing oneself at a high level of abstraction. Some details you simply don't want to care about. You want to be able to express yourself clearly, succinctly and without having to repeat yourself. Here are my key rules for achieving this in computer science. Pick a programming language with powerful abstraction capabilities and arm yourself with good libraries and write new ones when you have to. When that fails come up with a new (often domain specific) language to be able to express yourself naturally in your particular domain. Finally, code generation can do wonders, sweeping loads of boring details under the carpet where you will never have to see them again. Maybe some day that will be the case for developing web based applications.

2005-09-27

Firefox versus Opera

I've been using Firefox for about a year now. I'm very happy with it. Especially useful is its extension mechanism. One can download small extensions to enhance the browser to do just about anything. But I've found that most of the things I've extended Firefox with are features I grew accustomed to while using Opera.

A couple of days ago a new version of Opera was released, version 8.5. The big news is that it doesn't have any ad banners in the unregistered browser anymore. I downloaded it to try it out and see how it compared with Firefox nowadays. And I must say I'm very tempted to switch back. Opera feels lighter and snappier. It comes with just about any feature I use on the web preinstalled. It saves sessions by default so that when you start the browser again it will show you the same set of pages as when the browser was closed. One previous problem with Opera was that it didn't handle som web sites that well, including Blogger and GMail which I depend heavily on. But that is a problem of the past. The only thing I'm lacking in Opera is some feature to block ads in a webpage. I'm currently using the Adblock extension to Firefox which has made my everyday surfing experience so much nicer.

But then there is also the question of whether I should support an Open Source project or not. It feels good to contribute the the Firefox project because I believe in Open Source and I think it is a good thing. But Open Source also needs competition otherwise it run the risk of growing stale. And Opera seems to me to be a better browser in a lot of respects. If I can make it block ads in web page just as well as the Adblock extension does it I'm probably going to switch back.

2005-09-24

Batman Begins Soundtrack

A couple of weeks ago I saw Batman Begins and recently I listened to the soundtrack. It doesn't happen very often that I get this excited about a film score, but this one is a real pearl!

The music is composed by Hans Zimmer and James Newton Howard. The work of Hans Zimmer I know fairly well as I have several of his soundtracks in my collection. And it is easy to hear his contribution to this soundtrack with his characteristic adrenalin raising yet melodic beat. It has taken many action movies to a new level. As for James Newton Howard I haven't listen to much of his music directly before even though I've seen many of the movies he made the music for. In the Batman Begins score there is a kind of theme which I can only describe as a kind of dark Vangelis-like music. I can only assume that this is Howards contribution.

As for the film itself, Batman Begins, I enjoyed the movie. It is an above average action movie which takes its time to develop the characters and how Batman came to be. The cast is full of very good actors, perhaps surprising since one would expect the movie to be aimed at the action audience which perhaps isn't so picky about the performance. But it shows that the producers have had a very ambitious goal with the film. A goal which I think ultimately fails. And I didn't really understand this until after I heard the soundtrack.

The film centers much around fear. Under his training Bruce Wayne is taught to face his fears and become one with them. He needs to be feared by his enemies. His nemesis in Gotham is the Scarecrow which uses fear as his weapon. And so on. But I think that this point is somewhat lost. Nowhere in the movie does it get really scary. Some scenes which have a tremendous potential of being scary or at least very intense simply fall flat. I tend to blame the director for this. One thing is for sure, we don't need to blame the score. At times it is just totally magnificent. Unfortunately it is not the kind of soundtrack that one can just sit and listen to. At least I cannot due to it being rather dark and scaring the crap out of me. But that doesn't change the fact that it is one of the most exciting scores I've ever heard. This soundtrack deserves a better movies.

2005-09-12

Dumb Ideas in Computer Security

A whole month without blogging! I need to shape up!

Today I read a very interesting article which I found on /. called "The Six Dumbest Ideas in Computer Security". It is a very interesting read. The author argues that in many cases we try to solve the security problem by attacking it from the wrong direction. An example: instead of filtering out gazillions of bad programs (malware, viruses, worms etc.) on should focus on only allowing those programs that we actually intend to use to run. With this turned-around approach we no longer need anti-virus lists that need to be updated every week. We will simply never be troubled again by malicious programs.

I don't agree with everything the author writes in the article though. His third point is that patching a piece of buggy software is a bad idea. I simply cannot accept that. It is not stupid to fix a bug. It is a Good Thing. What he argues for is that systems should be build with security in mind from the bottom up and that one should carefully plan systems before writing the code. I wholeheartedly agree with that. But that doesn't mean that fixing bugs is a bad thing.