﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Asmur Trashir commented on Exception handling for flow control is EVIL!!!</title><description>@Steve Py: I wish I were kidding. First day in the company and I caught that. 
  
  
We were having issues with web services proxies. The ASP.NET web site was instantiating correctly every web service proxy (another ASP.NET project in the same solution) but executing any method would result in exceptions. 
  
  
The problem was that the programmer (yes, programmer. Programmers only type code, they dont understant what happens behind the scenes like a Developer) placed proxy service url's in VS designer sections, the ones that get deleted everytime You make a change in design. In devbox they were running fine, but at the client exceptions were thrown. Finding that resulted in finding the method I posted. Actually, I just copy-paste the original code, because I keep it as a reminder of what can go wrong when dealing with programmers instead of developers.
  
  
That same programmer made another web application that was single-user. By single-user I mean a web application that only allows a single user to be logged in and browsing the webapp. As soon as I could I rewrote it as a 3-tier layered desktop application.
  
  
What really hit me was my boss telling me "thats why we no longer hire new-grads. Thats why we are hiring now experienced people.", I almost yelled "so we are still wrong, we need people with good common sense...". Nowadays I personally interview candidates and I just ask them a few common sense questions like "I need to know if a Year is Leap, you have the next options as answers, you can select one or more or execute them in any order: google-it, search msdn library, ask for directions/tips, write some code.". If they dont discard write some code or have that as last resort I just end the interview thanking them and black-listing them.
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment12</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment12</guid><pubDate>Wed, 03 Nov 2010 08:47:30 GMT</pubDate></item><item><title>Steve Py commented on Exception handling for flow control is EVIL!!!</title><description>@Asmur: You've got to be kidding?! I mean, had that guy never heard of MSDN/Google/ etc?! IsLeapYear is already a method on DateTime since .Net 1.1,  Anytime I come across a requirement like that that I haven't come across before, the first thing I do is search the web. More than half the time, it's already part of the framework. The remaining 49.5% of the time someone has already come up with a pretty good solution.
  
  
Heaven help any developer I catch checking in something like that. They will be bringing in donuts and/or coffee for the team for a week.
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment11</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment11</guid><pubDate>Thu, 28 Oct 2010 22:25:06 GMT</pubDate></item><item><title>Nestor commented on Exception handling for flow control is EVIL!!!</title><description>Nice to see you again talking and working on NHibernate.  I think you got very busy with RabenDB.  Do not forget that there are still many people who follow you with the intention to know more about your experiences and advices with NHibernate.
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment10</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment10</guid><pubDate>Thu, 28 Oct 2010 19:10:02 GMT</pubDate></item><item><title>Asmur Trashir commented on Exception handling for flow control is EVIL!!!</title><description>And how about this, I saw this left by a previous worker of the company where I work and it was an ASP.NET application and this was broadly used:
  
  
public bool IsLeapYear(int year)
  
{
  
     DateTime leapYear = DateTime.MinValue;
  
     try
  
     {
  
          leapYear = new DateTime(year,2,29);
  
     }
  
     catch
  
     {
  
          // Year is not leap
  
     }
  
     return (leapYear != DateTime.MinValue);
  
}
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment9</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment9</guid><pubDate>Thu, 28 Oct 2010 08:10:02 GMT</pubDate></item><item><title>Frank Quednau commented on Exception handling for flow control is EVIL!!!</title><description>Yes, NHibernate call depth is also at times pretty hardcore...enjoy this one as example: 
[http://realfiction.net/go/173](http://realfiction.net/go/173)</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment8</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment8</guid><pubDate>Wed, 27 Oct 2010 20:42:23 GMT</pubDate></item><item><title>Alessandro Riolo commented on Exception handling for flow control is EVIL!!!</title><description>Such things are the reason why Ctrl+Alt+E is the most commonly pressed key combination on my keyboards :)
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment7</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment7</guid><pubDate>Wed, 27 Oct 2010 18:05:12 GMT</pubDate></item><item><title>Alex Simkin commented on Exception handling for flow control is EVIL!!!</title><description>Yeah, blame everything on Hybernate
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment6</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment6</guid><pubDate>Wed, 27 Oct 2010 16:16:31 GMT</pubDate></item><item><title>configurator commented on Exception handling for flow control is EVIL!!!</title><description>@Grimace: Yes, int.tryParse was only introduces in .Net 2.0... 
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment5</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment5</guid><pubDate>Wed, 27 Oct 2010 13:22:22 GMT</pubDate></item><item><title>Patrick Huizinga commented on Exception handling for flow control is EVIL!!!</title><description>I would like to add that the only exception (heh) I can think of is an OperationCanceledException or equivalent.
  
  
I once rewrote a few-hundred line method with "if canceled then return" all over the place (up to four levels deep) into a dozen methods with "if canceled then throw" and a catch in the entry method. Imho that made it much easier to follow.
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment4</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment4</guid><pubDate>Wed, 27 Oct 2010 13:21:46 GMT</pubDate></item><item><title>Grimace of Despair commented on Exception handling for flow control is EVIL!!!</title><description>Wasn't there a time in which the only way to foolproof convert a string to an integer in .NET was to wrap the conversion in a try...catch?
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment3</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment3</guid><pubDate>Wed, 27 Oct 2010 11:37:11 GMT</pubDate></item><item><title>wally commented on Exception handling for flow control is EVIL!!!</title><description>I think I've seen that one in other projects...
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment2</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment2</guid><pubDate>Wed, 27 Oct 2010 11:20:21 GMT</pubDate></item><item><title>NC commented on Exception handling for flow control is EVIL!!!</title><description>Link doesn't work :( 
  
  
Link makes bunny cry.
</description><link>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment1</link><guid>http://ayende.com/4674/exception-handling-for-flow-control-is-evil#comment1</guid><pubDate>Wed, 27 Oct 2010 10:09:34 GMT</pubDate></item></channel></rss>