mohit | Shared With: Everyone - Mar 25 2008 | events, development, c#, asp.net, codesmell
Quoted: Whether you put your logic before or after calling base really depends on the scenario. Personally I always call base last, at the bottom of the method, just because in general I think it makes sense for my component/control to do its own 'X' before raising the 'X' event for external listeners to respond to. If I want to know about anything those external listeners have done to me, then I could have more code after calling base. But let me just say I can't really even think of a time where this should matter. If you end up with code that needs to worry about this, then just pause and consider your design, it's a CodeSmell. You should be able to design it in a manner that doesn't depend on such subtlety.
Related Content from Around Faves
c
-
I am going to use this to clean up the html for some of the sites I maintain. The author (Omar Al Zabir, CTO of pageflakes) is one of the best .Net developers around.
1 FaverViewed: 38 TimesQuoted: Convert HTML to XHTML while applying tag and attribute filters in order to produce nice and clean HTML for web posting.; Author: Omar Al Zabir; Section: C#; Chapter: Languages
- mohit - Feb 29 20082 FaversViewed: 12 Times
- tsupo - Apr 24 20071 FaverViewed: 20 Times
