Top posts

Latest articles


Is the switch to AJAX worth the trouble?

Posted by Jongerius under Development, Webdevelopment, Website optimization
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

Recently I’ve been working on a project that required me to create multilingual pages for having people wait while some action is being performed in the background.  There is no way of doing this by loading a new page, because this was the entire reason for the wait. So the only option is using JavaScript, which I liked in combination with AJAX.

But is AJAX really worth all the effort of designing and implementing a lot of hacks and cracks to make it work in all browsers. Or even worse trying to integrate it into an already existing website.

I have to admit that I don’t have a lot of experience with AJAX just yet, but from the work I have done with it I’m starting to think it’s not worth it. So lets support my oh so bold claim with some facts I encountered.

1. Any use of AJAX means assuming your visitors use JavaScript
Now I know a lot of people are leaving JavaScript turned on, but to what setting. Browsers are getting ever more picky on what to allow and what not to. So any AJAX call may go wrong. My example is simple in Internet Explorer you are allowed to make cross-domain AJAX calls, but FireFox is preventing you from doing so.

2. Users on slow connections will experience problems
Here’s one I actually experienced when using a dial-up line. I loaded a website that used a cool looking AJAX script for auto-completing a input box. Sounds cool doesn’t it, well NO. If you are on a slow connection as I was then the AJAX calls will fall behind on the typing and the input box starts giving incorrect suggestions or worse yet mistakenly auto-completes to a word I didn’t want.

3. Search engines don’t like it
Maybe a point that not a lot of people think about when designing a website, but the search engines won’t load your cuwl AJAX pages. Instead they will ignore them and all of your hard work becomes useless. What’s the use of having a website if you can’t attract visitors from search engines.

Maybe the search engines will change this behaviour in the future, but until that time it’s definitely a strong point against AJAX.

Now don’t get me wrong. I don’t think there is any problem in using AJAX, but you should be aware it may not always produce the desired results. So for now I will restrict the usage to features I don’t think are important to the website, but just cool to have for those connections and browsers supporting it.


The Importance of Modular Architecture

Posted by Jongerius under Development, Webdevelopment
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

If you are a software engineer and somewhat up to date with the latest techniques and methodologies you will have heard of modular design. Even though a lot of developers seem to know what it is, very few use it. Today I hope to help you make the final step to use modular design.

First lets go over a quick list of why you should use modular design in all of your solutions:

  • Similar functionalities are grouped together, well if you do it correctly anyway
  • The code is easier to maintain, a big plus for most people!
  • A complete stranger will have little difficulty understanding the basic setup of the project. (For the more techies this is the architecture and interface lay-out of the solution)

Personally I believe that these points should be enough of a reason for everybody to use a modular design. So why do some, especially the older, software architects and designers still opt for a design without modular setup or with flawed setup. Easiest explanation I could find is that this is the way they were taught. Growing up with C or Pascal you had little choose but to work like that.

What makes a modular design successful is that it is not only easier to understand the existing code, but that it should be ‘relatively’ easy to add new functionalities. Lets take a simple example (I just love those). If you have a document editor you would have some functions that describe how the document is saved, loaded and displayed. You may have noticed these are all related to a document. So you could group these type of functionalities in a document class.

But a document editor should also be able to work with different fonts. Each font having a default height, style and character set. Now some might put this in the document, after all it is display related. But if you were to make it modular you would have to be able to remove this functionality or add new fonts without changing the remainder of the application. Well no big changes any way, some minor changes are unavoidable. So I would say make a new class dealing with the displaying and embedding of the fonts.

The same holds true for printing a document. Loosely spoken a document class could contain a function for printing. But which one of the following is true. Does the document need the printer to work or does the printer need the document to work. I’d say it is the latter, after all the document does not need the printer to properly work but the printer can’t print without a document.

This also tells us why many people find it difficult to make a good modular architecture. For every functionality the solution needs to have you need to figure out its dependencies. I usually try to find out which functionality can’t work without the other, along with some good tricks I was taught. But if you haven’t had this training I’d strongly suggest picking up a book like ‘Software Architecture In Practice’. These books help a lot, trust me on this.

Now in the example above it would be very easy to add or remove a feature without having to change to much of the code. I could just add or remove a class to the already existing application. Or better yet someone that knows little about the original application could write the ‘plug-in’ and I could integrate it in the existing application.


Locating semi random errors

Posted by Jongerius under Development
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

If you’re a software developer you are bound to have encountered the following story:

Customer: The program that you delivered produces error messages when I run <feature>.

Any error is important so you start up the application and start following the same actions as the user did. And sure, there it is. The application starts generating error messages. Here comes the brainbreaker, during a debugging session the error never appears to occur.

Well I recently had one of those and its hard to track the exact location of the error, even when your log file is telling you exactly were it is. One of the first things I learned was that sometimes compilers add information to debug versions that catches or prevents the exception from happening. Meaning you will never see it unless you have a runtime compiled version.

One of the few options you have left is adding logging lines throughout the code that you expect the error to be in. I know this is a major pain in the ass, but I didn’t see any other way.

If you had an error similar to mine you will find out that it only happens half of the time (I had a null pointer exception on a constructor call). I personally think that Java was punishing me for working to hard.

So the hard lesson learned was that inserting enough logging lines eventually gets you the exact location and sometimes even reason for the error. But it does require you to be very patient, something that I’m apparently missing.


A smarter way for reading log files

Posted by Jongerius under Development
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

All system administrators or database maintenance employed know that one of the most tedious, yet one of the most crucial. Having to go through all the logs on who got DHCP leases, which user account has been (ab)used, etc…

I know that for me it started to become a pain in the ass, especially since the damn computer I was reading logs from was a hobby project. So I started fooling around with simple ideas on how to process all of this information automatically. And yes I know that there are a lot of tools out there that can do this, but they either cost a sift load of money or they can only do one specific task.

I wanted something that could read log files for DHCP, System logs, webservers and various other applications.

Since my server is Windows based I decided to write something small in VB.Net. And again, I know that most servers run Linux and so on and so on. But I don’t care, after all how many desktops run it, and this tool was to run from a desktop.

So what to do first when you find yourself in my situation. Well I was kinda familiar with the format of the logs, which helps trust me on this! So first thing I did was make a list with what information could be found and why this could be useful. So for webservers this would be any type of failure and why, how and when they occurred. For this post I will focus a bit on Apache, but it’s easy to implement something similar for every log file you can imagine.

If you know the build-up of the log file then you can write an easy parser for it. Which sounds somewhat easier then it is. I love using regular expressions for this because of their power. So for a typical Apache log file this would look something like this:

Date regex: [o-9]{2}/[\w]*/[0-9]{4}(:[0-9]{2}){3}\s(\+|\-)[0-9]{4}

State:  \”((GET)|(HEAD))\s/[\w/\._0-9,\-]*\.[\w]*\s(HTTP)/[0-9]\.[0-9]\”

Status: \s[0-9]{3}\s

As you might have guessed this part takes some time, or if you’re anything like me trial and error.  Note that these three regular expressions only fetch the date, state and status (unfortunately accompanied by some noise).  For testing the regular expressions I often turn to RegexLib Website with a snippet from an actual log file.

Now that you have all this raw information it’s simply a matter of formatting it in a way that pleases you. For me this was a HTML e-mail format. Easy and nice as you can have to tool e-mail the results of the logs to you, or at least a sort of summary.

Why did I not just pick a default package like Webalizer for this. Well easy I wanted it to sent specific type of information. Like what pages cause most problems, how often are wrong requests made and how many visits are there on average.

Would I suggest to you all to write your own tools for analyzing massive amount of logs and sending you a summarized version. Yes I would! It does require some time and you need to learn a programming language, but it far out ways having to sift through all the log files day in day out.

More information


Microsoft Live Writer - First review

Posted by Jongerius under Development, Internet, Webdevelopment
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

There is a buzz going around the Internet about a new and supposedly easy to use  blogging tool. Microsoft has created a tool enabling you to write your blog articles offline and publish them to your site later by the push of a button.

So you might think there is no competition here, but in the past many including myself also used the e-mail option to send article’s to my blog. Now I have to be honest. I personally like the Live Writer a lot. It is very easy to use and for a beta it is very stable.

Usability
One of the things I find most important about tools like the Live Writer is that they are easy to use. But that’s not enough. It needs to be fun! After all if it is no fun to write something for your blog are you likely to do it ever again. I won’t!

So how usable is Live Writer. Well I don’t think it has any competition from the online blog posting capabilities of WordPress. In fact it is a lot more user friendly. Nice buttons, a Word like toolbar and quick in editing.

Something I especially like is the capability to store drafts and continue them, it’s just like having the admin section of the website available in a nice graphical skin. I’ve not even mentioned the best aspect. The tool can work with various blogging software packages. So you’re not bound to the Windows Live service or Blogger.

Worth the try
So is Live Write worth looking into as your new way of blogging, or at least writing article’s for your blog. I think it is. It saves you time and is, in my opinion at least, very easy to use. Will it work for everybody, no it won’t.

So why not you may ask. It’s pretty easy actually. As with any tool it is made to simplify life. Which also means you have less direct control over the lay-out then you would if you were typing all your posts in HTML. But for nouvoice programmers or people that don’t care how a website works just that it does this tool is perfect.

Next Page »