﻿<?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>Jon Galloway commented on It really happened, legacy programmers tales</title><description>I worked at a place that was constantly battling a SQL 6.5 limit on triggers at 8K characters per table (as I remember). Many of their triggers had already been "optimized" to turn each variable to use 1 character names and other minification techniques.
  
  
Due to timing issues on the triggers, it was impossible to tell what would happen when a row was inserted into the OrderDetails table, which was a problem because that was the integration point between all of their order systems.
  
  
The reason they were stuck on SQL 6.5 compatibility was that they had many Powerbuilder applications that couldn't work with newer versions of SQL Server.
  
  
That was the only job I've stayed at for less than a year. I tried to stick it out for a full year, but I just couldn't do it.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment29</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment29</guid><pubDate>Mon, 13 Sep 2010 05:55:12 GMT</pubDate></item><item><title>Steve commented on It really happened, legacy programmers tales</title><description>@scooletz,
  
  
That's a rather simplistic view, isn't it?  Maybe Griff has a wife and kids so just up and quiting isn't an option, maybe he's in a situation where he has medical problems and if he leaves his current place of employment that he will no longer get medical coverage (very common here in the US), or maybe it's just one aspect of his job he doesn't like, but the rest of it he's okay with so it's a necessary evil.  
  
  
Or it could be none of the above, but "either change it or leave" rarely is feasible in real life.
  
  
I've beaten this horse to death with Ayende via private emails already, but the biggest impediment of "being change" within a Microsoft shop is Microsoft itself.  Obviously the mothership isn't saying "build a 76000 line method", but they also don't promote good code quality either (look no further than crap like Oxite or their broken code on MSDN for examples).
  
  
This is a complex world, full of complex problems, and "lead or leave" is rarely the right solution.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment28</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment28</guid><pubDate>Wed, 08 Sep 2010 15:46:27 GMT</pubDate></item><item><title>Jason R. commented on It really happened, legacy programmers tales</title><description>"I upgraded from Super If to Black Hole Methods, and I am afraid to see what happen today, because if I get something that top the Black Hole Method, I may have to hand back my keyboard and go raise olives."
  
  
What? I've read this a dozen times, ignoring the grammatical errors, and I'm still not sure what you are trying to say.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment27</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment27</guid><pubDate>Tue, 07 Sep 2010 21:44:11 GMT</pubDate></item><item><title>Arnis L. commented on It really happened, legacy programmers tales</title><description>It definitely needs more parameters. Few hundreds of them.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment26</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment26</guid><pubDate>Fri, 03 Sep 2010 08:57:09 GMT</pubDate></item><item><title>tobi commented on It really happened, legacy programmers tales</title><description>This is unbelievable. The C# compiler team must be getting incredible bug reports because of the massive adoption of their product.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment25</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment25</guid><pubDate>Wed, 01 Sep 2010 21:07:47 GMT</pubDate></item><item><title>Mars Saxman commented on It really happened, legacy programmers tales</title><description>There is an entire industry full of terrible programmers who make a living writing custom apps despite having no idea what they are doing. 
  
  
I used to work on the compiler engine for REALbasic, and we would periodically get bug reports complaining about ludicrously bad compiler performance. At first I had trouble believing them - our largest test projects compiled in maybe 4-5 minutes, tops, so it was hard to imagine how anyone could be waiting 45 minutes to an hour for a compile.
  
  
Then we started getting bug reports with actual code attached, and some of the examples we saw were every bit as bad as the examples quoted above. Eventually we learned to stop saying "no real program would ever do this"; every time we would be proven wrong by the ingenious, determined perversity some of our customers used in place of clue. 
  
  
Seriously: single methods with 40k-50k lines of code. Conditional blocks nested over a hundred levels deep. Tens of thousands of local variables in a method. Single expressions, stacked up over line after line, containing thousands of sub-expressions, all executed as one statement. Classes with thousands of methods and hundreds of thousands of line of source code. Classes with thousands of methods, each containing a single statement.  Inheritance hierarchies a hundred classes deep.
  
  
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment24</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment24</guid><pubDate>Wed, 01 Sep 2010 20:57:15 GMT</pubDate></item><item><title>kioan commented on It really happened, legacy programmers tales</title><description>Hahaha! Graham, I agree about Chuck Norris! :P
  
  
Tell them that their code needs refactoring. Some critical parts should be written as external utilities in Brainfuck!  &gt;:-)
  
(
[http://en.wikipedia.org/wiki/Brainfuck](http://en.wikipedia.org/wiki/Brainfuck))
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment23</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment23</guid><pubDate>Wed, 01 Sep 2010 20:55:32 GMT</pubDate></item><item><title>Graham commented on It really happened, legacy programmers tales</title><description>The only person who can debug Black Hole methods is Chuck Norris.....
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment22</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment22</guid><pubDate>Wed, 01 Sep 2010 17:33:02 GMT</pubDate></item><item><title>Ashley commented on It really happened, legacy programmers tales</title><description>My jaw literally dropped when I saw the jump from 8 to 52. Care to share a little bit about what we missed in all of those lines?
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment21</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment21</guid><pubDate>Wed, 01 Sep 2010 16:02:06 GMT</pubDate></item><item><title>scooletz commented on It really happened, legacy programmers tales</title><description>@Griff
  
Have you heard about 'being a change'? If you don't want to hate your job, you either change your job or change your job.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment20</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment20</guid><pubDate>Wed, 01 Sep 2010 07:02:43 GMT</pubDate></item><item><title>Griff commented on It really happened, legacy programmers tales</title><description>ok, I work in a department where developers are writing code just like in the example right now!!!
  
  
not as extreme, if statements 500+ long, and nested ifs 50+
  
times.
  
  
Unfortunately for me and the other 2 good developers, there is nothing we can do.
  
  
Some developers won't listen, and some managers don't care as long at it works...
  
  
  
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment19</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment19</guid><pubDate>Wed, 01 Sep 2010 06:30:24 GMT</pubDate></item><item><title>Daniel Fros t commented on It really happened, legacy programmers tales</title><description>black hole methods is a great name. Great post!
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment18</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment18</guid><pubDate>Tue, 31 Aug 2010 19:02:52 GMT</pubDate></item><item><title>Jeff commented on It really happened, legacy programmers tales</title><description>Wow, cyclomatic complexity of 4k-8k? During a code review I found a method with a CC of 1200+ and I thought that was off the charts! That's just sick...btw, Black Hole Method? Best name ever!!!!
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment17</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment17</guid><pubDate>Tue, 31 Aug 2010 17:26:56 GMT</pubDate></item><item><title>Frans Bouma commented on It really happened, legacy programmers tales</title><description>whoa :) Someone actually hand-wrote 75K lines in a single method? Amazing :) What's more surprising: the developer apparently has compiled it somehow once, ran it and decided 'it worked'. 
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment16</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment16</guid><pubDate>Tue, 31 Aug 2010 15:19:29 GMT</pubDate></item><item><title>Scott Wojan commented on It really happened, legacy programmers tales</title><description>Ayende,
  
  
I believe that qualifies for SUPER massive black hole status.  I'd LOVE to hear a high level overview on what possibly could fill that amount of code in a "Get Employee" method.
  
  
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment15</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment15</guid><pubDate>Tue, 31 Aug 2010 14:17:55 GMT</pubDate></item><item><title>Panagiotis Kanavos commented on It really happened, legacy programmers tales</title><description>Reminds me of similar code I encountered in a legacy product created by the Consulting Services branch of a world-known multinational company (for its arrogance as well as its software), including this pearl 
[http://bit.ly/aBsckf](http://bit.ly/aBsckf)  
  
Anyway, you should consider almonds. They have a higher ROI than olives, but you have to pick them in the summer :P
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment14</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment14</guid><pubDate>Tue, 31 Aug 2010 14:08:13 GMT</pubDate></item><item><title>Juan Gomez commented on It really happened, legacy programmers tales</title><description>75.000 lines of code??? crap, you could fit an entire operating system there... I bet that method makes the server actually come to life and go hunt the "actual" employee. 
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment13</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment13</guid><pubDate>Tue, 31 Aug 2010 13:37:43 GMT</pubDate></item><item><title>Steve commented on It really happened, legacy programmers tales</title><description>A 75,500+ line method must require a ridiculous level of patience to write assuming that it's not some generated code that is simply cut and pasted in.
  
  
Someone with that much patience surely would think at some point "maybe I should break this bad-boy down a bit".  I've seen plenty of 1000 line methods in my days, but when you start approaching War and Peace size proportions, even the most stubborn programmer would start re-thinking their design, right?
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment12</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment12</guid><pubDate>Tue, 31 Aug 2010 13:27:36 GMT</pubDate></item><item><title>Frank Quednau commented on It really happened, legacy programmers tales</title><description>You people may be doing injustice to the programmer. He just commented his code really well.
  
  
Alright, it doesn't explain the JIT issue.
  
  
tbh, I can't even begin to think how to write such a method.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment11</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment11</guid><pubDate>Tue, 31 Aug 2010 13:18:54 GMT</pubDate></item><item><title>Paula commented on It really happened, legacy programmers tales</title><description>Brillant
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment10</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment10</guid><pubDate>Tue, 31 Aug 2010 12:55:29 GMT</pubDate></item><item><title>evereq commented on It really happened, legacy programmers tales</title><description>Ha, "It had a Cyclomatic Complexity of either 4,000 or 8,000, the client couldn’t remember." :) 
  
  
How many defects (not even related to JIT optimizations) such method contains than?
  
And it's only one method... What about whole application??? ;-) 
  
  
So few things raised in my hand:
  
  a) The client does not even hear about cyclomatic complexity, not just "couldn't remember how much it was" :D 
  
  b) I think your fix will have "short life-cycle" and probably you waste time trying to help, because such a code written in .NET simply can't work :)  :D :D :D OK, maybe it can, if they will substitute existed JIT compiler with own implementation with black holes support and optimizations :)
  
  
But if say frankly, we all from time to time dial with such "legacy" code (or better to say "legacy coding style from native C++) and instead of completely rewrite it, try to "fix" it, fix it and fix it... sometimes it's do work actually ;-)
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment9</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment9</guid><pubDate>Tue, 31 Aug 2010 11:29:17 GMT</pubDate></item><item><title>Mike Scott commented on It really happened, legacy programmers tales</title><description>These deserve posting to 
[http://thedailywtf.com](http://thedailywtf.com).
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment8</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment8</guid><pubDate>Tue, 31 Aug 2010 10:10:48 GMT</pubDate></item><item><title>Rob Ashton commented on It really happened, legacy programmers tales</title><description>Wow.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment7</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment7</guid><pubDate>Tue, 31 Aug 2010 09:52:01 GMT</pubDate></item><item><title>Uriel Katz commented on It really happened, legacy programmers tales</title><description>can`t say I saw something that bad,but I saw this kind of things alot of times,is it a company in Israel?
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment6</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment6</guid><pubDate>Tue, 31 Aug 2010 09:39:28 GMT</pubDate></item><item><title>Koen commented on It really happened, legacy programmers tales</title><description>Ayende, you gotta warn your readers before a post like this. I didn't have breakfast yet and I almost had to throw up :o/
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment5</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment5</guid><pubDate>Tue, 31 Aug 2010 09:23:16 GMT</pubDate></item><item><title>tobi commented on It really happened, legacy programmers tales</title><description>omg!!1
  
  
What was inside of the "find employee with filters" region? Was it the combination of all possible N filters and for each one a hardcoded query?
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment4</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment4</guid><pubDate>Tue, 31 Aug 2010 09:20:38 GMT</pubDate></item><item><title>Bjorn Coltof commented on It really happened, legacy programmers tales</title><description>Toggle all outlining!!! Plz.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment3</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment3</guid><pubDate>Tue, 31 Aug 2010 09:18:16 GMT</pubDate></item><item><title>cbp commented on It really happened, legacy programmers tales</title><description>@Marcus I'm guessing a black method is a method that is so massive, even light cannot escape.
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment2</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment2</guid><pubDate>Tue, 31 Aug 2010 09:16:51 GMT</pubDate></item><item><title>Marcus commented on It really happened, legacy programmers tales</title><description>What is a black hole method?
</description><link>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment1</link><guid>http://ayende.com/4612/it-really-happened-legacy-programmers-tales#comment1</guid><pubDate>Tue, 31 Aug 2010 09:06:46 GMT</pubDate></item></channel></rss>