<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx</link><description>In the category of &amp;quot;I couldn&amp;#39;t make something like this up even if I tried&amp;quot; comes the following code. Rather than try to dissect what it is that&amp;#39;s wrong with it, it&amp;#39;s a lot easier to find what&amp;#39;s right with it. If the person that</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Charles Mark Carroll Blog  &amp;raquo; Blog Archive   &amp;raquo; With even minor fame comes major infamy</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#1270729</link><pubDate>Sun, 28 Oct 2007 13:09:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1270729</guid><dc:creator>Charles Mark Carroll Blog  » Blog Archive   » With even minor fame comes major infamy</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Charles Mark Carroll Blog &amp;nbsp;&amp;amp;raquo; Blog Archive &amp;nbsp; &amp;amp;raquo; With even minor fame comes major infamy&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1270729" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#539253</link><pubDate>Sat, 03 Feb 2007 07:05:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:539253</guid><dc:creator>Bill</dc:creator><description>&lt;p&gt;Frans:&lt;/p&gt;
&lt;p&gt;Sadly, you are correct (aren't you always ;-) &amp;nbsp;). &amp;nbsp;This expert grates my nerves pretty bad, but this code is all too common. &amp;nbsp;You just don't expect it when it comes from Self Proclaimed Gurus&lt;/p&gt;
&lt;p&gt;Are you going to jam Smoke on the Water at the Summit?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=539253" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#539240</link><pubDate>Sat, 03 Feb 2007 06:58:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:539240</guid><dc:creator>Bill</dc:creator><description>&lt;p&gt;Punksaphony Phil - Ouch. &amp;nbsp;Be fair, the arteries and veins in Phil's head would have exploded if he saw code like this&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;There can be only one that writes code like this&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=539240" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#539212</link><pubDate>Sat, 03 Feb 2007 06:30:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:539212</guid><dc:creator>That guy you know in Redmond from the place</dc:creator><description>&lt;p&gt;So did this code come from Charles &amp;quot;Still the undisputed champion of Classic ASP&amp;quot; or was this from &amp;quot;Punksaphony&amp;quot; Phil?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=539212" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#538932</link><pubDate>Sat, 03 Feb 2007 03:36:10 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:538932</guid><dc:creator>William</dc:creator><description>&lt;p&gt;Hi Stan:&lt;/p&gt;
&lt;p&gt;I don't think I've seen your name here before so welcome aboard. &amp;nbsp; I understand your confusion but I think you may be a little off base. &amp;nbsp;I grabbed this code from a mailing list and didn't post all the information about it to, well, protect the innocent so to speak. &amp;nbsp;For one thing, the title of email was &amp;quot;Yee haa DataGridView horrible challenge finally resolved. &amp;nbsp;One of the reasons I posted it was b/c of the arrogance of the guy writing it. I believe he mentioned it in this snippet, but in the full email he also emphasizes that his coworkers were unable to solve this problem. &amp;nbsp;It's impossible to know for sure what's in someone else's mind, but the verbiage of the thing is definitely condescending to the other developers and juxtaposes it with &amp;nbsp;a &amp;quot;look how smart I am b/c I figured it out&amp;quot; tone.&lt;/p&gt;
&lt;p&gt;So this was real production code. &amp;nbsp;This was posted as a solution to a problem. &amp;nbsp;Giving the guy the benefit of the doubt to the point of being pollyana, the question that begs to be asked is &amp;quot;if you're posting this as a solution and it's really not how you intended to code it, why *all* of the glaring mistakes&amp;quot;. &amp;nbsp;I guess you can read the statements as an admission about this particular class but to be honest, it really doesn't look that way to me. &amp;nbsp;The reference to other spaghetti code for instance is kinda funny b/c if this itself isn't the epitome of spaghetti code, I don't know what is. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The statement &amp;quot;I probably will redo the EvalNumber function soon to ve cleaner and maybe with generics to support more numeric types than decimal&lt;/p&gt;
&lt;p&gt;(int, double, etc.) but this app only needs decimal.&lt;/p&gt;
&lt;p&gt;&amp;quot; - surely doesn't seem to back up your assertion. &amp;nbsp;If it said &amp;quot;Now that I got the Parse issue sorted out, I can clean up the rest of this stuff that needs a lot of work...&amp;quot; - I'd expect something of that sort at a minimum. &amp;nbsp;Generics are singled out as an improvement and he states he'll 'probably' redo it. &amp;nbsp;The real problems with this code are far and deep and enhancing flexibility with Generics is probably Item 20 on any list of fixes. &amp;nbsp;All in all, I don't see anything to indicate that this code was something he deemed terribly incorrect.&lt;/p&gt;
&lt;p&gt;You raise a point that has me intrigued though. &amp;nbsp;When you mention Chain Letters - are those code related chains or are you referring to chain emails in general that try to sensationalize that which is otherwise dull? &amp;nbsp;Either way I get your point, but if you happen to be referring to code related chains - I'd be very appreciative if you could forward me a few of these &amp;nbsp;for I've never seen one&lt;/p&gt;
&lt;p&gt;Anyway Stan, glad to have you around and I'll take your comments to heart. &amp;nbsp;Thanks again man.&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=538932" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#537848</link><pubDate>Fri, 02 Feb 2007 18:51:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:537848</guid><dc:creator>Bill</dc:creator><description>&lt;p&gt;Stan:&lt;/p&gt;
&lt;p&gt;Well, I appreciate your comments but I'm not sure I'm reading the same comments as you. &amp;nbsp;This code was posted as a solution to the problem and of the things he mentions he's going to clean up, well, he doesn't mention the truly heinous aspects of it. Moreoever, just look at it carefully. &amp;nbsp;Some of the most serious problems are just ones that have utterly no place being there at all. An assessment was made that this code looks like that of a complete beginniner or someone with little to no understanding of my many features are supposed to be used. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;When I read the comments, I see an admission that someone spent dayS on this. &amp;nbsp;And that 'it's ok' b/c the original developers spent months and couldn't get it to work. &amp;nbsp;To be completely candid, if code is as whacked as this, and you are a billable consultant, you owe it to your client to fix it in a timely manner. I understand not rewriting an application and working with what you have, but this is &amp;nbsp;very simple functionality (at least the correct solution should be - there's nothing 'simple' about the way this code was implemented.&lt;/p&gt;
&lt;p&gt;I honestly wasn't trying to be sensational here or make the story more exciting. &amp;nbsp;From my POV, this is code written by a self-proclaimed guru and this sort of code is completely unacceptable for a billable consutlant to implement. &amp;nbsp;The guy berates other spaghetti code but if this isn't spaghetti, I don't know what is. &amp;nbsp; If you were paying for this stuff by the hour, would you be ok with this being the result of multiple days (I wouldn't even be ok with paying multiple hours)?&lt;/p&gt;
&lt;p&gt;I personally don't mind my code that I bill for being subject to rigorous examination. Do I make mistakes? Yes. Have I written stuff in a hurry before? Yes. &amp;nbsp;Have I written code that I thought was ok then realized it was garbage? Sure. &amp;nbsp;To that end, I really don't mind someone pointing it out. I've had people take issue with some of my demo code and in each case, my response has been &amp;quot;Point taken&amp;quot;. I'm willing to accept criticism for demo code I post to a web site for free, so I'm *** sure willing to hold myself to an even higher standard on stuff I bill for. And &amp;nbsp;were I to write something like this, I would feel obligated to fix the stuff on my own time if I had billed for it in the first place. The client shouldn't suffer b/c of my lack of knowledge/understand or the fact I may have been in a hurry.&lt;/p&gt;
&lt;p&gt;Your point about sensationalism is duly noted, but I'm going to respectfully disagree in that I think consultants have a bad rap b/c of people who do stuff like this and bill for it. &amp;nbsp;And I think drawing clears lines in this regard is entirely appropriate.&lt;/p&gt;
&lt;p&gt;One last thing - I don't understand your comment about chain letters. &amp;nbsp;Are you talking about chain letter in general - or about Coding WTF emails? &amp;nbsp;I've never recieved such an email. If you actually get Coding WTF emails - I'd honestly be interested in seeing what such a thing looks like, would you mind forwarding me a few? (I know you probably have better stuff to do with your time then forward some guy you don't know emails but if you have a few extra seconds, I'd be appreciative of it)&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=537848" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534835</link><pubDate>Thu, 01 Feb 2007 21:31:44 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534835</guid><dc:creator>Stan Woods</dc:creator><description>&lt;p&gt;I'm confused. &amp;nbsp;You say this is production code, but whoever wrote this and the comments you posted -- after the code, in the last paragraph -- openly admits that this is ugly, and then goes on to say how he/she is going to clean it up.&lt;/p&gt;
&lt;p&gt;Crap code is crap code, but let's not get all ZDNet-sensational here just to make a story more exciting. &amp;nbsp;I get enough chain letters like that in my inbox every day.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534835" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534832</link><pubDate>Thu, 01 Feb 2007 21:29:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534832</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;You know what this kind of code is good for? When you are on a board and some newby asks you &amp;quot;how do I do x&amp;quot; you send them a PM with that code and say &amp;quot;well I didn't want to show this in a public forum but this is the correct way to do it&amp;quot; and see if they are dumb enough to use it at their company :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534832" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534622</link><pubDate>Thu, 01 Feb 2007 18:41:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534622</guid><dc:creator>Roland Boon</dc:creator><description>&lt;p&gt;I like it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534622" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534609</link><pubDate>Thu, 01 Feb 2007 18:27:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534609</guid><dc:creator>Roland Boon</dc:creator><description>&lt;p&gt;Okay, being 14 hour late, I need to appologize, and then get on with it, and write my name on this mirror/wall.&lt;/p&gt;
&lt;p&gt;You see, the reason is that I've been partying a bit; for the [x] time, after being blinded for far too long, I'm once again happy not to be by myself.&lt;/p&gt;
&lt;p&gt;Please hold on; subject in question is preparing supper.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534609" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534608</link><pubDate>Thu, 01 Feb 2007 18:26:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534608</guid><dc:creator>Kevin Jones</dc:creator><description>&lt;p&gt;I am confused. What the hell is this code actually doing? Is it suppose to give headaches?&lt;/p&gt;
&lt;p&gt;I feel a lot better about my job security now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534608" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534466</link><pubDate>Thu, 01 Feb 2007 17:30:13 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534466</guid><dc:creator>Frans Bouma</dc:creator><description>&lt;p&gt;Bill, why did you post my code on your blog? &lt;/p&gt;
&lt;p&gt;;) :P&lt;/p&gt;
&lt;p&gt;This is indeed horrible crap, however, as I read the DailyWTF daily, I know that out there, a large group of high-payed consultants fill their pockets with cruft like this every darn day... &lt;/p&gt;
&lt;p&gt;The sad thing is... in our lives, every day we use services which are build on drivel like this... &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534466" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534311</link><pubDate>Thu, 01 Feb 2007 16:10:58 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534311</guid><dc:creator>William</dc:creator><description>Sahil - I agree with your assessment but this person isn&amp;#39;t fresh out of school b/c he didn&amp;#39;t go to school. However I know a few programmers that are totally self taught that are total bad a55e5.  In order to write code this bad, you need to have a certain level of arrogance and think you know what you&amp;#39;re doing. Newbieness has more randomness to the mistakes - this garbage is intentional.  In school we get certain things beat into your head that after the first semester you know never to do - like having 25 exit points in a function.  This code illustrates that the person has no idea about design or implementation and even less of a clue about the framework.  In many countries, they&amp;#39;d cut off your right hand if you were caught coding this stuff  It&amp;#39;s criminal to think that the person that wrote this not only claims to be a professional but a guru.  Yes, they clearly Lurned .Net.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534311" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534275</link><pubDate>Thu, 01 Feb 2007 15:33:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534275</guid><dc:creator>Sahil Malik</dc:creator><description>&lt;p&gt;This code is rife of beginner mistakes. Looks like the work of someone who hasn't had too much experience in actual coding - typical of a fresh out of school guy in his first job. I think with time, and enough mentorship, he may just be able to write good code, one day. &lt;/p&gt;
&lt;p&gt;Bill - is this someone you are helping lurn .NET?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534275" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534252</link><pubDate>Thu, 01 Feb 2007 15:24:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534252</guid><dc:creator>Bill</dc:creator><description>Just as a reminder, I do not censor comments.  The only comments I&amp;#39;ll edit or delete are spam.  With that in mind, there is a major crybaby or two that reads my blog and throws temper tantrums every time he reads something he doesn&amp;#39;t like.  Without exception the things he doesn&amp;#39;t like happens to be comments making fun of him or his master.  So, although I wholeheartedly concur about the comments here, I&amp;#39;d prefer that less brash names and language are used.

So I&amp;#39;m a little torn b/c I think it is incumbent upon professionals to disavow code of this sort, as well as frauds that hold themselves out as experts and put out garbage like this.  I think it gives consultants a bad rap - not to mention that MS bashers often seize upon terrible code like this whenever it gets hacked or blows up, and tries to blame Microsoft for it.

So if you&amp;#39;re reading this, please understand two things - 1)  There&amp;#39;s some harsh language here by some of my commentors.  To that end, I apologize but I just don&amp;#39;t have time to sit around and edit out comments I find unsavory. it&amp;#39;s hard enough just managing spam. 2)  Code like this is a crime. No developer with an ounce of skill, self respect or integrity would pump crap like this out and charge you for it. &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534252" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534226</link><pubDate>Thu, 01 Feb 2007 15:18:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534226</guid><dc:creator>Bill</dc:creator><description>Brian - I don&amp;#39;t write perfect code myself and have written a lot of stuff in a hurry that I would rather disavow. However the person that wrote this code is a consultant and a self-styled expert.  This person brags incessantly about their coding prowess.

The funny thing about it is that a year or two ago, I posted about this person&amp;#39;s code and pointed out almost verbatim these terrible habits. They said I was nuts, making it up, etc.  Dude, this is production code. This is their real solution.   And all I&amp;#39;m saying is that if you code like this, you shouldn&amp;#39;t hold yourself out as an expert, guru, boss or anything else and you damn sure ought not be training people.  If this was a blog post about something, or some demo code you rolled off the top of your head, it&amp;#39;d be a lot more understandable but nope, this is production code.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534226" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534151</link><pubDate>Thu, 01 Feb 2007 14:48:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534151</guid><dc:creator>Summers Eve Nelson</dc:creator><description>&lt;p&gt;There's just so many things wrong with that code I don't know where to begin. If I was to point out what he did correct, all I could say is he or she knows how to use curley braces correctly. What really makes me laugh is if (CellTypeCalc(e.RowIndex, e.ColumnIndex, this) == false) as it should be if (!CellTypeCalc(e.RowIndex, e.ColumnIndex, this)). But, that's one of the many flaws of this code. The use of so many try/catches makes me want to vomit. Not to mention the horible naming standard. This is definately not the work of a guru. A beginner, yes. A guru, no. It's people like this that rip of companies that make me mad. I think I had an epileptic seizure while reading this code.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534151" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#534043</link><pubDate>Thu, 01 Feb 2007 13:35:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:534043</guid><dc:creator>Brian H. Madsen</dc:creator><description>&lt;p&gt;without knowing the circumstances (and the experience level of the guy/girl doing the work) it's hard to relate...&lt;/p&gt;
&lt;p&gt;ok - that was the GOOD deed of the day...i'm shocked to see such badly written code - but unfortunately it's very common these days..what i'm disgusted by is the lack of professionalism in the comment section. basically sounds like the developer just &amp;quot;tried&amp;quot; to accomodate the client with a hack and justifying his/her own lack of skill.&lt;/p&gt;
&lt;p&gt;other than that, why no regular expressions was used and ffs - refactor some of that stuff out..Jeremy mentions the Logger.*...well - waste of bytes if you ask me.&lt;/p&gt;
&lt;p&gt;i may not be a perfect coder myself - but at least i try and this is just hogwash.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=534043" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#533412</link><pubDate>Thu, 01 Feb 2007 08:28:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:533412</guid><dc:creator>Jeremy Brayton</dc:creator><description>&lt;p&gt;This seems like a case of trial-and-error coding. Sadly, I can relate.&lt;/p&gt;
&lt;p&gt;SalesLogix uses VBScript and has stock code that queries Err for any errors returned and then prints an error message. The problem with this is it isn't specific on when the error occured so it could be right before the function call or on line 1 of a 800 line routine. To trap where specific errors were I would liter code with these calls and I could pinpoint roughly where an exception would occur. Usually I'd fix what triggers the error and remove the check but it's usually not a bad idea just to keep them in. This code would almost be the C# equivalent of some of my work if I ported it straight.&lt;/p&gt;
&lt;p&gt;I can see this person in testing trying different scenarios, running into multiple exceptions then encapsulating the error in a try/catch statement as they go. Each try/catch roughly handles one problem and moves on. I tend to think about them first and group error prone code in one big try/catch statement that roughly does the same thing. DB manipulation deserves one, straight math deserves another, etc. There are exceptions to this rule, like when one particular block throws every exception known to man but it's generally a forthought, not after-. What I find funny is the Logger.* call that apparently signals to a logger that the code is doing something but you don't see the log reporting any exceptions. Why even use a logger if you can't report meaningful stuff along the way?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=533412" width="1" height="1"&gt;</description></item><item><title>re: Programmatic Malpractice</title><link>http://msmvps.com/blogs/williamryan/archive/2007/01/31/programmatic-malpractice.aspx#533255</link><pubDate>Thu, 01 Feb 2007 06:43:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:533255</guid><dc:creator>Ron P</dc:creator><description>&lt;p&gt;You evil SOB, you are talking about &lt;a rel="nofollow" target="_new" href="http://www.charlescarroll.com"&gt;http://www.charlescarroll.com&lt;/a&gt; aren't you? &amp;nbsp;If he trains as bad as he codes I'm just glad I never took one of dude's classes. &amp;nbsp;Cuz that sh1t is like school on Sunday man. &amp;nbsp;At least homeboy uses try/catch blocks right &lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/system.data.datatable.newrow.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.data.datatable.newrow.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=533255" width="1" height="1"&gt;</description></item></channel></rss>