Monday, December 19, 2005

Performance enhancement through simplicity

People have different views of how one should take performance measures while designing an application.

One approach is to think performance all the way. This means putting as much code in stored procedures as possible (most of what I do has a connection to a database), having denormalized data structures and generally focussing on the shortest execution path for everything. This approach makes sense because it directly confronts the problem.

It however has some problems which makes it suitable for only small projects. While being very simple with small applications the complexity grows a lot when the application grows a little. It has no focus on maintainability and can be a nightmare to fix later.

On the other side is the completely object oriented model. EJB is is an example of such an approach. In EJB (at least in the old version that I know) the programmer or designer lives in a happy cloud of ignorance towards performance. This is of course my interpretation of the framework. The fact is that the performance considerations in EJB lies in its scalability. All a matter of defining what performance is.

What I have concluded to my self is that performance is partly raw power, partly scalability but mostly simplicity by design.
By focussing on simplicity, it will be much easier to refactor those parts of your code that does not perform adequately. This is why I also consider OR mapping frameworks to be performance enhancing. They might not be directly performance enhancing, but they simplify the programs and make it possible to spend your time where it is more needed.

Friday, December 09, 2005

Close your eyes and imagine you followed the right path?

Most of software development is not about actually developing software. It's about choosing and following a path that leads to success. What path to follow may be influenced by a lot of 'external' factors. Such factors might come from the sales department.

Once a path has been selected, it is wise to follow it for some time. To follow a path will help your productivity, and give you a more detailed view of what you chose.

Once in a while you should reconsider you path. If you are following MS, you should see what tools the open source community has to offer, and you should let your self be inspired by the Java world... adopt those techniques that will improve your path. Just to sit back, relax and wait for the next release from your favourite vendor will not make you as aware of your development as otherwise. Don't be too pro anything just because it worked for you last year.

Wednesday, November 09, 2005

ByRef vs. ByValue

In relation to passing object to methods:
The documentation says that all objects passed are by reference in Java. The Documentation for .Net says that all object variables in method calls by default are by value. They are in fact the same!

I think the names in .Net are a bit unaccurate. When you have an object by value, you actually have a value in the form of a reference. When you have an object by reference, you actually have a reference to a reference to an object. They should change their documentation to by reference being the name of the default behavior and changing ref and ByRef to something else.

Tuesday, October 25, 2005

Multiple Languages in VS.Net

I have just testet the possibility to use multiple languages in a VS.Net 2005 project... It actually works... HURRAY! This will be very helpful for us when we are converting and refactoring current projects to C#.

Why they made two languages in the first place is still a puzzle to me. It looks like it has been som kind of publicity stunt, but unfortunately not adding any particular value the the product. Well, it did what it was supposed to by convincing my boss that it is great to have support for many language. In Java at least everybody speaks the same language.

I have always wondered why they diverted VB.Net and C# so much from each other. I mean, they had to invent all of the terms anyway( to differentiate just a little from Java ) Why is it called shared in VB and static in C#, why is it called Imports in VB and using in C#. Why is the String class typed with a little s when all other classes are capitalized?

I was hoping they would start calling things the same in future releases... but when i saw LINQ, they still invent new syntax structures for both languages??? That doesn't make sense to me.

Friday, September 30, 2005

Back from JAOO

I have just attended the jaoo conference in Århus. It's always great fun to hear clever people talk about things they think is cool.

What seems to be the thing is MDA (Model Driven Architecture) or DSL (Domain Specific Languages), which in many ways are the same thing. Even MS have considered these in their comming version of Visual Studio .Net. The DSL Tools of VS.Net is certainly something I have to give a closer look.

Another technology that fascinated me was JXTA, which is an open protocol for p2p. It was related to enterprise architecture as a way of maintaining nodes of your own application cluster. I must try this in some petproject. The reference implementation is in Java.

AJAX.Net enables you to meta-tag your .Net methods to be exposed to your javscript running in the browser. Although we have been using AJAX for almost 5 years now, this approach would remove some of the complexity for the programmer.

My mind is exploding with ideas, but it is probably going to take a while before I am allowed to use workhours and real projects to realise them.

Monday, August 22, 2005

Partial source is a good thing?

One of the things advertised in .Net 2 is partial code. In fact, when I tried the Visual Studio C# Express I couldn't figure out how to disable it. Maybe it is just me getting old (or I just don't get it), but I don't like the fact that I don't have access (from VS.Net) to parts of my application code. And I don't like the fact that I might be surprised by some functionality because I don't have one single view of my class. To think of it, I haven't found anywhere partial source is actually useful.

Hopefully it is possible to turn this feature of in the final release of VS.Net 2005.

I have just found the other part in visual studio... but how do I disable it?

Monday, August 15, 2005

Isn't checked Exceptions what we really want?

It has been decided to leave checked Exception out of the .Net framework.
The reason for doing this is that is that it should easier to change versions without recompiling. This to me sounds like late binding. I might as well go back to scripting.

I like checked exceptions because it forces you to design your code beforehand and ensures you that you have considered all error conditions.

More or less I want to keep track of less things in my head and let the compiler check my code for consistensy whereever it is possible.

Further more, when you talk about pluggable architecture, you want your plugins to follow certain rules. This is a perfect scenario where you really really benefit from checked exceptions.

Please put checked exception in .Net!

Friday, August 12, 2005

I have startet to implement Continous Integration on a project.

So far it seems like its going to save us a lot of time. We're using CruiseControl.Net and NAnt to do the actual task. Everytime we check source code in to our versioning tool, it will be compiled, analysed, testet and deployed. Everybody can see the status of the code.

We are now able to instantly know when a checkin courses our tests to fail. On top of that our solution is now automatically installed and our testers can now test how the current code behaves instead of old code. GREAT!

In the future a new release can hopefully be done by anybody because everything is compiled automatically.

Monday, August 08, 2005

Naming interfaces and classes.

When reading these blogs I started to think about the concept of prefixing interfaces with an I. The I is meant to make it clear to the programmer that it is in fact an interface he is using.

Prefixing interfaces has, as I see it, two disadvantages: First of all it gives the impression that the interface is a secondary thing, and that there must be a more important class behind it.
When you first see IList you wonder; is there a List as well? The fact is that IList is a List and the I only confuses the user. This leads me to my second point. The unexperiensed programmer might have heard that designing your code with interfaces is a good thing. I have seen programs constructed only using classes, and thereafter added interfaces to all classes with the I prefix. The fact is that interfaces do not make much sense if they are not suppossed to be implemented by more than one class.

Friday, August 05, 2005

Hello. This is going to be a technical blog about things in software development I feel like writing about.

I have originally been using Microsoft technology. Then I was using Java for a few years, and now I'm back where I begun.