We pay for user submitted tutorials and articles that we publish. Anyone can send in a contributionLearn More
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:
The error description was:
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…
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!
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:
Copyright © 2012 Dev102.com
Breeze : Designed by Amit Raz and Nitzan Kupererd