Wednesday, July 20, 2011

Dialog based Win32 programs

This is the kind of program I write most: C/C++, pure Win32 API, dialog box based. Over the years I developed a couple of handful routines that I believe to be pretty solid nowadays, since I use them without any modification for some years already, and they work flawlessly.

I decided to share this knowledge with everyone mainly because today I see a lot of .NET programs – or even worse, WPF – that most of the time they could have been written in good Win32, avoiding the huge amounts of bloating you have to carry with those “modern” libraries. I know C/C++ is not for everyone, pointers demand care, but I strongly believe that any respectable programmer should have a clear understanding of the C language. Otherwise, he’s just a script kiddie.

Modern languages with garbage collectors overprotect the programmers, much like those overprotective parents do with their children – and we all know these children become problematic, limited adults.

So stop being lazy and go learn C. And after you learn C, you can read my article on Win32 programming, that I published on CodeProject today.

Thursday, July 14, 2011

uTorrent is dead

Last month, my uTorrent client – actually written as “µTorrent” – updated itself to version 3. Well, I always was a huge uTorrent fan, mainly because it’s simple and lightweight, as its slogan says.

But after that update, I had a surprise.

The new uTorrent interface showed itself full of gadgets, lots of new buttons and a bunch of useless new features – I totally hated all that stuff. What about that slogan? It took me some time to figure out how to hide all that stuff from my eyes, so that I would see only the torrent list. After a couple weeks, I began considering rollback to the previous version.

The last stable version of the 2.x branch is uTorrent 2.2.1 build 25302, which albeit has a bug where the tray icon never goes away, corrects some memory leak bugs from 2.2, among others.

Since the new versions probably will remain bloated, I’ll stick with 2.2.1 until I find another client worth changing – at this moment, I doubt I’ll find one. Also, after completely remove 3 and install 2.2.1, I instantly noticed a performance increase: version 2.2.1, being much more simple, is faster as well.

Quoting Leonardo, simplicity is the ultimate sophistication.

Sunday, July 10, 2011

The browser version race

The browser wars is a good thing, since you have the browsers competing for the market share by offering improvements and new features. The truly winner of the browser wars is the browser user.

However, there’s another war in course, which I read about a couple weeks ago, and they named it the version race, or the version wars. It seems that providing new features and improvements on the browsers is not enough anymore: one must provide a freshness of a “new browser”, and this is being achieved by increasing the major version number each new release. As a programmer myself, I found it really annoying.

Version numbers have their significance, and it’s being lost now. Let me explain one of the most common interpretations: for example, let’s take the “1.7.4” version number. Here, the “4” is the release number, and it should be increased each time the developer publishes some correction, bug fixing or some minor feature which doesn’t break compatibility with the current version.

The “7” is the minor version number, which is increased each time you have a significant new feature, maybe with some minor compatibility break (usually corrected by the program itself), but despite the improvement, you’re still on the same major version.

And the “1” is the major version number, which is increased every time you have a big change on the program, often with a significant part of the source code being entirely rewritten. It’s almost like a new program under the same name.

I remember when Google Chrome browser was launched in 2008, and everybody was amazed with its fast evolution, with a galloping major version number increasing. Then at some point, with so many major version numbers (and minimal improvements), people simply didn’t care about it anymore. In the future, when Chrome really have something new to show… it will be just another version number, because they wasted the whole arsenal of numbers already.

The worst: Mozilla entered the version race with Firefox 5 in June of 2011, which should have been versioned just as “4.1”.

An alternative to this is join the Microsoft boat, which likes to use years as version numbers, like “Office 2010” – although internally they follow the regular version number convention. This year-versioning is good, because it gives you a clear sense of time, you quickly associate the program with “how old” it is. Maybe a month/year versioning for the browsers, since there are several versions within a year. But what about “Chrome 7”? What do you associate it to nowadays?

Version race leaves a blurry track behind the software evolution. Stop the version race.

Saturday, July 9, 2011

Replay Gain

I’d say this Replay Gain thing is the coolest thing that appeared on the personal computer music listening world since the birth of Winamp in 1997.

How it works: first you use a Replay Gain scanner to add a couple new tags to each song of your music library. These new tags stamp a relative perceived loudness level corrector to each song, so that when your player plays them, it will raise or lower the volume accordingly, and all the songs will have the same volume (or almost), and you don’t need to raise/lower the volume yourself anymore. This is specially useful if you have a long playlist in shuffle mode, with songs at all sorts of different volumes.

Several music players of today implement Replay Gain, but some of them don’t perform the scan. If you want a suggestion, try foobar2000, it can do all the job.

Corollary: if you have a large and heterogeneous music library, Replay Gain will make you smile.

Now on the technical side: I found what it seems to be the C implementation of the Replay Gain scanner at the (rather old-school) project site. It really drove me curious, I guess I’ll download and try to compile it later.

About this blog

Hello, dear reader.

There are times when you just want to say something, or maybe share something which seemed interesting at that moment, or maybe just voice your opinion about a particular event.

Well, that’s why I’ve just created this blog. I have no idea about what I’m gonna write down here, there’s nothing specific, just writing away. And as a first post, I just wanted to register the idea of this lack of ideas, and at the same time, the high amount of them.

So be it.