{ Code: Impossible } | this = HowI.Roll();

Archive for July 2008

Jul/08

22

Code comments = respect

I was browsing around Code Project the other day, I subscribe to their most recent submissions feed to watch for interesting samples, and I saw a unique take on a logging system.

It used IL replacement, much like TypeMock Isolator, to allow developers to enable/disable the logger without having to compile any code.

In theory, I haven’t tried it out yet, you would be able to add this logging system to any project without coding anything.

I downloaded the code and it’s huge. 5 assemblies, over 2000 lines and there is some COM stuff in there. I notice two things. First it’s all in c++. This is not a bad thing it’s just not my first language.

So I start looking around for some comments to let me know what the heck is going on in this code.

Annnnnnd… hmmmm thats odd.

There are no comments. Not one. I checked the author notes on the original submission article to see if this was an error and there was an updated link.

Nope. Nothing. It takes me a minute but near the bottom of the post I see why there are no comments.

The author writes:

“I like to think I write self-documenting code so I tend to not have any comments in my code.”

I instantly deleted the code from my system. My thought is if the author of this code didn’t think it was worthy of some kind of explanation then I am certainly not going to waste my time with it.

Comments aren’t just some “nice to have” thing. They show that you actually care about what you are putting out there and they show your thought process throughout the codes execution. If you don’t care about that then why would I?

I’m not saying that every line, function call and variable needs a comment but any programmer worth his salt should put some form of documentation into his/her code. It’s a sign of respect.

So my fellow developers let’s respect each other enough to document what we put out into the world. What do you say?

· ·

Jul/08

21

iTunes doesn't grok "synching"

I got an iPod Touch few weeks ago and I have to say that I am really happy with it. It has some hangups, like how come I can’t use it’s WiFi connection to download new podcasts, or why can’t I save a mp3 file locally from it’s safari browser, but for the most part it is a great piece of tech. The 2.0 firmware added a lot more worth with the App Store applications.

However iTunes is still less than stellar. iTunes is like being chaperoned on your first date. If you want to hang out with the iPod, iTunes is going to tag along.

iTunes’ slow, ugly, and cluttered UI hasn’t changed since the last time I used it ( version 6 dot something) and although finding and downloading podcasts has improved, how iTunes synchronizes to the iPod has not.

When I connect my iPod to my pc iTunes loads and begins synchronizing my data. However, if I download new content iTunes ignores it and does not synch it.

Even if I have specified that all types of that content are to be synched I will have to manually trigger iTunes to synchronize.

This is very bad from an end-user perspective. All developers writing software that synchronizes to/from an external datasource listen up: a user should not have to tell the software when to synch.

A user should be given the option to manually synch or to completely disable auto-synching but by default the system should synch new content “automagically”.

Don’t make end-users tell your software it’s ok to do what it is supposed to do because we don’t want the hassle.

· ·

[youtube=http://www.youtube.com/watch?v=e45J0SCXO5s&eurl]

*sigh*

· ·

I never knew this but Firefox 3 has a new feature that allows you to select multiple lines of text. Just use the ctrl key (cmd on Macs) while selecting text as you normally would.

If you find it isn’t working check that you have firebug disabled as it is known to interfere with this feature.

Enjoy!

Theme Design by devolux.nh2.me