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 Senior Minset email crash course
Get a free chapter from the Senior Engineer Mindset book and a sample audiobook chapter, followed by a Senior Mindset 101 email course.
You'll get insights to apply at your work right away.
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.
I found the code for a custom PHP template language compiler I wrote in 2005.
β Swizec Teller (@Swizec) February 3, 2022
You can tell I had no idea what I'm doing, but it worked. In production π€
Honestly I'm impressed. 18 year old Swiz was a beasthttps://t.co/8GN8eD4XSP
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
Continue reading about Why mentoring matters
Semantically similar articles hand-picked by GPT-4
- That time serverless melted my credit card
- What matters in a senior engineer job interview
- How to ask for help
- It's never been this easy to build a webapp
- Why senior engineers get nothing done
Become a *true* Senior Engineer
Get promoted, earn a bigger salary, work for top companies
Getting that senior title is easy. Just stick around. Being a true senior takes a new way of thinking. Do you have it?
The Senior Minset email crash course
Get a free chapter from the Senior Engineer Mindset book and a sample audiobook chapter, followed by a Senior Mindset 101 email course.
You'll get insights to apply at your work right away.
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 β€οΈ