tags:

views:

872

answers:

17

We've all had those moments: if coding was a spectator sport, the crowd would be cheering you on, and going wild when you score the goal / touchdown / try in the last seconds of the game.

This question is the opposite of the Confessions of your worst WTF. It's your chance to show off, and talk about your heroics to people that understand. That moment when you saved the day, and fixed the bug that was costing millions of pounds a day, or five previous developers couldn't fix it, or, like Harrison Ford, you attached a fax roller to an iPod and took a video screen shot of scrolling text.

It may be a small heroic that nobody else noticed, but you know, without doubt that you saved the day. Nobody else would understand, or even believe you, but you know. You know.

+10  A: 

It's not really heroic, more forward thinking. Our company had a product that needed too be programmed by a PC software suite which I was in charge of. One day the boss got it into his head that the program MUST be changed so that one version of the PC suite would be able to program only ONE version of the firmware. I tried to talk him out of it, but no that was the way it must be.

I knew that down the track, this would make our maintenance contractors baulk and request a change back to the old, so I developed a parallel version that could handle all firmware versions, and sure enough, one year later our customers were complaining like crazy because they had to have several versions of our software installed, all having different bugs. There were so many versions to keep track of that it was also driving the QA department crazy (and it was their suggestion in the first place). The boss came back and demanded that I restore things to the way they were because some customers were threatening to switch suppliers.

I had my secret parallel version ready for testing the very next day.

Vincent McNabb
Nice one! Filed under "Managing your manager"!
harriyott
There is nothing like proving the bossy boss wrong. Isn't it ;-)
ragu.pattabi
Do you think your boss is wiser now?
Brian G
+13  A: 

Dude, I'm in the middle of it so stop asking me questions. Sheesh!

Pat Notz
+10  A: 

We had a potential customer (mobile phone operator) considering our Java implementation. I had designed, written and tested the JAM/AMS.

They sent us 12 initial test cases covering awkward corners of MIDlet signing, telling us to make sure they all installed on our implementation.

I reported back to them that 3 (or was it 4? Long time ago.) of them didn't install, because the constraints defined by a key usage extension in one of the X509 certs in the chain were insufficient.

They admitted that this was deliberate, and that telling us they should all install was what might be called a "white lie".

I've had other, greater, coding moments than "following the instructions in the published spec". But since the spec lead of the MIDlet signing model was one of the people evaluating our product at their end, it felt good to have got it right first time...

Steve Jessop
+2  A: 

I was reverse-engineering some code as part of a project to reimplement a proprietary algorithm. Each function was rewritten (by the original author's obfuscator) as a large finite state machine, where every single control structure was rewritten as a series of interconnected states. Due to the nature of the obfuscation, it required a lot of work by hand to restore the original structure and remove all the extraneous math that was put on top of everything. After doing this for some time, I had a 'eureka' moment and came up with a way to automatically deobfuscate the code and generate nearly perfect source from it. A week and a half of week on the deobfuscator ended up cutting probably half a year off the project.

Cody Brocious
+2  A: 

I had some heroic moments in the past and I try hard to avoid them in the future. If heroic's are called for it's usually because someone or a whole team f***ed up and you need quick and dirty fixes that save the day and break down later leaving an even bigger mess.

I'm more into lot's of small incremental good desisions that add up to working and maintainable software.

Sorry for the boring answer to an exiting question :-)

Mendelt
+2  A: 

Being the passive part of a confessional debugging session tends to deliver a great heroism / work ratio.

Hank
I like it best when the other person doesn't say a single word, and I just talk myself into total humiliation and then go fix the bug.
Steve Jessop
Ooh, and for the full win, the passive part should be making a coffee, so as not to lose any work time themselves.
Steve Jessop
This is why some places have a "tell it to the bear" policy. Before you can bug another developer with your problem, you first have to explain it to a teddy bear.
Paul Tomblin
+1 onebyone! (if I could!)
Peter K.
+1  A: 

I worked at a company where our Java product had to work on Windows NT and Solaris. Most of the developers developed on NT and smoke tested it on Solaris. Two of us at work decided on our own that we didn't like our Windows NT workstations and installed Linux on them. So we'd been "secretly" developing the product and testing it on Linux before we smoke tested it on Solaris and Windows NT.

The development manager came to us one day and said "we have a customer asking about Linux support. I've heard you two talking about Linux - how long would it take you to port our product to Linux." Stupidly, we said "it already works on Linux" and were the heroes. In retrospect we should have said "well, if you set us up in an intensive off-site development session, say in a nice hotel or something, we could have it done in two weeks" and gotten a nice vacation out of it.

Paul Tomblin
+2  A: 

Probably my most heroic moment was the time I saved a project.

It was a large Perl project and they had been struggling for months with an awkward algorithm.

They decided to bring me in to help them out.

Immediately I could see their approach to the project was causing them pain.

I helped them to see that by modelling the entire process as objects it would be a lot simpler than a process driven approach.

By the end of the day we had our new design. Within three days we had a prototype which far surpassed their months of effort.

hexsprite
+3  A: 

One of my favorites was some years ago when one of the teams in the company I was working for at the time had a release due. Unfortunately they also had a bug they could not nail down.
It was a really nasty bug because it was very hard to reproduce. After several weeks of trying they came to me.

The code in question was written in Delphi. I managed to figure out a reasonably reliable way to reproduce the problem, and found that a pointer in one of the main objects was getting trashed. Unfortunately I couldn't find the code that was trashing it and it wasn't possible to set a memory break point on the pointer because the object it was stored in was dynamically allocated on the heap and so the address was different every time the app ran.

What I ended up doing was making a plugin for the Delphi IDE that allowed the debugged application to ask the IDE to set a memory break point given an address from the app. Once that was in place and code added to the debugee I managed to find the line of code that was causing the problem.

The architect of the application was a big fan of interfaces and had created at least one for every class in the system. It seems that one of the juniors on the project didn't quite understand how to use them properly and was using the Delphi hard casting stuff instead of testing to see if the object implemented an interface. They then called a method on this new casted interface and BOOM!

Lots of fun :)

Daniel
Interesting one. I think static code analysis tools like Coverity Prevent, link, etc would have found out this NULL pointer dereferencing issue. Not sure if there is any tool for delphi though.
ragu.pattabi
+3  A: 

Well, something like that actually happened to me.

One of our customers biggest wish was undo functionality. But this is very hard to add to an existing and complex application.

There was a customer event in two week and biking home one day, i got an idea. The next day i mentioned the idea and got a green light. I managed to get a quick and dirty UNDO ready for the customer event. But unfortunately i was not able to attend the event. But the next day i heard the undo was accepted with applause.

The clean version took more than a month but is works like a charm (although there are some memory issues, but nothing i can't handle).

Gamecat
Nice one. I would be interested to hear about your quick and dirty prototyping here. http://stackoverflow.com/questions/107534/how-do-you-prototype
ragu.pattabi
I can give you more information. But not now (hopefully this week)
Gamecat
+3  A: 

The company I worked for had its own SCADA product (diagrams of a factory, with the items changing colour depending on the state of the hardware). There was a long-standing bug that the customers kept raising, and several previous developers had tried and failed to fix it. The salesmen hated the bug too, as it often occurred when they were pitching for new work.

Occasionally a graphic would appear to be in a grey box, when it should have had a transparent background. Looking through the mass of C++ code, I eventually found that some of the graphics objects were designed to flash. The code to make objects flash was using the Windows system palette, and swapping the values directly in the palette to force the redraw.

When going to a different screen however, the palette lookups were offset by 1 in some cases. I found that by clearing out the palette, everything was recreated appropriately, and the "ghost box" was no more. I was bought lunch!

harriyott
+5  A: 

Many times, I felt that I wrote some great code but it was never shown the respect it deserved. :) Then one fine day, I was called to a very important meeting. The client just received a deliverable for one of their main strategic projects. There was a big performance problem. It was just released to the users and they were unanimous in rejecting it. I was called to the meeting to get my inputs.

I knew it was an asp.net web application and told I will take a look. Once I logged into the server, I turned on some "typical" performance enhancing stuffs like compression, caching static content etc. Most important part was rewriting one httpmodule which was sucking the life out of the app. In one or two hours, I made all the changes and updated the server.

I still remember the euphoria after that. There was a steady stream of visitors to my cubicle, including the Directors. Life changed a lot after that.

Gulzar
+3  A: 

There is plenty. But most of them go unnoticed, because people are too busy to look! I am sure for most of you fellow developers, it is the same case. I try to ensure others' heroic moment does not go unnoticed due to my ignorance. :-)

Anyways, here is a recent one. I won't call it heroic. But something that gave me satisfaction.

I was asked to handle a mammoth task, that I should create thousands of lines of MSSQL and Oracle stored procedures. Other modules who finished their part told me that they were killing themselves over this. As I analysed it was mostly monotonous. Given a stored procedure only a certain things were changing. Also there were good deal of similarities between MSSQL and Oracle syntax. I strongly believe monotonous task is for computers. Apparently I was able to roll out a Ruby script (with the help of ERB) to generate these stored procedures. I could save quite a bit of time and a likely carpal tunnel syndrome!

My confidence level of Ruby improved quite a bit. Marketing Ruby to people around me wasn't difficult after that. :-)

ragu.pattabi
+5  A: 

I rewrote a oracle report, that was taking over 10 hours and shortened it to under 10 mins. The problem was simple, the data was getting aggregated ( sums, averages ) on the client rather than using sum and average in SQL. So the 26 million record table was getting sent to the client summed and averaged and displayed. It was a bit silly but the client thought I was something special with magical powers.

Brian G
+3  A: 

There's nothing better than a free lunch!

I got mine when I solved a problem that had been plaguing my new team so much the tech-lead had written a message-prompt to come up when the situation appeared and explain everything they had been doing. (These guys hadn't heard of log files let alone tiered development and thought that OO was when you used the option explicit command (VB6))

Anyway -0 Turned out that one of the forms wasn't destroyed properly when you clicked the [x] button instead of the close- and when you went in the second time it didnt load it's values properly so if you then saved you'd wipe all of the programs options for everyone in the whole company!

I still remember I got sushi for that one :)

Davinchio
A: 

When I saved a major project in 2 hours solving a problem in C# those Java - people worked on for 4 weeks (2 people).

Was also one of those "I remember once again why I hate Java and everything else open source so much" - moments.

StormianRootSolver
+1  A: 

I was fixing a bug where the application's password expiration code didn't work. Passwords lived forever since almost no one changes their password unless it expires.

After fixing it, I realized (while showering!) that hundreds of hundreds of employees at each of hundreds of customers had "last password change" dates that were very old. So installing the fix would cause immediate mass password expirations.

I mentioned this at daily standup and people gasped. "NO! NONONONO! Don't do that yet!"

Eventually it was decided that this was in fact acceptable, but it needed careful discussion. I was a hero for realizing this ahead before it whacked our customers.

D-Coder