Ivan Mitev In The Software Trenches

Technology weblog on .NET development and other things that make the world go round

September 27, 2004

"Professional Software Development" - book review

Last week I read Professional Software Development by Steve McConnell, which is a heir of his book After the Gold Rush from 1991. I also found a bunch of his articles written as an IEEE Software editor, incorporated neatly in the book.

This was my first book to read by this well-respected author and software professional. I was actually initially planning to start with his fundamental Code Complete book. While I am writing this post I see that Steve had recently an interview on MSDN TV about the updates in the second edition of Code Complete. But a friend of mine gave me a .CHM version of the Professional Software Development which I finished in a rush for just two days. The reading experience was really smooth though at some rare places the book loses pace.

So the book presents an interesting overview of the software industry and promotes the concept of Software Engineering as a set of proven practices which are widely used in the more productive and successful companies. In the start of the first part (out of 4) "The Software Tar Pit" the author makes a parallel between software development and building the Pyramids. Unless you "pave your way" well you will have tough time completing such a tremendous job. I am also a great fan of the saying "work smart, not hard". The truth is that in SW development things are a bit more sophisticated than in moving around rocks, but the principle applies. The inertia of "code-and-fix" development and the lack of understanding what are the basis for successful projects are the reasons why the difference in productivity between the best and the average SW companies reaches absurd numbers as 10:1 or more.

I appreciate the global picture presented in the book. It was nice to know how many programmers are out there in the world and how many of them have a diploma :) Did you know what is the percent of project success and failures? Based on such statistics and mainly on his vast SW experience, Steve McConnell provides a good summary of his vision about the development of the industry and the individual development of programmers (some of which are evolving to software engineers).

I liked very much his insights about why companies like Microsoft succeed, while not being strictly process-oriented (vs empowering their employees to a great extent). I think though, that Microsoft is or will be changing its internals since having 50 000 employees is a serious organizational challenge (listen to Joel Spolsky on IT Conversation for more on the topic). But I would not worry about yje prosperity such a giant in the field, so let's leave it alone.

One of the controversial points in the book is about certification and even licensing of software professionals, which turned out to be enforced in the state of Texas. Steve says that this will probably be the future as the industry is getting a bit more mature. There are many "pro" and "anti" arguments on the topic. McConnell tries his best to prove his point and answer the pessimists. Quite provocative ideas...

So, my overall opinion on this books is 4.5/5 stars (I read so rarely that I can not be too critical :)). So go and read it if you want to see the big picture and find extra motivation to keep improving your professionalism.

P.S. if you are interested in a printed copy of the .CHM don't hesitate to ask for one (I don't know what to do with all these pages cause I usually don't do rereads).

September 25, 2004

Step away from .NET, a VB challenge

The last couple of days I was involved in an urgent task that required writing some VB code. I have to say that one year ago I thought VB was a bliss. Especially compared to VC++ when doing COM programming. But when one has a decent .NET and C# experience, VB does not longer seem that appealing. It's really hard to tolerate such verbose variable declaration with Dim x as ... , and it's esay to forget to put "byval" in front of parameters. OK, I will stop complaining about VB (though there is so much more...). I have the edit-continue feature that makes my life a lot easier, especially when I have to accomplish a task really fast. But let me tell you about an interesting VB debugging experience I had today (I know it is Saturday, whatever).

I coded a simple routine to extract a recordset with codeID and codeText couples from a nomenclature table. When I debugged it worked like a charm but in a release mode the Oracle DB complained "Ambiguous column name in Select statement". Thanks to the fact that unsuccessful database queries get logged in a file I had a chance to see the query in the log. I could not believe my eyes: "select Description, Description from SomeTable". Was I blown by the wind to do such a stupid mistake of repeating a column name? I debugged again and the sql appeared to be just as expected "select Id, Description from SomeTable".

That's crazy! Doing the same thing works fine in Debug mode but not in Release mode. Was the data base corrupt and playing games with me? And then I remembered! I used a reference to a VC++ DLL from where I got the table owner to prefix SomeTable when constructing the sql. And that property BSTR DbOwner appeared to be not implemented properly. That caused some horrid mess in memory, which did not affect the application in debug mode but it occasionally broke the release versions. Hmm, such subtle bugs can make a developer's life really tough. I guess I was lucky to find the root of the evil so fast (well, 30 minutes might not be considered fast enough). And I will sleep well tonight (if this is possible after 3 beers)...

September 21, 2004

Looking for developers

Well, my company is looking for developers. And to be more precise we seek to hire experienced developers. A month ago or so, we posted job offers in one of the BG job portals (I think It was ItJobs.bg). Unfortunately the candidates that showed up were all rejected (most were not quite qualified, others... I don't know). So my boss asked me to recommend someone "appropriate". But the reality is that most of my university friends are already employed. And they work something completely different then I do. The areas of expertise we seek cover Object-oriented programming with C#, VB, VC++. COM experience is greatly valued since most of our projects are build upon existing frameworks by ESRI. Experience in GIS is also a plus, but I guess not many of you even know what the abbreviation means.

So if you or a friend of yours are interested, motivated and have the proper qualification, don't hesitate to apply for the open position.

Round and Round

This post is about rounding numbers. As you know rounding means "converting a number of greater precision into a number of lesser precision" . And it is not that trivial that one might think.

How many ways to round numbers do you know? Probably most of those with mathematical background will answer that there is just one "right" way to round numbers and they know it. But let look at some examples. The most common case is when you need to convert a floating-point number into an integer. Naturally it seems most "fair" a rounding rule to say "round to the closest integer". So round(2.4) = 2 and round(2.6) = 3. But what about 2.5 which is equidistant to 2 and 3? Here comes the interesting part... And this MSDN article How To Implement Custom Rounding Procedures uveils the mystery of rounding numbers. There are bunch of rounding algorithms described (look in the article for details):

Rounding Down
Rounding Up
Arithmetic Rounding (symmetric and asymmetric)
Banker's Rounding
Random Rounding
Alternate Rounding

And the funniest thing is that in different MS products different algorithms are used. For example the Round() function works differently in VBA 6, Excel, Sql Server and Java Math lib :)

In .NET System.Math.Round() and System.Convert.ToInt32() implement "banker's rounding". This is interesting to know (I always thought it used asymmetric arithmetic rounding, though I didn't know this algorithm was called that way)

Note: I have to give credit to the post Rounding numbers with .NET that was the starting point for my rounding "enlightening".

September 18, 2004

Check out those free software

Samurize: this can't be classified as an end user program. It is a collection of various components that one can arrange at his preference. I guess you could do amazing stuff just with few clicks. I tried one demo that displayed RAM, CPU, HDD information in a very neat way. Go, check it yourself.
Skype - internet telephony, instant messaging, file transfer and more. Getting vast populatity (more then 20 million download till now). Haven't tried it yet, but many people told me they are already fond of it.
Star downloader - another download manager. Got my attention with the simple and clear interface. It also has been translated in Bulgarian (not that I need it). The truth is that I tried it out only because my browser Maxthon does not provide GetRight integration. But I am glad I checked it out.

September 11, 2004

Today I tried WB Editor, which is a free desktop editor for weblogs. I use W.Bloggar but I am not completely satisfied with it. So let's state what I liked and disliked about WB Editor, based on my W.Bloggar experience:

What I like
WYSIWYG
Pastes hyperlink as links, not just as text as W.BLoggar
Code highlighter support C#, VB.NET, XML (by a pluggin)
Bulleting support
Better HTML highlightning

What I don't like
No support for Blogger Titles
No Tooltips on menus
Removes CR/LF in the posts (I can't imagine who will use this. I discovered there is an option to turn this off, but I did not seem to work on already downloaded posts).
Missing shortucts for often used commands

Conclusion
Well, there are many things I liked about WB Editor so I tried to publish this post with it. On screen it looked just great but when I posted in, the bullets disappeared and the text got distorted. It looked so ugly that I had to delete it and post with W.Bloggar only the text :)

Choosing a Browser

Since browsing the Internet consumes a big portion of my life, it was time for me to reconsider using IE. Not that I am one of those security paranoid guys, who hate this product in their guts. It's not about security, but more about usability.

IE has served me well, especially having Google Toolbar installed for powerful searches, popup blocking etc (at one point I had installed at my home PC also the MSN and Yahoo toolbars, but one of those is quite enough). And I was pretty happy until I tried Avant browser. Why? Just look at the top 10 reasons listed in their home page.

Now, I found even a better browser Maxthon (formerly know as MyIE2). Both Avent and Maxthon are build on Internet Explorer object model, but the user experience is miles better. Now I have tabbed windows, (which is especially helpful when you have 20+ pages open at the same time). I also can set hundreds of options, that are not exposed by IE. And finally I can use plenty of Maxthon plug-ins, or even write some of my own :)

September 05, 2004

Relocation

My company's office has finally moved. Now we are on the fourth floor of a fancy new building on the corner of Vapzarov and Cherni vruh. It is quite a nice place, but for me it is still bit hard to perceive it as my new home :) So the place looks great, but there are some things to complete to get it right. First, we don't have persiennes yet and the sun shines right in my face. Next, the distraction level is too high. The noise factor from outside traffic and the frequent telephone ringing in the room I work, are too much for my ears and I am glad I got those good big headphones a while ago :)

The place is not far away from where I live, and it takes me less than 15 minutes to get there by tramway (or 30 to by foot). Its location is good for my weekly basketball practice (usually held in a the NPMG highschool nearby). It is also close to Sofia Land and to Spartak swimming pool (both are places I regularly visit). Cool!

September 03, 2004

.NET bug databases (and more)

While I was reading some of Jeff Key blog stories, I saw him mentioning a bug he had discovered. The feedback comments took me to the following .NET errors sites (may be worth knowing about) Error Bank and .NET Bugs Registry. The second one has only 22 bugs listed, half of which are fixed in 1.1 (and probably more are fixed in the new .NET framework service packs). Well, I think it is more worthwhile to report directly to MS then to such unofficial site.

By the way this guy Jeff has developed some great tools. He is most famous for his Snippet Compiler, but I will also include in my toolbox the following items:
IsDebug - checks if an assembly was built in Debug or Release mode
ControlPaintTester - a quick way to test the display of controls, playing with their properties
Ruler - measures pixels on screen display
Access Query Analyzer - executes simple queries against MS Access DB (I remember I wrote something similar in VB6 a while ago)
... and much more