DEV Community

Cover image for Working with junior programmers
Ned Twigg
Ned Twigg

Posted on

Working with junior programmers

I just had an opportunity to work with some junior programmers for the first time in a while. One of the things I noticed was that they often wrote code that they did not want to run, but they thought they had to write to get some warning to be quiet.

It's so obviously silly to write code that you don't want to run, and yet it still happens. A lot! So I wrote a fun little piece about it. Here's an excerpt:

And all of the good programming languages... have at least one construct entirely devoted to “if the bad thing happens, then what?” In the best languages, you say “I will tie my shoelace”, and the language says “But what if you scrape your forehead?” And nothing else can happen until you have an answer.

“I won’t scrape my forehead while I -” UNNNNNHANDLED CASE ScrapeForeheadException WHAT IF YOU SCRAPE YOUR FOREHEAD ON LllllLLLine TWELVE THIRTY THIRTY TWO then what? …

One option is to run away to live with Python, who lets you drink Coke for breakfast and shit in the refrigerator. But it would be better to be a goodie two shoes and say “dear mommy I will get a bandaid from the cupboard and put on neosporin”. That might work, or maybe she’ll hit you with a nested DrankTheNeosporinException but then you can say “dear mommy I’ll call poison control” and eventually she’ll be satisfied and your shoes will be tied.

As you age and better grasp the desperate scarcity of time, you will correctly say “I don’t have time for this”...

The whole thing is on my new Substack at https://thecontextwindow.ai, but I'll be crossposting to a mirror account here on dev.to.

Top comments (0)