A coder's tale

Tags: programming, writing, a glimpse into life, and popular request

Wake up. Check phone: 21 notifications, spread on four social media and two news outlets. Nothing important, put phone away. Climb out of bed, search for glasses, fumble, find them, wear them. Grab T-Shirt; It's black, and in white bold monospaced letters there's "I changed your password" written across the chest. It will do, I put it on. There's still coffee in the Mokka, I pour it in my "Aperture Science" cup, take a sip. Will do. Stroll to the computer, sit down. The day can begin.

The first thing I do is check my bugtracker; Nobody added anything. Well, who would? A total of seven people downloaded the prototype: I know all seven of them. "Build it and they will come"... my ass. *sigh*. My motivation wasn't the greatest to begin with, but now it dropped to nearly zero. This project needs to come to conclusion soon, I have thousands of other ideas in my head, but actually finishing a project is on top of my priorities: It's half a year since my last paycheck, the money I saved up is slowly fading away, and I'd really need something to bring in some cash. Not that I would really earn a lot, the payment will be on a donation basis, and I expect nobody to want to shill out any money for this. But it's worth trying. I have to finish this. I still lack motivation, discipline will have to do.

I stare at the code in the editor. My impulse would be to implement one of the many ideas I have for new features for this project, but it's already so afflicted by feature creep, I don't want to bloat it even more. Put on headphones, open up Spotify, and put on the right music to motivate myself for the tedious task of completing the parts I'm currently working on... basically I'm gonna hunt bugs the whole day. I need something that pumps me up... I find the right playlist, and switch back to my Editor of choice, Sublime Text Editor. Every time I switch to it I feel a fit of guilt for using it without paying, and every time I pledge to pay for it as soon as I earn money with my projects. Focus. I'm getting distracted by trivialities again, I have to focus. Hands on the keyboard, I have to start working

Humming along the melody of "To the sky" while scrolling through the code, I try to remember where I left off, and then I see the function I was working on: It shouldn't work, I see at least two faults in the algorithm's logic, yet it seems to work. Why? I start analyzing the function, my hands flying over the mechanical keyboard. "Click Clack". Debug Message at the beginning of the function. "Click Clack". Check if parameters are set correctly. "Click Clack". Added breakpoints. Compile. Test. Swear. Close Program, back to Editor. Search where function gets called. "Click Clack". Swear. This debug message doesn't help, delete it again. "Click Clack". Add a few breakpoints. Compile. Swear. Back to Editor, fix the typo I made when deleting the debug message. Compile. Swear. Go back to editor, check what else I modified: it can't be the breakpoints, they won't affect... Swear. Compile again, checking compiler settings. Of course I limited debugging to that single file, and now the other files won't compile properly if they contain breakpoints. Change compiler settings. Compile. Test. Swear, louder then the times before. Why the fuck does this work? It shouldn't. Go back to the editor. Comment out the whole content of the function. "Click Clack". I'm only working since a handful of minutes, yet I'm already frustrated beyond what's good for being productive. To let off some steam, I comment each line manually.. inserting the double-slash at the beginning of each line is soothing. The mechanical motion my hand do, the mechanical sound of my mechanical keyboard... it feels real. Line By Line. "Click Clack". "Click Clack". "Click Clack". "Click Clack". I don't even read the lines I'm commenting out. I know them by now. I know every line in this project. I wrote them all. One by one. Carefully, crafted this artificial being out of nothingness. Working with a team was nice, but creating the project alone is way more satisfying. 27.371 lines of code, each with it's purpose, each carefully written. I'm finally done commenting the function. Compile. Test. It still works. I don't swear. I'm beyond the point of swearing now. THIS PILE OF METAL WANTS TO INSULT ME. There's no other possible explanation for why it works.

The phone rings. I try to ignore it, but the ringtone keeps getting louder. After what feels an eternity of trying to ignore ignore it, I give up and push myself away from my desk, so I reach the landline phone - I should really disconnect it, it's always so annoying. "Yes?" silence. As I'm about to hang up, I hear a robotic voice on the other end. As I listen, my anger grows. After the message is over, I hang up, raging. I already knew this day would come, but I hoped it would be a while. My ISP decided to raise prices, nearly doubling them. But my contract still binds me for another year, and I can't afford the early termination fees. I have to clam down and focus, I need to complete this more then ever - nothing in the world will force me back to a nine-to-five office job with strict work schedule, dresscode and the work climate of a ghost ship. Back at my computer, I look over the code again. The function is literally all commented out, why is this still working? Let's try renaming it. "Click Clack". Control-H, search and replace, rename all references. Compile. About a dozen compiler errors - I yell at the screen. Somewhere in the back of my mind I wonder who swears more - drunk sailors or software engineers? I ignore this random thought, and decide to manually go over the errors. Ah, the my mass replacing was a bit overzealous. "Click Clack". Now it should work. Compile. Test. Swear. It still works. How? I decide to write some new test, let's try with the opposite approach, and to a high-level black box test. Oh god, how was the BDD software suite called again? Apricot? No, it was some vegetable... Courgette? Ah, Cucumber! I still have it set up somewhere.. after a few seconds I located it, and start writing tests. Set up the correct path to the compiled executables, run test. "Click Clack". Wait, what? How... What's going on. It doesn't work. I switch between the consoles - my Unit tests seem to work fine, but the high-level tests fail spectacularly. What's going on here? I register that it started to snow outside - I should go cover my bike - but not now. I start going over everything again. Line by line. Check all function calls. This takes hours, and is tedious, but the error must be somewhere. While going over the function calls I mark positions which might be problematic with special comments, so I can find them again later. IT feels like an eternity, and at the same time it's over way too soon: I reached the last function call, and yet I still have no idea what the issue might be. Let's go over the marked positions again, Control-Shift-F. "Click Clack". Open each result in a separate tab. Read over the open part, find nothing wrong, close tab. Read over the open part, find nothing wrong, close tab. Read over the open part, find nothing wrong, close tab. Why does the software work in the unit tests? I look out of the window - shit, there are about 20 cm of snow on the floor, my bike is probably already covered with it. I should go and cover it right away, I stand up, grab the - wait. I stop in the middle of movement, hand outstretched to my wardrobe. It can't be.

I slowly sit down again. Open the Unit testing framework. Locate test. Function gets called, results get compared correctly. But where do I initialize the variable it's compared to? "Click Clack". Not in the Set Up function. "Click Clack". Not in the Initializer. "Click Clack". Not in the Constructor. What value do I assign it to? I search for all the mentions of the variable, no it's not here, it's... - With a loud scream I punch the wall. Something in my finger snaps, I can see a crack in the wallpaper - and in the my skin on the knuckles. Yet, I don't even register the pain. With the new wound on my hand quickly turning red with blood my hands go back to the keyboard. "Click Clack".
"Click Clack".
"Click Clack".
Compile the tests again. Run them. "Test 37:Failed". Check the detail logs. There, the errors I expected.

I don't know if I should laugh or cry. I compared the function result to itself, because of an incorrect variable assignment in the test. Such a stupid error. I stare at the blinking red "Failed". This stupid mistake just made me waste so much time. Why didn't I check the test earlier? Stupid - stupid - stupid! "Click Clack". With blood trickling down my fingers and onto the dirty keyboard I revert to the latest version I committed to git before working on this bug. I check - yep, the error is still there. I fix the test, run it again. It fails, like it should. I try to reproduce the misbehavior in the actual application - yep, there it is. Why did it look like it was working, except under this circumstances? I quickly find out why: I catch the exception and forget to log the error, returning a default value. While I quickly fix the mistakes - now that I know that it really does misbehave it's fairly trivial - I start realizing the pain in my hand. I should probably put some peroxide on the wound. At the same time, I can literally feel all my never-really-dormant depression resurfacing. My ever-present impostor syndrome keeps reminding me that I'm not a real coder - real programmers don't make such mistakes. Feeling like a failure, I run the test suite, and it passes. I can't enjoy the moment, it makes it worse. The fix took me a couple of minutes, but because of my stupidity I wasted valuable time. "Click ... Clack". Slowly, I commit the code, and mark the issue as resolved. I stand up, put on a coat, grab a blanket to cover my bike, and make my way out of the apartment. As I reach into my pocket to store the keys, I feel something there.

Oh, a pack of cigarettes. I stopped smoking last winter, this must still be from back then. My still bloody hand caresses the pack, while I use all the self-control I have left to keep walking down the stairs and not just sit down and disappear in an endless hole of self-pity.

As I leave the building, without even consciously realizing it, I light up a cigarette.

~ Ramsesoriginal