Random thoughts...

Aug 01 2008

Making wrong code look wrong!

Why is this bad?
char* dest, src;

And Why is this dangerous?
if (i != 0)
foo(i);

What is wrong with this?
s = Request(“name”)
write “Hello!” + s

Keep functions short. If a function cannot be viewed from a single screen and needs scrolling, it is time to refractor your code. Why?

Why this line in c++ doesn’t really say anything about what it does?
i = j * 5;

What’s wrong if dosomething() throws an exception?
dosomething();
cleanup();


One line answer that Joel gives for all above questions is “It doesn’t make wrong code look wrong!”.

Read more here: http://www.joelonsoftware.com/articles/Wrong.html

An interesting read!

:-)
Page 1 of 1