Wednesday, December 12, 2007

"Lead" as in "heavily going down...."

No, really, think about it at, well, you know the company... First, what does the title of "lead" really means? It's like, you are fishing, and putting something heavy on your line so that it SINKS. Is it really what you want with our business????

Saturday, April 21, 2007

No Style Is Perfect.... a case for passing args by reference in C++

Let's say you have a style guide that says: "Never pass parameters by reference in C++ unless it's const"

Sounds fair, isn't it? After all, passing by reference is indeed fairly confusing concept. You see a variable like a local variable, but you can assign to it. Is it a good policy? Maybe. But lets see...

Assume you have a function like:

void DoStuff(Crap* crap) { ... }

You want "crap" to be mutable, so you cannot pass it as (Crap& crap) according to the policy. You have to pass a pointer.

Then in the main() you get a code like this:

main(...)
{
...
Crap crap;
DoStuff(&crap);
...
}

Now, guess what do you get in DoStuff after a bunch of junior developers changed it? Something like:

void DoStuff(Crap* crap) {
...
crap = new different pointer....
use crap
...
}

Crap...

No really, I just fixed the one like that. Not good. Crap. Keep an eye on things like that.

Monday, March 12, 2007

Never ever never ever...

No kidding. Never ever do that. Never. Ever. Seriously. Again, no kidding.

Big NO-NO.

BAD. REAL bad. Don't do that.

Ok, it may be good for a team or a company, but this is not good for you. Yes. No kidding.

NEVER OWN A PIECE THAT HOSTS EVERYBODY ELSE'S CODE.

I did. And I tel you, do not do that. Really.

Let's imagine you own a Windows service, like NT service. And it has a mechanism to host code of everybody else in the team. Guess, what comes next?

So, every idiot puts BAD code inside, and then -- naturally -- it breaks. If you work in a good company (like I do now), testers start to scream. Otherwise - customers, which is even worse. Anyway, somebody screams, and guess, what do they scream?

"YOUR service BROKE!!!!"

It's ridiculous how much of modern software development career is about visibility and how little of it is about really doing the stuff. In a few months you train testers to look into the logs and file the bugs against those, who created the problem. Yes, they are in the logs. Clearly. Black on white. Like "XXX.c line YY access violation...", and you look into version control and see the name of the guy, who last changed XXX.c. Easy, right? Not for those crying "Your service broke!!!"

Anyway, in the end, every bug is YOURS and every fix is THEIRS.

I'd love to ignore this, in fact, I tried it, well.... it DOES NOT WORK.

Don't do that. Let others pick their own crap.

Really.

No kidding.

Well, maybe at some other company in some better time... like another universe... but not now.

Do yourself a favor.