wtorek, 12 maja 2009

Roots of all evil

There are some roots of all evil that hides in code. Let me just enumerate them:

1. Premature optimization (yep, classic...)
I thought that was so obvious but reading self-paced training kit for 70-536 exam i came across that brilliant observation:
For example, you might have three numbers to store that are fairly small. The first number might have a maximum value of 10, the second a maximum value of 50, and the third a maximum value of 500. You could store these as three Int16s but you’d be wasting space. Instead, you should use a BitVector32 to store all three values in a single 32-bit number.

Come on... ;)

2. Bad abstraction (yep linq2sql, i'm talking about you. where are you hiding webforms?)
Just don't get me started on that (i hope i will write bigger notes about all of these points but now i'm just enumerating them)

3. Code generation.
IMHO code generation is just another way of doing copy & paste - one of my favorite programming principles.

4. Improper error handling.
If you can't handle your errors just, please, make them fatal. Display error page or whatever. All i want you to do is at least to write everything to error log and then fail hard. Let the carpet be covered in blood but don't do it silently. Writing stack traces on the screen is hmmm... controversial ;) Just please, don't swallow all the exceptions and do nothing with them.

sobota, 9 maja 2009

My name ain't important

Welcome everybody.

This is the first post on this blog so I want to state what I'll be writing about.
I will primarily focus on everything that is related to programming, especially in C# and .NET.
I will mostly rant about everything that makes me angry in other people's code and their design ideas. It won't be very serious, though.
I also hope that this blog will help me remember some technologies I have to learn now and I will forget tomorrow. Some observations may be helpful to other developers who struggle with problems in their software solutions.
This blog is not about my life or about my job. However, posts will be my subjective opinions on various computer science aspects and inevitably will reflect the things I'm currently working on at my work.

Almost forgot one thing...
My name I is really un-important! If you wanna keep on being a wise-guy, you'll find out just how un-important....like...un-important I just got shot in the head un-important! Do I make myself clear?!?