Scroll to top

Keep up with the nerds

23 Feb 2018

Keep up with the nerds

Keep up with the nerds

I’m letting the secret out: Most technical startup entrepreneurs don’t code. I’m no exception. I haven’t actively coded since highschool. I know. I’m a phony. Running a tech company and telling clients what they should do. My calendar is clogged with strategy meetings, investor calls, and reminding people to mute themselves on Zoom. But here’s the thing, if I can’t explain the difference between Docker and a Tupperware container, I’m in trouble.

I don’t have to be a full-stack wizard, but I do need to keep enough of a grip on the stack so my developers don’t roll their eyes every time I ask a question. Technology changes too fast, and as a founder, I can’t afford to become “that person” who thinks Java and JavaScript are basically the same thing. You know who you are!

THE NOT SO SECRET PROJECT:

So, to prove to myself (and maybe to my team) that I still know which end of the keyboard is up, I built a ridiculous little app: the 404 Apology Service.

The idea: whenever this site breaks (and it will), instead of a typical “Not Found”, y’all will get a funny apology. It’s useless, unnecessary, and honestly perfect.

I can’t take full credit. I roped in two of my technical leads to help me not embarrass myself completely by double checking my code. But hey, collaboration is a skill too, right?

The Apologies (because users deserve comedy when they’re annoyed)

[

"I dunno what happened. My bad.",

"If it makes you feel any better, I didn't want this to happen either",

"How do Gen Z's apologize when things break?",

"Did you try powering on and off? Just kidding. It's me."

]

The Code That Keeps Me Humble

const express = require('express');

const fs = require('fs').promises;

const app = express();

const PORT = process.env.PORT || 3000;

async function getApologies() {

const raw = await fs.readFile('./apologies.json', 'utf8');

return JSON.parse(raw);

}

app.get('/apology', async (req, res) => {

const list = await getApologies();

const pick = list[Math.floor(Math.random() * list.length)];

res.json({ apology: pick, ts: new Date().toISOString() });

});

app.use((req, res) => res.status(404).redirect('/apology'));

app.listen(PORT, () => console.log(`Listening on ${PORT}`));

Translation: “Look, Mom, I can still write async/await without crying.”

Docker and CI, Because Why Not?

Did I stop there? Of course not. I wrapped it in Docker and slapped on Travis CI cuz that’s what the cool kids are doing these days. Nothing screams “serious entrepreneur” like a containerized app that delivers jokes when your site crashes.

FROM node:8-alpine

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install --only=production

COPY . .

EXPOSE 3000

CMD ["npm", "start"]

It’s a little funny that we’re paid to help clients make money from their website and the leader of the whole company can only do this. But it reminded me why it’s worth staying close to the stack. I don’t need to be my team’s best engineer. In fact, I won’t be. But I need to speak the language, feel the trade-offs, and know enough to respect the work.

Plus, when my site inevitably breaks, you’ll have the satisfaction of getting teased by my 404. And honestly, isn’t that what entrepreneurship is all about? The little laughs.

Good to Great, good read but not for startups

May 2018