Dec 172009
 

Finally! I’m done with Episode 7! Sorry for the almost 2 months delay of DigressCast but there will be more episodes quickly released more often from now onwards. Anyway, we have our first listener of DigressCast joining us for this episode. We’re actually trying this new format for DigressCast to be a little more serious with a touch of funny. Let us know what you think of this format.

DigressCast Episode 7: The Semi-serious Tech Discussion

Dec 172009
 

Well, this is part 3 already. I hope you’ve enjoyed and appreciated the last 2 part and understand my pain. Well, here’s something that doesn’t seem all too convoluted, but could have been achieved with just 1 line of code. By the way, just for those who don’t know, there isn’t really anything syntactically wrong with any of these code.

[sourcecode language="csharp"]
for (int i = 0; i < 24; i++)
{
string strIndex;
if (i < 10)
{
strIndex = "0" + i.ToString();
}
else
{
strIndex = i.ToString();
}
// … do more stuff with strIndex
}
[/sourcecode]

It’s slightly tougher to understand why this is bad code for those inexperienced. For those you understand why you should not write this code, good for you! You’ve got some developer sense in you. Till the next part, I hope you enjoy this code. Learn not to write like that, please.