Swizec Teller - a geek with a hatswizec.com

Senior Mindset Book

Get promoted, earn a bigger salary, work for top companies

Senior Engineer Mindset cover
Learn more

    Why mentoring matters

    Here's a funny video about Ivane, a construction worker with amazing productivity and work ethic.

    Imagine what Ivane could do if someone showed him how to use his tools 😱

    But we are all Ivane. Always. We do things the best way we know how, then look back years later and think "Wow if only I knew then what I know now! 🀦"

    I could share stories for days. Lots of my learning came by trial and error and pain.

    Dumb things I did without mentors

    I had to build a relational database at work and I didn't know about many-to-many tables or how relational databases work. Think I was in high school back then.

    Obviously, the way you connect a user to posts is to create a posts table that has an ID column. And then you create a string column in your users table that has a JSON array of IDs for every post.

    Yep, shipped to production πŸ˜…

    The correct solution is to use a foreign key and a one to many connection.

    Another good one from that era was I wrote a lot of complicated codes to make table joins in PHP because I read an article on the internet that said: joins are slow and you should avoid them.

    I now know that databases are waaaaay faster at doing joins than when you do it by hand. In PHP. πŸ’©

    The weird part is that everything worked.

    But we were always wondering why is it that any time we fix a bug, five other things break? When we sneeze, or change the design, everything is a 3 week project ... wonder what it could be πŸ€”

    An impressive dumb thing

    Here's my proudest dumb moment – in high school I wrote a compiler.

    I designed a template language for PHP. PHP is, by itself, a templating language. My language was slow because it used an interpreter that went line by line and ran template code as PHP to build the HTML output.

    So over Christmas break, I turned that into a compiler that would transpile my template language into PHP.

    The PHP would then output those HTML files. Even when my cache didn't work (story for another day) and the compiler ran on every request, it was faster than the interpreter πŸš€

    The language/compiler even supported functions, loops, conditionals, everything. And it was all written as a 1600 lines switch statement in a single function. I had so many variables in scope that I couldn't figure out a different way of making it work.

    My code survives on SourceForge, here's a Gist of the templating engine – the compiler.

    The most impressive part was that I made functions work with their own scoping without using recursion. Because I didn't know about that.

    Later in college, I learned that you can translate between tail recursion and loops by using about 8 variables. Back then, I figured it out by hammering at bugs and edge cases until it worked.

    A lot like Ivane πŸ˜…

    I'm still impressed I pulled that off. Later when I took a compilers course in college, I was like, "Oh my god!". If only I knew about all these tools that exist 🀯

    Or used an off-the-shelf PHP template engine of which many exist. They're battle tested and everyone knows how to use them.

    How mentoring helps

    Known unknowns are easy. You don't know about something so you look it up. Google, books, people who may know.

    Unknown unknowns are where mentoring shines. Getting feedback from an experienced peer who can say "Yo, there's a better way. Lemme show you"

    That's the highest impact activity of any senior. The single best use of your time.

    We talked about how and why at our last Senior Mindset Mastermind call. We meet again next week, if you're interested.

    Cheers,
    ~Swizec

    PS: back in 2012 I published A history of my worst technical achievements, it shares even more fun projects

    Published on February 3rd, 2022 in Uncategorized

    Did you enjoy this article?

    Continue reading about Why mentoring matters

    Semantically similar articles hand-picked by GPT-4

    Senior Mindset Book

    Get promoted, earn a bigger salary, work for top companies

    Learn more

    Have a burning question that you think I can answer? Hit me up on twitter and I'll do my best.

    Who am I and who do I help? I'm Swizec Teller and I turn coders into engineers with "Raw and honest from the heart!" writing. No bullshit. Real insights into the career and skills of a modern software engineer.

    Want to become a true senior engineer? Take ownership, have autonomy, and be a force multiplier on your team. The Senior Engineer Mindset ebook can help πŸ‘‰ swizec.com/senior-mindset. These are the shifts in mindset that unlocked my career.

    Curious about Serverless and the modern backend? Check out Serverless Handbook, for frontend engineers πŸ‘‰ ServerlessHandbook.dev

    Want to Stop copy pasting D3 examples and create data visualizations of your own? Learn how to build scalable dataviz React components your whole team can understand with React for Data Visualization

    Want to get my best emails on JavaScript, React, Serverless, Fullstack Web, or Indie Hacking? Check out swizec.com/collections

    Did someone amazing share this letter with you? Wonderful! You can sign up for my weekly letters for software engineers on their path to greatness, here: swizec.com/blog

    Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com

    By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❀️

    Created by Swizec with ❀️