Monday, June 06, 2005

Docbook on Oxygen

I have not been blogging much lately - too much job depression in the air I guess. I have started a new home project - trying to get a good transform for my docbook documention. My idea is to use fop (ouch) and saxon to generate PDF output of professional quality. Given the complexity of our documents and the proliferation of different features (vector and raster graphics, multi-language and a bit of math thrown in) I think this will be very difficult. I did look at the docbook to latex transformation project and it looks very interesting. I will try that when fop does not work (I suppose that would mean starting to hack eps files again...).

I got the docbook xslt book, so I think I have a chance. Unforturnately my documents are all written with epic 4.x, so I have the added adventure of using the arbortext flavor of the docbook dtd. I am slowly but surely getting started. Once I have a good xslt/fop build, I will start hacking the stylesheets to see if I can produce some presentable copy. I am early in the process, so I am still optimistic.

I have been using the latest Oxygen XML editor (on the one month trial) and I must say I love it (but I don't know why). There are certainly some rough edges, but for xslt I find it to be pretty darn good (and yes it does let me transform docbook into pdf with minimum fuss). I would like to buy it, but I don't dare ask the boss for another toy... maybe I will buy a home license..

Sunday, May 01, 2005

GOC programming

I did something I had not done in a couple of years this week, some good-old C programming (GOC). You might find this odd, but it is true. And me, a confirmed C hacker for years. Recently I had be obliged to do Java (which I like), C# which I like considerably less and lots and lots of JavaScript. You might laugh at my JavaScript hacking, but I did construct a large OO JavaScript scaffold that served me very well for a couple of years. There are cool things about JavaScript that you don't get with anything else (I like expando classes where you can just add a method to an existing object and everything works...

Anyway this is about C programming. I have done a lot of C programming in my life and it is the one language where I consider that I could figure out what the compiler would do by looking at the source code. Imagine my embarassement when I wasted 15 minutes trying to figure out why my close() wasn't working (Compiler was really expecting fclose()). Oh well, it took me a while to get back into the swing of things, but I new I arrived when I coded:

(*mylist)[(*nbmylist)++]->name = strdup(myname);

It was here I rediscovered why I love C and I challenge python weenie to prove me wrong.

Thursday, April 21, 2005

The Utility of UML

I think that any software developer likes to see the design of his system in UML just as any engineer might like to see the schematics of a system that he has designed (as opposed to just seeing the final package). For that last few years UML has been put forward as the way of expressing software design. Unfortunately, in the harried trenches, most people can not even understand UML, and often its utility is questioned. Personally I like UML, but mostly because a UML tool will give you a way to diagram a system without forcing you into the endless tweeking of diagrams that you often have to do when making them in word or visio.

So you see, I like UML (and I have spent a lot of time and effort trying to apply it to my everyday work), but even I find it difficult to justify. And I have made zero effort trying to force my co-workers to understand it. Why is this? Is it because secretly I question its utility also. In fact I do question its utility for developing software systems. This week we were trying to come to grips with implementing in new and rather complex system. In terms of our normal project size, this is a good one - not so big that it can not be done, not so small as to be trivial. This for me is where UML comes in. Recently in Queue there have been a series of articles on UML fever and how to get cured of it. The most profound statement of this set of articles for me was that you can use UML to explore the design space (and while doing so, learn how the software should be implemented), but you are still developing software, not UML diagrams. I must say I find this to be a revolutionary way of approaching a problem.

I find that creating a quick UML project (I am using Enterprise Architect) where I can define a set of requirements, hack up a few simple use cases with a scenario or two and then do a simple activity diagram or two allows us to have a concrete base to discuss the design. After this I will (rarely) hack up a few simple class diagrams, but more often than not, I just discuss the ideas with co-workers and we can then start the developement from notes on scraps of paper. The UML diagrams and notes are referenced but are never followed in detail. The thing is that the UML diagrams are just tools to explore the design space. I really don't think UML should be used to over-specify systems where the architechs create every object and every method and the developers just add the boilerplate. This is the way most tool venders feel that you should be using the tool.

But then, have you ever reverse engineered class diagrams from existing code? The result, while it may be pretty and it may impress the boss, is actually almost useless.

Sunday, April 03, 2005

Software Quality

Last week I finished reading the QA issue of Queue magazine (for those of you who are ACM members or live in the US or Canada this is a great magazine and it's free - go to ACM Queue and check it out). Anyway, the quality issue got me thinking about software quality. For me the main downside of having crappy software (and I have that) is that I have to spend more time in maintenance and on the phone with customers that I do hacking new code.

Anyway reading the QA issue made me think of three main issues to investigate. First, is code coverage. We already try to do unit testing (and even unit testing before implementing the tested code) but I am affraid our test don't really address the real issues. I think code coverage would help us focus our testing effort. I went to the Clover .NET home page to check out a demo and was quite impressed (see the report screen shots at Cenqua). I have not had time to try it on our code, but I indend to do this my first free moment (I am writing some overdue system proposals right now - yuck).

The next thing that I think is cool is code reviews. We are a small group so a code review is someone else reading code and signaling parts that suck. I have a good plugin for eclipse ( Jupiter) but I need something for .NET. I found CodeReview and it seems quite cool. I have a project where we have manditory code review, and I will be trying it out. I would just like something where we could annotate lines and have someone respond to the annotations. I think it will really improve the quality of the code.

There is one final area that I think we can address quality issues. That is using the P4 report tool. This allows us to see the files and project in the SCM that have had the most activity. This should allow us to look at these places for bugs first. I think I have to move all my DHTML to P4 (from PVCS) as soon as possible...

Friday, March 18, 2005

C# Express and other stuff

I downloaded and installed the C# express beta on my home development machine. First thing to note is that even on my old 400MHz hp (with 256M ram) I get acceptable performance from C# express. I was also able to install service pack 4 for win2k even though I am not connected to the internet. I did it with my 128MB USB key and the new winzip 9 where I can easily partition a big file into 128 MB chunks. The sneaker net lives!

Unfortunately I was a bit disappointed with C# express. I tried to install the SQL server and even though I (think) it installed correctly I was unable to connect or create a new database... I did notice an error in the event log, but at is was just a long string of numbers, so I decided to ignore it. This was annoying, but the thing I found really disappointing is really the lack of features of C# express itself.

My context is someone who uses eclipse quite a bit and netbeans a little. These are free products with what I consider to be very good features for the professional programmer. The best things are continuous compiling with clickable correction hints, refactoring and history. Since these products have captured a large portion of the developer mindshare, I was more or less convinced that the next version of VS was going to have to attempt to include these new features. My experiance with VS.NET 2003, had been mixed. It has a good debugger and adequant code completion, but thats where the list of features ends. The class "wizards" can barely be called that and there is not even support for managing translation resources (this is the first thing that made us question whether or not we could even use VS). Add to this, a brain-dead builder and you have an IDE that is "mostly useless", expensive and that can trash a machine just by installing it.

With this in mind I approached C# express with hope. Perhaps they would have to mimic other popular IDE's and provide some real features. After using it for a couple of days I see why it is called a beta. No doc and I can't even find MSBUILD. This was the feature I installed the product for. Result, I don't think we will be upgrading the 2005 version of VS any time soon and certainly not for this price.

Thursday, March 10, 2005

A Quiet Day at Home

There is a big public service strike in France today. I was "forced" to take the day off and stay with this kids. Of course it is a crisis at work, so I was in (almost) constant touch with the office via phone and email. The boys were a bit wild this morning, but in the afternoon I exchanged a little boy for a girl and everything is much more quiet (even tib has found new maners since Valetine is here).

Checked out some cool stuff today. I downloaded the .NET framework beta 2 and installed it on my development machine. No problems. I see there is the new MSBUILD delivered with it. This seems to be quite interesting. I would like to hack up a build script to build our current release (just to see if it is going to be good enough to replace our Nant builds). I don't mind Nant (and I like Ant), but it is a bit rough around the edges sometimes and I don't know how actively it is being developed. I have the impression that it is hard to gain any mindshare in the Microsoft world, because if people start to use your product Microsoft will deliver a clone of it just to wipe you off the face of the earth. I fear that MSBUILD is going to do this to Nant. On the other hand, Nant exists because VS.2003's build infrastructure basically sucks. I think it is completely, totally, 100% useless (and I mean that in the nicest way possible).

I was hoping for anoymous inner classes in the .NET framework version 2, but I notice they just have anoymous methods. These methods would be able to be used anywhere a delegate would be used. I find this sucks a bit, since I don't really think delegate are such a good idea. When will Microsoft enter the Object Oriented world and give up on function pointers! I was planning on using anoymous inner classes to implement interfaces, but this seems to not be possible (I will have to look further and perhaps think a bit).

I might try to install VS C# express to see if it is as good as VS 2003 (which I think sucks). This would allow me to get rid of VS from my work machine.

I spent a good part of the afternoon writing a proposal using arbortext's Epic editor. Maybe I just hate Microsoft, but I do find this editor to be sweet. I wrote my last two proposals with MS word and I planted far too often (I even sent the client a crashed version of some installation documentation, that was missing the last 3 pages - after this event, which resulted in a 2 day misunderstanding on how to install the product - I vowed never to use word again). As an aside, I have installed open office on my development machine and it seemed to handle my word documents okay. It even gives me our custom styles, I was quite surprised. I did use OO on linux about 6 months ago - and I did have a few problems, so I am not really ready to switch to OO yet. I have epic and it is a great editor, so I don't really need to look further.

Finally, I had another problem with XML encoding. This is got to be the most annoying problem we have ever had. That is the '&', '>' and '<' characters in XML streams. I think the current problem was that we have an encoded xml stream that is read by a filter that is suppose to extract some information and re-stream the xml. Unfortunately it removes the encoding and streams the pure text. Will we ever get this right? Between that and the character encoding (i.e. iso-8859-1, UTF-8 and unicode) I don't think that XML is that easy after all!

Friday, March 04, 2005

End of another week

Well, this has been an eventful week, even if I did not get many lines of code done. Five days in Prague was a bit much. It is a beautiful city and I drank my share of beer and I love the food, but after only 3 days of conference, I'm all bentleyed out. Not much interesting at the conference (which is a bit of a surprise when you consider that 4 months ago they were talking about a looming MS pre-release in Feb/March).

The other big news is the weather. In Prague everything was good, -7 to -12, a bit of snow and everyone knows how to live with it (it was a bit cool for a stroll on the bridge in my little jacket, but like any canadian - I'm tough, I can take it). But getting back to Paris, was a mess. Snow, slush, crappy roads, slick summer tires and bozos everywhere. In the end, I left my car at the office and came home on the train. Then I did the two ways to the in-laws to pick up the boys (a seven hour stroll across half of france).

In business, we talked seriously to two groups. First the holland group that manages the web application. I can see they are going to suffer with this "what do we do for clients who want to use linux/firefox or macintosh/safari" question. I am not dedicated to serving these clients, but if we abandon them, I would prefer to do it with our eyes wide open.

The second group was a german organization that we may be able to cooperate with. Given the size of our two companies, a shared source solution might make a lot of sense. I don't know if we have the technical and legal savey to pull it off however.

Friday, February 25, 2005

Good week for coding

Lots of interesting stuff seems to have happened this week for coding. First we (basically) finished two major product releases. This allowed us to implement a couple of really neat tools. First, I have worked out a way of creating a CHM out of an XML extraction from the issue tracking system. This cuts a lot of time off creating release notes and the results are pretty good. I would like to be able to create a PDF from the CHM, but the products I have previewed seem to mostly suck. Maybe if I create a chunked HTML document we could use Acrobat to create the equivalent document, hmmm...

Started using the new SCM to manage the code lines. This is a vast improvement over the previous system (which produced branch lines that were entirely imposible to manage). Yesterday I created a major product release branch without a hitch. This will revolutionize the way be maintain our code. I can hardly wait to use it for our other my web product. It should allow me to reorganize the code base as well as making it a lot easier to rebuild and fix released versions. Up until now it had be a task only for the few gurus who would bother... mostly we would just try to install the lastest version and fix bugs there.

Got Eclipse 3.1M5 yesterday. I am very excited about the improved SWT drawing methods. This was the only thing that was missing to replacing my existing fat web client with an Eclipse RPC application. I see only advantages. I will have to try a code spike of drawing a VVF file to see if the performance is up to snuff or not (normally it should be, since it is a thin wrapper over the windows API, performance should not be a problem).

Did a lot of C# hacking today. Tried to apply some of the principals that I have been reading about in Holub. The more we think about what he has to say, the more (I think) it revolutionizes our coding practices. The only question is, will our code be better or worse... I suppose only time will tell. I think the idea of putting the Describe method in the IStorable interface will really change the way we think about interacting with our objects. This is the smartest thing that we have done on this code iteration (and we have done a lot of thinking about how to clean up our implementations). We hacked out a lot of lines of code today. I feel good about it for a change (even if it was C#).

Have to leave to the geo user conf tomorrow in Prague. It will be nice to visit the city (and drink a bit of beer), but I wonder what I am going to do there...

Friday, February 18, 2005

First Blog Entry

Well I think I am going to start to publish a blog. This is only a test entry. I hope someday I will have something useful to say.