Let me share you with one of the weirdest errors I ever encountered. Recently, I have been working on a distributed application which is built from a server and some clients. The clients are Windows Forms applications. Yesterday, I spent a whole day chasing a very weird and strange error – I was getting an exception at the main method (unhandled exception) of the client application. Here is what I got:

image

The error description was:


Continue Reading...

Is it OK to throw exceptions from constructors? Some of us may have heard that it is wrong but don’t really remember why. There are lots of philosophical arguments about this question, you may become confused trying to understand what’s the right thing to do. Does it mater if we are developing with C++ or any other .Net language like C#? I am writing this article to shed some light on the “throwing exceptions from constructors” topic. 

 

Constructors can’t return values, so we pretty much have to throw an exception to indicate that the object couldn’t be constructed. Some of you may grasp that constructors are supposed to handle simple tasks…


Continue Reading...

hell I have been wanting to write this series of articles for a long time. Over the years I have come across very bad code examples and I have always wanted to share them with you guys, kind of in the way of "Watch and DON’T learn" :).

 

Everything you are about to see in this series is based on my personal experience and completely real, so before we begin I have only one request:

 

Don’t try this at home! :)


Continue Reading...

I used to love using Digg, reading, submitting and digging. But no more! From now on I HATE them. I know Hate is a strong word, but hear me out and understand why I used this strong word.

On Friday the 13th of June I tried to submit one of my articles to Digg and I got the following error message:

This URL has been widely reported by users as being regularly used to spam Digg’s submission process and cannot be submitted at this time.

Weird I though to my self, probably just a glitch and right away I wrote an E-Mail to the Digg Support, here it is:


Continue Reading...