I was 21 when I quit my first real job.

What started as a great opportunity for a high school senior to sharpen his coding chops, turned into daily frustration over management, stress and terrible working conditions.

The small advertising agency was a creative’s dream. Offices showered in natural light. Large windows overlooking a lush green park, playful decor, walls covered in old design projects, sofas in the lounge, shelves full of books on design and marketing. A relaxed culture.

It was amazing. But also terrible.

Nobody had any real idea how programmers function. How we think, how we work, what we need to feel productive. For a long time I was the only programmer on the team.

On day one I was given an old laptop, a comfy chair and a spot on the large desk occupying most of an open-floor office. Across from me was a chatty copywriter. On the right was the main designer. In the opposite corner sat another designer.

The boss who talked on the phone a lot was hiding behind a tall book shelf. When somebody went to ask him about something, the whole office could hear. Eventually a project manager joined our big desk … she wasn’t even half as quiet as the boss. I still know that printers often need to be talked to angrily to get a move on.

At first I was happy. The work was fun, it was new, and I even got paid to do what I loved. Jackpot!

But as months passed the job became more and more stressful. The projects became a slog, always the same. Waves upon waves of client work made it completely impossible to work on that one cool internal project. By the time I was finishing up coding for the previous project, a new one was already specified and all conversations with the clients done.

I could never get a word in on the design part. They thought I didn’t care, but I just didn’t have the time to attend meetings.

At one point there were so many things on my plate I couldn’t even get more than a half hour of focused work until everyone went home already.

Word of Google being a super awesome place to work for reached my radar at about the same time. A company by engineers for engineers. A place you can work at.

I dreamt of founding the perfect company to work for. I didn’t know what that meant, but I knew it was going to be cool and I would love working there.

After a few months of working on a side-project late into the night I quit my job and started working from home. Finally I could work only on what I wanted, there was nobody to boss me around and I could work distraction-free as much as I wanted!

Nope.

Mum didn’t get “working from home” at all.

“You’re home arsing about all morning. What do you mean you couldn’t wash the dishes and vacuum the floor and cook lunch for everyone and your room is still a mess?”

“But muuuuum, I was working. No I don’t have time to sit down with you for an hour when you come home every day. I’m busy!”

“Are you even making any money? Did you pass any exams yet this month?”

“Sheesh mum it’s not all about money …”

“Then you’re not working!”

Not that this has been much different now that I *do* make plenty of money by working from home. Mums just don’t understand. I guess nobody who doesn’t work from home understands …

But eventually the side-project started taking off. Two guys agreed to work with me for free. I couldn’t really pay them anyway. We convinced a local hackerspace to give us an office — also for free — and we set off to build the next big thing in news consumption. We were going to take over the world!

We didn’t.

The startup never left my mind. At any given moment I was either architecting a cool piece of tech, pouring my misguided ideas into code, creating business strategies, thinking about what the others were doing, or learning to be a better entrepreneur.

It got so bad I was listening to entrepreneurship podcasts whenever I had more than 10 minutes of “free” time, just so I could squeeze that extra bit of productivity into the day. My standard was 14 to 15 hours.

Everyone spent at least eleven hours a day in that dark hackerspace basement. We occupied a sofa, two tables, and three whiteboards.

There was no time for deep thought. We wanted to work work work. One by one we crashed and burned.

The other programmer was the first to go. He simply stopped coming to the office. He didn’t answer any of my calls or emails. For a few weeks even his friends were asking me if I’d seen him.

I don’t know what happened, but he was a cool guy and I still feel bad for doing that to him. Last we met he was working for an established startup and finishing his studies. He didn’t seem to hold a grudge.

He was the first to give up on us, but I was the first to start burning out. I started taking long car rides to nothing. Just sit in the car and drive aimlessly around the city listening to bad music on the radio and looking at the stars.

I needed to be alone. At the office everyone expected something from me. Everyone expected me to be awesome, to inspire everyone to work hard, to woo investors, to keep my spirits up, to be perfect.

They actually didn’t, but it sure felt like it. In my eyes I was the startup. Without me there was nothing.

The car didn’t judge.

I became a husk. I spent whole days aimlessly clicking around the internet. “Work” had become writing two lines of code followed by an hour of lolcats. My nights were spent doing everything I could possibly think of that didn’t involve the startup.

In March 2011 our investors and the other cofounder kicked me out of the startup I had poured my life in for a year and five months. I was devastated, but I deserved it. I was a terrible boss, I drove my guys like slaves, I didn’t listen to just about anyone.

On my way out an advisor slash investor said: ”Dude, I know this hurts. But you need to learn a lesson.”

”Screw you, no I don’t!”

But he was right. What I was doing was completely unreasonable, practically psychopathic. That is no way to treat programmers. The job I tried so hard to escape was nowhere half as bad.

Ever since I have been actively searching for the best way to be a programmer. The best way to treat programmers. The best environment to keep programmers happy, productive, and sane.

Why programmers work at night is a book about what I’ve learned.