<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Julian Domke on Medium]]></title>
        <description><![CDATA[Stories by Julian Domke on Medium]]></description>
        <link>https://medium.com/@juleswritescode?source=rss-4c24b8387ade------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WtOOVbDxGUxehhFVGOf40g.jpeg</url>
            <title>Stories by Julian Domke on Medium</title>
            <link>https://medium.com/@juleswritescode?source=rss-4c24b8387ade------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:36:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@juleswritescode/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running Towards Fire: The Key Trait That Separates Senior from Junior Engineers]]></title>
            <link>https://juleswritescode.medium.com/running-towards-fire-the-key-trait-that-separates-senior-from-junior-engineers-b808e8a952d0?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/b808e8a952d0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 07:30:16 GMT</pubDate>
            <atom:updated>2024-10-17T08:42:40.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gt3JuUOPhxXiLiKHLA8uFA.jpeg" /></figure><p>Production was down for an hour yesterday.</p><p>Clickhouse, Parqet’s chosen database for stock market quotes, had too many open connections and too little memory. It took a Google Meet, three developers, and about thirty minutes of looking at various graphs and logs to locate the issue. After another thirty minutes of scaling and redeploying our API, everything returned to normal.</p><p>During my first years of coding, <strong>I was quiet in these meetings.</strong></p><p>I couldn’t make anything of the charts, graphs, metrics. Even if a spike in a chart seemed like a clue, I didn’t know whether it was an actual indicator or the usual pattern.</p><p>After a couple of outages and extinguished fires, I felt more confident.</p><p>But it took a <strong>mindset shift</strong> to arrive at that point.</p><h3>Junior Engineers Run Away From Fires</h3><p>When production breaks, are you the one who fixes it?</p><p>Most junior engineers aren’t. Instead, they expect more experienced colleagues to act. Understandably so: Seniors quickly find the origin of a bug and fix it in a durable way, whereas juniors waste hours running in the wrong direction.</p><p><strong>But waiting for seniors quickly turns into a habit.</strong></p><p>If an outage happens and your first action is to see whether your coworkers are online, or if a critical bug appears in your monitoring but you ignore it and wait for others to resolve it, you are hiding behind the experience of others.</p><p>You are running away from fires.</p><p>But fires are where you learn most.</p><h3>Fires Are Your Best Bet For Growth</h3><p>Humans learn through feedback.</p><p>With implementing features, the feedback is clear and available. If it works, you did a good job; if it doesn’t work, you didn’t. Everybody can achieve results with feedback like that. <strong>That’s why a programmer’s skill isn’t visible in what <em>kind</em> of features they can build but in <em>how</em> they build them.</strong></p><p>But where do you get feedback for the <em>how</em>?</p><p>The quality of your code will be revealed with time. Your code might be difficult to work with when adding new features. Your coworkers might not understand it. Or it might break production.</p><p>Whatever it is, <strong>you only get feedback when something bad happens.</strong></p><p>But if you ignore the bad thing and run away from the fire, you’re skipping the lesson. So run towards it!</p><p>You can also learn from others’ fires. An outage might not be caused by your code but by a coworker’s, by an external dependency, or by a setting of your database. To uncover the root of the problem, you must learn about these things — more valuable lessons, for free.</p><p><strong>So, appreciate things going south</strong> — and run to the fire.</p><p>It’s your best bet to learn what matters.</p><h3>Parting Words</h3><p>Fires are annoying. They distract from shipping features.</p><p>But fires won’t cease to exist, and the experience necessary to fight and prevent them is what makes a great engineer. <strong>They are the best opportunity for growth.</strong></p><p>The next time you have an outage or a critical bug, be the first to try to solve it.</p><p>Soon, your coworkers will look to you to fix it, and you’ll be more than capable of doing so.</p><p>That’s it!</p><p>All the best,</p><p>Julian</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b808e8a952d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It’s Okay to Learn The New Framework, Even If You Won’t Build Anything With It]]></title>
            <link>https://juleswritescode.medium.com/its-okay-to-learn-the-new-framework-even-if-you-won-t-build-anything-with-it-b702a3cd6210?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/b702a3cd6210</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Sun, 13 Oct 2024 16:39:09 GMT</pubDate>
            <atom:updated>2024-10-13T16:40:42.567Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-AMUEVbK5BrPIJZ1gByNAA.jpeg" /><figcaption>What programming feels like if you know both Vue and React.</figcaption></figure><p>In the 21st century, everybody squeezes the last bit of productivity out of everything.</p><p>You’re told that, if you want to <em>make it</em>, if you want to become successful, you’ll have to focus.</p><p>Warren Buffet says that if you want to make it, you should first list all your goals and then circle the five most significant ones. You should then cross out the rest and avoid it like the plague. (Here’s the <a href="https://jamesclear.com/buffett-focus">article.</a>)</p><p>Sounds like a rigid plan to make it.</p><p>But what’s the point of making it exactly?</p><h3>Fun Is a Good Enough Reason For Doing Things</h3><p>Let’s take a step back for a minute and investigate the plan.</p><ul><li>You postpone things you enjoy so you can focus on making it.</li><li>You want to make it so you can have money.</li><li>You want to have money so you can… do more of what you enjoy.</li></ul><p>Seems to me like you can skip the <em>making it</em> part.</p><p>This is hardly news. Most people know the <a href="https://thestorytellers.com/the-businessman-and-the-fisherman/">the old fisherman parable</a>, but even though they understand its message, they ignore it. (So do I.)</p><p>That’s because acknowledging that you could have a happier life by doing fewer productive and instead more <em>fun</em> things feels like giving up.</p><p><strong>I’m not saying the hustle isn’t worth it:</strong> It <em>is</em> beneficial to sacrifice part of the present for a larger goal. If you do, you’ll have a purpose, you’ll carry a sense of pride, you’ll be better equipped to deal with hardship, and you’ll end up with a more meaningful life than if you were only ever doing whatever piques your interest.</p><p>But I am saying: If the ultimate goal is to be free to do what you enjoy, then even today, <strong>having fun must be a good reason to do anything.</strong> Having fun can, on its own, justify choices.</p><p>So, should you become a hedonist?</p><p>No. But follow your curiosity.</p><h3>Follow Your Curiosity</h3><p>We talked about having fun, but what’s even more important is that you build a positive relationship with tech.</p><p>You do this by following your curiosity.</p><p>If you do, <strong>you’ll stay excited about tech and connect pleasant emotions with it.</strong> When starting out, it’s highly rewarding to check out new tech because you learn so much. That’s what makes coding so fun. That excitement will color your first years of coding and your entire relationship with it.</p><p>Take it from somebody who neglected fun in favor of productivity:</p><p>During music university (I’m a state-approved pop-music bass player, with a license to jam), my fellow students and I were highly competitive due to the scarcity of well-paid gigs in the music industry. I wanted to be the one making a living, so I only practiced things that would make me better and never what was exciting or fun. Ultimately, playing bass turned from fun to work. I only cared about proficiency and constantly compared myself with others. <strong>My life’s passion had turned into an underpaid job.</strong></p><p>As a beginning developer, you should avoid this at all costs. And you do this by not stifling your curiosity.</p><p>Productivity will naturally take the spotlight as you become more senior.</p><h3>Learning for Junior Developers vs. Senior Developers</h3><p>Senior developers should clearly keep learning things, but benefits diminish.</p><p>Most tech, at least to me, is old wine in a new bottle — and I’m not even senior yet. What’s more, after learning a couple of frameworks and programming languages, an inevitable fatigue sets in. <strong>You realize nothing’s a silver bullet;</strong> it’s a lot of work understanding tech beyond its basics, and you can’t even use all the skills you’ve learned within those measly 24 hours in a day.</p><p>You might still desire to learn Go, Rust, and Svelte; you might spend a couple of hours with each, but you won’t learn enough for it to be rewarding. Then you’ll stop. Choosing a new framework for your side project won’t excite you anymore;<strong> it’ll seem like unnecessary work.</strong></p><p>Instead of caring about cutting-edge tech, you’ll be more curious about <em>ideas</em> <em>and</em> <em>projects</em>. That’s where the fun will be.</p><p>You’ll prefer using tech you know, because it will unlock ideas and projects faster.</p><h3>Tying It Together</h3><p>The focus on productivity will come soon enough. For now, focus on enjoying yourself.</p><p>If you’d like to learn a new framework, go for it.</p><p>Fun is valuable, so follow your curiosity as long as you enjoy yourself and learn a ton. This will build a positive long-term relationship with programming.</p><p><strong>There’ll naturally come a point where you stop itching to learn tech for the sake of it. </strong>At that point, you’ll care more about productivity and output and favor building with tech that you know.</p><p>That’s it! Hope you enjoyed the post.</p><p>I’m off spending the weekend learning Rust. ;)</p><p>All the best, Julian</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b702a3cd6210" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Junior Engineers, Stop Learning Useless Things. Do This Instead]]></title>
            <link>https://juleswritescode.medium.com/junior-engineers-stop-learning-useless-things-do-this-instead-5ec2afbdda1e?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ec2afbdda1e</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Wed, 09 Oct 2024 04:59:39 GMT</pubDate>
            <atom:updated>2024-10-09T04:59:39.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdaVVPmifl0TeLqEwYcorQ.jpeg" /></figure><p>When I started programming, I wanted to learn <em>everything</em>.</p><p>From Rust to Python to AWS, from React to Svelte to Vue. I was curious about all of it.</p><p>But I quickly realized there isn’t nearly enough time to master all programming skills. In fact, there’s barely enough time to master the tools you’re already using. So we need to use our limited study hours for whatever’s most important.</p><p>Choosing what’s most important, however, can be confusing — especially as a junior engineer.</p><p>Here are a few guidelines for it.</p><h3>❌ Don’t: Learning Just in Case</h3><p>I’m a completionist. I’ve learned many things “in case I need them.”</p><p>My favorite examples are TypeScript’s symbols and iterators. Suppose you’re reading an <em>Intermediate TypeScript</em> book. You flip the page, and there it is: a chapter aptly called <em>Symbols and Iterators</em>. “Almost finished with the book!” you think, and you start plowing through the words.</p><p>But you’re not plowing because you <em>need</em> Symbols and Iterators. I’ve worked at a fintech company for three years and I never <em>needed</em> them. Unless you plan to write libraries, you won’t, either.</p><p>You’re reading on <em>just in case</em> you need them, because you want to finish the book.</p><p>…Don’t do this.</p><p>You’re wasting time, even if you write a library at some point — by then, you’ll have forgotten everything.</p><h3>❌ Don’t: Learning Mutually Exclusive Technologies</h3><p>Many technologies are variations of the same thing:</p><ul><li>React, Svelte, and Vue are all frontend-frameworks</li><li>Python &amp; JavaScript are both high-level general-purpose languages</li><li>MongoDB and DocumentDB are both NoSQL databases</li><li>…</li></ul><p>If you’re already familiar with a frontend framework, it’s useless to learn another.</p><p>My name for these same-but-different things is <em>mutually exclusive technologies</em>, because you can only ever use one in a project. It’s foolish to add both MongoDB and DocumentDB to your SaaS — that’s like bringing two winter jackets to your skiing vacation.</p><p>What makes learning mutually exclusive technologies so persuasive is that vendors are marketing for it.</p><p>They promise a sublime developer experience: Start using FrameworkJS, and all your hassles disappear.</p><p>Once you’ve fallen into this trap a few times, however, you realize that, whether you use Python or JavaScript, Svelte or Vue, PostgreSQL or MySQL, programming remains difficult.</p><p>So don’t study copies of things you already know. You’d waste time.</p><p>You’re better off learning technologies with different approaches.</p><h3>✅ Do: Learning Alternative Approaches</h3><p>Mutually exclusive technologies are out of the question, so what else is there to discover?</p><p>The answer is: technologies with alternative approaches.</p><p>If you learn a technology that solves a problem you can already solve but uses a fundamentally different paradigm to solve it, <em>you will grow</em>. Even if you don’t end up using the new tech, you’ll carry over the principles to technologies you’re familiar with.</p><p>Here are some examples. (I started with MongoDB, Vue/React, and NodeJS as my stack.)</p><ul><li>PostgreSQL uses a different approach than MongoDB (relational data, schema-based). It taught me about database migrations, database triggers, and more.</li><li>Golang uses a batteries-included approach, which is a stark contrast to the dependency swarm of NodeJS.</li><li>Rust forced me to learn about stack and heap, pointers and references, and virtual tables.</li></ul><p>It’s easy to find technologies with alternative approaches.</p><p>I suspect you already have an infinite list of things to learn. Cross mutually exclusive technologies off the list and keep those with alternative approaches.</p><p>Keep in mind, however, that the <em>just in case</em> rule stands.</p><p>For example, learning Rust will teach you a lot — but don’t learn procedural macros because you “might need them” (like I did) or read 300 pages of <a href="https://www.goodreads.com/book/show/63291820-rust-atomics-and-locks">Atomics and Locks</a> in case you ever build an app with concurrency (like I did, too).</p><p>Instead, learn the basics, build something simple, and adopt the paradigms.</p><h3>✅ Do: Learning General Principles of Tech</h3><p>Books on programming principles are evergreens.</p><p>(I’m mostly talking about books because I prefer reading over watching. I suspect you do, too — you’re on a blogging platform, after all. But everything applies to video, as well.)</p><p>Reading <em>Clean Code</em> will benefit you, whether you’re using Python, JavaScript, or Rust. <em>Designing Data Driven Applications</em> will improve your skills with any database. A copy of <em>Domain Driven Development</em> will make you better at modeling systems after the real world.</p><p>The danger here is getting stuck in theory.</p><p>I’ve read the Pragmatic Programmer, Clean Code, Clean Architecture, and The Clean Coder. The books all explain the same concepts. I didn’t learn anything new after reading the first, and I only finished them because I wanted to cross them off my reading list. That’s <em>just in case</em> learning.</p><p>But if you skip entire chapters to avoid wasting time, you can draw much from general principles.</p><p>Grab yourself a copy and start reading.</p><h3>Parting Words</h3><p>The good news is that, with experience, you’ll naturally gravitate towards learning things of substance.</p><p>After you’ve wasted a few hours learning what you don’t need, you won’t crave trying out new tech as much. Technologies become exciting because of their use cases, not because you’ve seen them on YouTube.</p><p>Until then, I hope this blog post helps you learn the right tools.</p><p>The world needs good programmers.</p><p>All the best,</p><p>Julian</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ec2afbdda1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Write Tests So You’ll Ship Faster — Part One]]></title>
            <link>https://juleswritescode.medium.com/how-to-write-tests-so-youll-ship-faster-part-one-4193107e3b2f?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/4193107e3b2f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Tue, 01 Oct 2024 11:16:21 GMT</pubDate>
            <atom:updated>2024-10-01T11:23:21.101Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Write Tests So You’ll Ship Faster — Part One</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cXZYSGl8JsqYh5YNlI9NcQ.png" /></figure><p>Writing tests won’t slow you down.</p><p>If you do it right, you’ll ship faster and better. I promise that, once you’ve overcome the initial hurdles, you’ll <em>love </em>to write tests.</p><p>This is part one of a post series.</p><p>I’ll explain to you <em>why</em> tests can make you faster. In the next post(s), I’ll explain common gotchas and how to prevent tests from slowing you down.</p><p>Let’s dive in.</p><h3>Why Tests Will Make You Faster</h3><p>Tests come with numerous benefits:</p><ol><li>They’ll make you confident in your code.</li><li>They’ll save time and automate annoying work.</li><li>They’ll force you to write well-structured code.</li><li>They’ll provide fast feedback cycles.</li></ol><p>Let’s look at how each of these shortens your code’s time to production.</p><h4>They’ll Make You Confident in Your Code</h4><p>The more confidence you have in your code, the less you hesitate to commit it.</p><p>So, how can tests help you with that?</p><p>Without them, you push to production and hope for the best. If none of your users complained after a few days, your changes didn’t break anything; but you can’t trust they didn’t unless time has passed.</p><p>With tests, you get a confirmation before you deploy. Things can still go sideways, but tests guarantee that if your users behave as expected, so will your code.</p><p>With that confidence, you’ll push much more often. And you’ll check emails and metrics because you worry whether everything works much less.</p><p>Point is: You’ll ship faster.</p><h4>They’ll Save Time And Automate Annoying Work</h4><p>I’ve worked on apps where if you change module A, module B breaks.</p><p>If module B is the checkout page of your SaaS, well… you have a problem. Without tests, you can only ensure that your vital user journeys keep working despite your tweaks and touch-ups by trying them manually — which is annoying and takes time.</p><p>Your laptop can verify those journeys for you if you have tests. It’ll take mere seconds, and it’s the ideal time to grab another coffee.</p><p>Writing tests will take an hour. Verifying user journeys will take, say, 10 minutes before <em>every</em> release. Fixing user journeys when they’re broken in production, 20 minutes.</p><p>I’m sure you’ll do the math.</p><h4>They’ll Force You to Write Well-Structured Code</h4><p>Shitty code is hard to test.</p><p>For unit testing, you’ll have to mock parts of your system. Mocking (replacing methods with dummy versions you control) is hard if you entangle your code and don’t separate your modules well. It’s often easier to restructure your business logic first. If you do this, you won’t only have a test but also better code.</p><p>The best part is that you’ll improve at structuring your code by doing this. After writing a few test suites, you’ll naturally keep testability in mind and write clean code on the first try.</p><p>As Thomas David, author of the Pragmatic Programmer book, put it, “Most of the benefit of testing comes from thinking about the tests and their impact on the code.”</p><p>Well-structured code is much easier to maintain.</p><p>Consider how much time it takes to find your last pair of socks in a well-organized suitcase versus the time it takes when you’ve tossed everything in there like a savage.</p><p>The same pertains to your codebase.</p><h4>They’ll Provide Fast Feedback Cycles</h4><p>Suppose you want to add a POST /signup route that sends a welcome email after a user has signed up.</p><p>What do you think takes more time?</p><p>Option A: Writing a test — which means you’ll have to mock both a database and the email-provider call. But you can then run the test in watch mode and check that everything works as you code.</p><p>Option B: You immediately write the handler — which means you’ll quickly finish the code, but you’ll have to verify it works by opening Postman (or, if you’re a <em>true</em> nerd, cURL), typing in your credentials, manually sending the request, and confirming the data arrived at your database. Due to conflicts, you’d have to change the user’s credentials with every test.</p><p>Option B gives me goosebumps — and not the good kind. It’s manual labor.</p><p>Fast feedback cycles — quickly and effortlessly verifying whether your code works — are crucial. Not only to your productivity but also to your <em>fun</em> — you’ll only reach <a href="https://www.goodreads.com/book/show/66354.Flow">flow state</a> if you spend your time not on chores but on challenging parts.</p><h3>The Issue With Writing Tests</h3><p>I know what you’re thinking: <em>But mocking a database is annoying, and I don’t want the hassle of setting stuff up.</em></p><p>I get it. If you’ve never done it, testing seems cumbersome. With practice, however, it’ll be easy.</p><p>In my experience, the friction that makes devs avoid writing tests stems from four things:</p><ol><li>Setting up the test suite</li><li>Writing too much boilerplate</li><li>Setting up complex testing scenarios</li><li>Not knowing how to test things</li></ol><p>In the next post, we’ll look at each of these in detail.</p><p>All the best,</p><p>Julian</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4193107e3b2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Crucial Mistakes to Avoid When Learning a Programming Language]]></title>
            <link>https://juleswritescode.medium.com/3-crucial-mistakes-to-avoid-when-learning-a-programming-language-663cff6b2019?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/663cff6b2019</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Sat, 28 Sep 2024 17:43:03 GMT</pubDate>
            <atom:updated>2024-09-28T17:45:30.141Z</atom:updated>
            <content:encoded><![CDATA[<p>In 2024, StackOverflow’s survey listed roughly 40 programming, scripting, and markup languages.</p><p>You probably haven’t thought about learning Fortran — but Python? JS/TS? Go? Rust? Swift? Elixir?</p><p>I have yet to find a programmer who isn’t excited about learning new languages.</p><p>But you might waste a lot of time — especially if it’s your first rodeo. Looking back to when I first learned JavaScript, I certainly did.</p><p>With a couple more rodeos behind me, I can share exactly what I did wrong. The three mistakes that stalled and almost halted my progress.</p><p>Please be smarter than me and avoid them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*16NvzvwdxGcEFw72jz5sRg.png" /><figcaption>That’s you right there.</figcaption></figure><h3>1. Building a Project You Never Built Before</h3><p>Building a side project with a new language seems like killing two birds with one stone, but it’s not.</p><p>Instead of throwing in a single blocker, you’re throwing in two. You’ll worry about both how to implement the business logic and how to use your new favorite programming language to do it. The project will be twice as frustrating, with half the progress.</p><p>Instead, build a project you’ve already built. (We’ll talk about what to do if you’ve never built anything in a second.)</p><p>You’ll know where to put the puzzle pieces, so the only thing left to figure out is how to use the new language.</p><p>What’s more, if you’ve already built the same project with another language, you can compare the two. You’ll see the strengths and weaknesses of the old and the new language and better understand the <em>why</em> behind concepts.</p><p>Once you’re comfortable with the new language, you can build something fresh.</p><p>But what if you’ve never built a project before?</p><p>As an absolute beginner, you should follow a guided course or book containing a milestone project. The book will substitute for your lack of experience by giving you ordered puzzle pieces, one at a time.</p><p>But, if you don’t want to get stuck in Tutorial Hell, you must assemble them yourself.</p><h3>2. “Following Along” With Books &amp; Courses</h3><p>Tutorial Hell is when, after finishing a course, you still feel like you lack experience — so you start the next one. The cycle repeats.</p><p>The reason people get stuck is they’re <em>following along</em> with books and courses. They copy snippets and replicate steps as they’re mentioned.</p><p>To become a better programmer, you need to sit down with a challenge and solve it. You only learn by struggling. By <em>following along</em>, however, you’re skipping the struggle — you turn your learning time into a copying exercise.</p><p>Should you then burn all courses and books? No. You can still get a ton out of them — if you use them the right way.</p><p>That way is to <em>separate reading and watching from replication.</em></p><p>Here’s how you do it.</p><p>Read or watch the whole section first. Take notes, but only sparsely: write down milestones, steps to accomplish them, libraries to install, things to look out for, etc. Then, close your browser or book and get to work. Replicate what you’ve learned. When you hit a wall, keep trying for 15–20 minutes — and only then look up the solution.</p><p>Doing this will take much longer than merely watching the course. But it’ll teach you ten times as much.</p><p>With this under your belt, the one thing left that might hinder your progress is <em>learning too much.</em></p><h3>3. Learning Just-in-Case</h3><p>Oh boy, am I guilty of this.</p><p><em>Just-in-Case</em> learning is when you learn what you don’t need, <em>just in case</em> you’ll need it in the future. It can be a new programming language, a new infrastructure platform, features of your current primary language, etc.</p><p>Suppose you’re learning TypeScript.</p><p>You flip the page of your “Intermediate TypeScript” book and reveal the next chapter, <em>11: Symbols &amp; Iterators</em>. “Maybe I’ll need this one day”, you think, and you read on. Two pages further, you’re neck deep into something none of your colleagues have ever heard of.</p><p>Symbols and Iterators are features for library authors. Chances are that you won’t be writing a library anytime soon — if you were, you wouldn’t read “Intermediate Typescript” — so you’ll never actively use those things. They’re a purely theoretical exercise.</p><p>Even if there might come a point where you do need Symbols and Iterators, you’re likely wasting your learning time.</p><p>For example, I’ve read “100 Go Mistakes and How to Avoid Them” (terrific book) and racked my brain about the “For Loop Scoping” problem. Only a few months later, not only did I forget most of it, but the problem was also <a href="https://go.dev/blog/go1.22">patched</a> with Go’s 1.22 release.</p><p>Talking about time wasted.</p><p>If you’re a completionist (like me) and worry about skipping important information, here’s what helps:</p><p>Keep a list of things you’d like to learn.</p><p>When I open the “Symbols &amp; Iterators” page and decide to skip the chapter, I’ll add an item to that list so my mind doesn’t fear skipping information. It’s right there, saved, for when I have the time.</p><p>And I have more time to learn what matters.</p><h3>Parting Words</h3><p>Building a project you have never built before can drain your motivation, following along will put you in Tutorial Hell, and learning <em>Just-in-Case</em> will cost you hours.</p><p>The world needs good devs. The faster you improve, the better.</p><p>I hope you catch yourself before making these mistakes.</p><p>Hope this was helpful and all the best,</p><p>Jules</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=663cff6b2019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Best Way to Get Better at Coding (And Save Yourself Years of Struggle)]]></title>
            <link>https://juleswritescode.medium.com/the-best-way-to-get-better-at-coding-and-save-yourself-years-of-struggle-340bac616525?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/340bac616525</guid>
            <category><![CDATA[code-newbie]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 06:57:30 GMT</pubDate>
            <atom:updated>2024-09-24T16:28:04.978Z</atom:updated>
            <content:encoded><![CDATA[<p>When I studied music, I went through so many exercises I can hardly recount them.</p><p>But I <em>can</em> tell you which one helped me improve the most:</p><p><strong>Transcribing.</strong></p><p>In music, <em>transcribing</em> means picking an instrumental part (a solo, a melody, a bass line, anything really) and learning it by ear. It means sitting in a quiet room and repeating the same 10 seconds of audio, sometimes at 50% speed, until you get it right.</p><p>It means <strong>copying — imitating — your idols</strong>, note for note.</p><p>If you do this, you won’t only learn their techniques; you’ll also teach yourself to <strong>think like them,</strong> to come up with similar <em>ideas</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*gHcz40THQWuvne0xGdaY1w.png" /></figure><p>In 2020, when I started to code, I wondered how I could transfer <em>transcribing</em> to the field of programming.</p><p>The answer’s straightforward.</p><ol><li>You pick an open-source repository, ideally of a reputable project many skilled devs (idols) spend time on.</li><li>Without relying on guides or documentation, you read their code and try to find out how the damn thing works. (Pro Tip: use a debugger to step through the code paths while the app runs.)</li><li>You create a mini version yourself — no copy-pasting allowed. Solve the problems on your own.</li></ol><p>I do this as soon as I have learned the basics of a new technology.</p><p>For example, I’ve picked up Go in March 2024. Once I had learned the basics, I checked out GoTrue, an open-source auth API, and studied and imitated a few REST handlers. I learned how to design a web server, how to organize packages, how to write idiomatic code, how to handle errors, and more.</p><p>Reading documentation or watching courses teaches you the <em>vocabulary</em> of the language — methods, keywords, data types, etc.</p><p>But it won’t teach you to <em>speak it fluently</em>.</p><p>It won’t teach you to assemble smaller parts into blocks of code and to solve real problems.</p><p>Imitating the approaches of more experienced devs and solving the same problems they have solved, on the other hand, will.</p><p>So, if you want to stop fumbling with vocabulary, if you want to stop struggling and wondering how to approach problems, and instead learn to <em>speak</em>, do what children do:</p><p>Imitate. <em>Transcribe.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=340bac616525" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to 3x Your Productivity By Using GitHub Features]]></title>
            <link>https://juleswritescode.medium.com/how-to-3x-your-productivity-by-using-github-features-0688cfb2cdf8?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/0688cfb2cdf8</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 11:33:43 GMT</pubDate>
            <atom:updated>2024-09-21T11:38:03.219Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cM-XtbOO4RJUbwZAM1iFAg.png" /></figure><p>GitHub is much more than a tool for storing and reviewing code.</p><p>It’s:</p><ul><li>A productivity app</li><li>A social &amp; learning platform</li><li>An async communication website</li><li>A CI/CD pipeline</li><li>As of recently, a freaking code editor</li></ul><p>When I first started coding at Parqet (a fintech startup) in 2021, I didn’t know how to get the most out of it.</p><p>But after watching my coworkers use various techniques, that’s changed.</p><p>Here’s how GitHub can help you <strong>be more productive.</strong></p><h3>1) Quickly Learn How Your Microservices Do Things</h3><p>Parqet uses a host of microservices.</p><p>The other day, we had a bug where one service wrote duplicate assets (Crypto Coins, Securities, …) into our database. To identify the root cause, I had to find out which services write to our assets collection (we’re using MongoDB).</p><p>The <em>old</em> me would have posted a question (“Does anybody know where we write assets into our collection?”) into the team channel or asked coworkers directly.</p><p>But <em>new</em> me knows how to use <strong>GitHub search.</strong></p><p>A quick query for org:parqet &#39;assets&#39; mongodb showed all files where we use MongoDB with the assets collection. Of course, I still found 15 files and had to sift through them manually, but that was a matter of 2 minutes.</p><p>Another example: We use protobuf files to speed up the processing of market quotes (stock prices) we receive from our providers. When we want to support a new currency, we need to add it to their definitions.</p><p>I can’t for the life of me remember where those files are. But instead of checking all repositories, I simply query org:parqet path:*.proto on GitHub, and voila, there they are.</p><p>There are many more cases where I use the search:</p><ul><li>Do the mobile apps still use endpoint X?</li><li>Do our repositories still use the old version of library Y?</li><li>Do we still use the outdated link to our FAQ on our Websites?</li></ul><p>I’m sure you’ll have no problems coming up with cases yourself.</p><h3>2) Find Examples of How To Use Libraries</h3><p>Recently, I’ve been exploring Rust.</p><p>The thiserror library (in Rust lingo, a “crate”) provides a way to declaratively handle errors. The docs are good, but real-world code quickly strays from vanilla examples – so I wanted to <strong>see how developers use the crate in the wild.</strong></p><p>A quick GitHub search for thiserror::Error path:*.rs showed many Rust files with examples.</p><p>Besides GitHub’s code search, there’s also <a href="https://grep.app/">Grep.App</a>. In contrast to GitHub, which will search all repositories, Grep.App has cached half a million open-source repositories so that you can find results faster. It’s a viable alternative.</p><p>I’ve tried asking LLMs for examples, but the results are often too close to the docs.</p><p>There’s something to seeing code used in <em>real projects </em>— it’s like having a conversation, as opposed to reading a dictionary.</p><h3>3) Use GitHub Notifications as Your Todo List</h3><p>Honestly, it took me two years to realize GitHub had a fleshed-out notification system.</p><p>Being late to the party meant I had to clean it up first — I had almost a thousand unread notifications –, but since then, I’m sticking to inbox zero religiously.</p><p>At least once a day, I’ll peek in my inbox, mark merged PRs as done, answer any questions and review open pull requests.</p><p>Doing this will help you <strong>keep track of your team’s trajectory.</strong></p><p>Besides, you can follow repositories or issues you’re interested in.</p><p>If you’re waiting for your favorite library to fix a bug, ship an update, or add a feature, subscribe to the related issue, pull request, or repository and you’ll get a notification once it’s finished.</p><h3>4) Share Precise Code Snippets When You Have Questions for Coworkers</h3><p>Copy-pasting a snippet to Slack is fine, but it rarely provides enough context.</p><p>What’s better is sending a permalink to the lines of code in question. Head to the repo, press t to open up the “file finder”, and search for the file containing your snippet. Highlight the lines with your mouse and copy the permalink. Send <em>that</em> to your coworker. Have them marvel at your precision. Jawoll!</p><p>Your coworker can now <strong>place the lines into the context of the file or repo</strong> — he can scroll up or down, see where it’s imported, and even check implementations of functions.</p><h3>5) Learn More About Your Dependencies</h3><p>At Parqet, we’re using Supabase for authentication.</p><p>Their <a href="https://github.com/supabase/auth">auth server</a> is a fork (copy) of <a href="https://github.com/netlify/gotrue">Netlify’s GoTrue</a>. Since GoTrue is open source, we can <strong>read the code whenever we want to know how something works.</strong></p><p>For example, I recently enabled email confirmation but didn’t know how Supabase’s auto-confirm worked. Would the email be auto-confirmed during the initial Postgres insertion? Or would there be another update statement after the insert, setting email_confirmed_at to some timestamp?</p><p>I searched for the column name, found the User struct, and could from there navigate the source code to <a href="https://github.com/supabase/auth/blob/77d58976ae624dbb7f8abee041dd4557aab81109/internal/api/signup.go#L225-L233">this little snippet</a>. There it was, in black and white: there is no separate update query; it’s all done in a single transaction. I could safely assume that when auto-confirm is enabled, the column never changes.</p><p>Some questions, like this one, aren’t documented anywhere — but you can often answer them by checking the libraries’ code.</p><h3>Parting Words</h3><p>These features aren’t secrets, but it took me some time to actively <em>use</em> them.</p><p>I hope the post shortens that time for you.</p><p>Now, there’s much more to GitHub; we haven’t even talked about CI/CD, code editing, reviews, and the like. If you want to learn more, read their <a href="https://docs.github.com/en">excellent docs</a>. There’s a list of <a href="https://docs.github.com/en/get-started/accessibility/keyboard-shortcuts">keyboard shortcuts</a> and a <a href="https://docs.github.com/en/get-started/accessibility/github-command-palette">command palette</a> to be found there, too. Also, here’s a <a href="https://gist.github.com/bonniss/4f0de4f599708c5268134225dda003e0">cheat sheet</a> for the search.</p><p>I hope you enjoyed the post.</p><p>As always, all the best!</p><p>Julian</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0688cfb2cdf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Want to Learn to Code? With These 6 Character Traits, You’ll Be Unstoppable]]></title>
            <link>https://juleswritescode.medium.com/want-to-learn-to-code-with-these-6-character-traits-youll-be-unstoppable-1ba4d4a7aafd?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ba4d4a7aafd</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 06:10:46 GMT</pubDate>
            <atom:updated>2024-09-17T06:10:46.115Z</atom:updated>
            <content:encoded><![CDATA[<p>Software engineering isn’t for everybody.</p><p>Of course, coding boot-camps and online courses will say otherwise — after all, they want as many clients as possible.</p><p>But, in reality, some (probably even most) programming students won’t complete their courses or work in tech afterward. It’s simply not enjoyable to them, and it never has been. Each minute spent coding is one spent struggling.</p><p>The few who make coding their career share character traits that make them enjoy coding so much they’ll naturally put in the work.</p><p>I know for certain that you don’t need to obsess about math and numbers.</p><p>But here are the traits you do need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*nOCE4cR_y1IXDO-4tgJAtA.png" /></figure><h3>Trait #1: You can stare at a screen for hours.</h3><p>I played World of Warcraft as a teenager, so this has never been a problem for me.</p><p>But some people would wither away if they had to stare at a screen for eight hours. They can’t sit down to focus or be inside when the sun is shining.</p><p>I’m not saying that, once you’re a developer, you’ll spend your life inside, glued to your desk, 24 hours per day, seven days per week — I’m outside a lot, and not in front of a screen.</p><p>But you shouldn’t mind staring at it.</p><h3>Trait #2: You love solving logical puzzles.</h3><p>When people ask me, “What’s coding like?”, I say it’s like playing Sudoku all day.</p><p>It fits: Most software problems are logical puzzles. Sure, design and vocabulary are involved, but I’m mostly in a solving-puzzles state. My brain is focused; the work demands concentration.</p><p>If you enjoy solving logical puzzles, you’ll enjoy coding.</p><h3>Trait #3: You can deal with frustration.</h3><p>Programming problems are frustrating, and programmers encounter them every day.</p><p>You would think developers are patient and won’t get emotional when things don’t work as expected. But no. They do. But even when they’re frustrated and angry, they refuse to give up. Developers aren’t unfazed by problems, they’re too obsessed to let them go.</p><p>If you’re somebody who doesn’t quit when encountering a frustrating problem, but instead obsesses about it, you’re set.</p><h3>Trait #4: Computers are your friend.</h3><p>Even though it’s the 21st century, some people haven’t warmed up to technology.</p><p>They don’t know how to interact with it and have no faith in their ability to do so. You certainly have a friend who hasn’t even once arranged his home-screen icons or backed up his hard drive. Such a person tries to spend as little time as possible with their computer; he doesn’t enjoy it at all.</p><p>If you want to learn to code, don’t be that person.</p><h3>Trait #5: You get excited about learning things.</h3><p>My brain loves trivia, facts, vocabulary, numbers, and programming languages (any new information, really).</p><p>When I get a nugget of information, I get excited for a second. It makes my day.</p><p>When programming, I find lots of these nuggets: a nifty line of code, a third-party lib that does just what I want, or a simple configuration option that tailors a database to my needs. These moments of excitement make me want to sit at my desk in the morning.</p><p>If your eyes light up when you learn something new, coding’s for you.</p><h3>Trait #6: You like to read.</h3><p>Lots of programming is reading.</p><p>You read documentation, you read code, you read specifications. A large part of writing good software is understanding things in detail. If you don’t like to read, however, you’ll only glance at the text, inevitably overlook information, and write subpar code.</p><p>If you like to read, on the other hand, you won’t skim — you’ll take the time necessary to understand the specifics.</p><p>I hope my message is clear.</p><p>These traits aren’t reserved for a select few. On the contrary, I think that many people have them.</p><p>If you do, then coding <em>is</em> for you. No need to doubt it. You don’t need to be an IQ-150, numbers-wielding, math-loving wizard.</p><p>The barrier is lower than you think.</p><p>I hope you enjoyed the article!</p><p>All the best,</p><p>Julian</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ba4d4a7aafd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Supabase? This Is The Best Place to Kick Off Your User’s Journey]]></title>
            <link>https://juleswritescode.medium.com/using-supabase-this-is-the-best-place-to-kick-off-your-users-journey-e397859d2135?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/e397859d2135</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 06:01:40 GMT</pubDate>
            <atom:updated>2024-09-14T06:55:33.120Z</atom:updated>
            <content:encoded><![CDATA[<p>Suppose we have a simple CRUD to-do app, “Sachen 3”.</p><p>(“Sachen” means “Things” in German.)</p><p>As usual, a user can add tasks; she can add those tasks to projects, and she can add those projects to areas.</p><p>After she signs up and confirms her email, we want to do a few things:</p><ol><li>We want to create a few initial tasks that show her the ropes of the app</li><li>We want to send her a welcome email</li><li>We want to add her to our “Sachen 3”-Community</li></ol><p>We want to trigger these tasks in our backend so we can test and check them in version control.</p><h3>The Problem</h3><p>But where, and more importantly, when, do we initiate these tasks?</p><p>There are some subpar solutions.</p><p>For example, we could complete them when she initially accesses the dashboard, in our server’s GET /dashboard route. But we’re not sure she doesn’t first visit a different page. That would lead to all sorts of strange situations. Plus, it&#39;s weird <em>creating</em> data in a GET route, don’t you think?</p><p>Alternatively, we could send a POST request from our client, right after she confirmed her email.</p><p>Usually, the <em>click here to confirm</em> link in the email sends users to a /email-confirmed page, where they’re consequently logged in. On the page, we&#39;d need to check if the email is confirmed, and if so, dispatch our request to the API.</p><p>But what if she clicks the link in the email and immediately closes the tab? She&#39;d never land on the /email-confirmed page; the link would expire, and our app would seem broken.</p><p>Dang it.</p><p>The best option would be to do everything on the backend, right before her confirming her email. If something went wrong, she could click the link again. We could guarantee she had a proper initial setup.</p><p>But how do we achieve this?</p><p>The email confirmation happens in Supabase’s backend (or rather, an instance of GoTrue — an open-source auth server Supabase spins up for our project), but we want to control those post-signup tasks in <em>our</em> code, not theirs.</p><p>We’d need a mechanism that triggers our server before, right before the email is confirmed.</p><p>Well, Postgres has got us covered.</p><h3>The Solution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*jb6g1rpM8Z1s_UtJfIg1TQ.png" /><figcaption>Supabase triggers our backend before it updates the user.</figcaption></figure><p>Postgres triggers allow you to manipulate data that’s about to be updated or inserted — and, with the http extension, to trigger external APIs.</p><p>Normally, when a user confirms her email, the GoTrue server will send a query to Postgres that sets a user’s email_confirmed_at column from null to a timezone, such as &#39;2024-08-19T07:32:24.351Z&#39;. That <em>is</em> the email confirmation. Just a column update. Nothing magical about it.</p><p>We can hook into that using a Postgres trigger.</p><p>Let’s take a look.</p><pre>-- 0) enabling the http extension<br>create extension if not exists http with schema extensions;<br><br>-- 1) creating the Schema<br>create schema if not exists internal;<br>grant usage on schema internal to postgres;<br>grant usage on schema internal to service_role;<br>grant usage on schema internal to dashboard_user;<br>grant usage on schema internal to supabase_admin;<br>-- [... setup of `get_secret` function, see below]<br>-- 2) boilerplate for creating the function<br>create or replace function internal.notify_api_on_email_change(<br>    new_user auth.users <br>) returns auth.users <br>language plpgsql<br>security definer<br>as $$<br>begin<br>-- 3) calling the API<br>    perform extensions.http((<br>      &#39;POST&#39;,<br>      internal.get_secret(&#39;api_url&#39;) || &#39;/v1/users/create&#39;,<br>       ARRAY[extensions.http_header(<br>           &#39;x-supabase-secret&#39;, <br>           internal.get_secret(&#39;supabase_hook_token&#39;)<br>        )],<br>       &#39;application/json&#39;,<br>       jsonb_build_object(<br>         &#39;email&#39;, new_user.email::text, <br>         &#39;userId&#39;, user_id::text<br>       )::text<br>    )::extensions.http_request);<br>    return new_user;  <br>end;<br>$$;<br>-- 4) more boilerplate for creating another function<br>create or replace function internal.handle_email_change() <br>returns trigger<br>language plpgsql <br>security definer<br>as $$<br>begin<br>-- 5) checking that we&#39;re only calling the API when email&#39;s confirmed<br>    if old.email_confirmed_at is null and <br>        new.email_confirmed_at is not null then<br>        return internal.notify_api_on_email_change(new);<br>    end if;<br>    return new;<br>end;<br>$$;<br>-- 6) Setting up the trigger<br>create or replace trigger notify_api_on_email_change_tr <br>before update on auth.users<br>for each row execute function internal.handle_email_change();</pre><p>Quite a mouthful. Let’s dissect it.</p><pre>create extension if not exists http with schema extensions;</pre><h4>Segment 0: Enabling the http extension</h4><p>This statement enables the http Postgres extension, allowing us to send a POST request to our server.</p><pre>create schema if not exists internal;<br><br>grant usage on schema internal to postgres;<br>grant usage on schema internal to service_role;<br>grant usage on schema internal to dashboard_user;<br>grant usage on schema internal to supabase_admin;</pre><h4>Segment 1: Creating a schema</h4><p>Here, we’re setting up a separate database schema. A schema isn’t a table; rather, many tables belong to a schema. It’s more of a namespace thing, like a folder.</p><p>Supabase recommends creating your own schema (folder), so you’re guaranteed to be protected from any changes they deploy.</p><p>In the four lines below, we’re granting usage to a couple of Supabase’s <a href="https://supabase.com/docs/guides/database/postgres/roles#supabase-roles">preinstalled database roles</a>.</p><pre>create or replace function internal.notify_api_on_email_change(<br>    new_user auth.users <br>) returns auth.users <br>language plpgsql<br>security definer<br>as $$<br>begin<br> -- [...]<br>end;<br>$$;</pre><h4>Segment 2: Setting up the function</h4><p>This is Postgres boilerplate. By using internal., we&#39;re adding the function to our internal schema. We&#39;re taking and returning an auth.users type, which represents a single row of the auth.users table, where Supabase stores our users.</p><p>Lastly, we’re setting the language to plpgsql, Postgres&#39;s procedural language, and the security to definer – meaning, this function gets the privileges of the role with which we created the function (as opposed to the privileges of the user <em>invoking</em> it).</p><pre>-- [...]<br>perform extensions.http((<br>    &#39;POST&#39;,<br>    internal.get_secret(&#39;api_url&#39;) || &#39;/v1/users/create&#39;,<br>    ARRAY[extensions.http_header(<br>         &#39;x-supabase-secret&#39;, <br>         internal.get_secret(&#39;supabase_hook_token&#39;)<br>    )],<br>     &#39;application/json&#39;,<br>     jsonb_build_object(<br>         &#39;email&#39;, new_user.email::text, <br>         &#39;userId&#39;, user_id::text<br>     )::text<br>)::extensions.http_request);<br>-- [...]</pre><h4>Segment 3: Calling the API</h4><p>We’re using the http extension to make a POST request to our server. Since we don&#39;t care about the response data and don’t want to store it anywhere, we must execute the call with the perform keyword. We&#39;re passing to the function a &quot;composite value&quot; – a comma-separated list of values wrapped by parentheses, used to represent entire table rows – and type-cast it to extensions.http_requestusing the :: syntax.</p><p>The first value is our http method, &#39;POST&#39;.</p><p>Don’t worry about the following internal.get_secret(..) call for now – we&#39;re simply combining two strings into a full URL using the || operator.</p><p>Next, we’re setting a x-supabase-secret header, so our server can confirm that the received request was indeed sent by our database. The extensions.http_header function comes with the http extension.</p><p>After setting the content type to application/json, we construct a JSON payload and cast its type to text.</p><pre>create or replace function internal.handle_email_change() <br>returns trigger<br>language plpgsql <br>security definer<br>as $$<br>begin<br> -- [...]<br> return new;<br>end;<br>$$;</pre><h4>Segment 4: More boilerplate</h4><p>This is the same as Segment 2, except we’re returning a trigger type. Doing so makes the function usable as a trigger function, which you can use in, well... triggers.</p><p>What’s unique about such trigger functions is that we can access the new and old variables in update triggers. new holds the row as it’s <em>about to be written</em> into the database, and old holds the row as it is <em>currently stored</em>. By returning new, we&#39;re confirming the update.</p><pre>-- [...]<br>if old.email_confirmed_at is null and <br>    new.email_confirmed_at is not null then<br>    return internal.notify_api_on_email_change(new);<br>end if;<br><br>return new;<br>-- [...]</pre><h4>Segment 5: Making sure we only invoke the function upon email confirmation</h4><p>Another simple segment: If the old row has an email_confirmed_at column that&#39;s still null and the new row’s column isn&#39;t null anymore, we know this very update confirms the email, so we notify the API. In all other cases, we let the update pass.</p><p>The email confirmation should only happen once for every user.</p><pre>create or replace trigger notify_api_on_email_change_tr <br>before update on auth.users<br>for each row execute function internal.handle_email_change();</pre><h4>Segment 6: Setting up the trigger</h4><p>Now that we have the functions in place, we must make sure that they get invoked at the right time. For this, we set up a before update Postgres trigger. It gets the name notify_api_on_email_change_tr – tr is short for &quot;trigger&quot; and not a special keyword – and it will fire before any row&#39;s update on the auth.users table.</p><p>(The keywords for each row make it such that when 20 rows change simultaneously, the trigger is executed for every single row instead of being fired only once for all of them.)</p><h3>The Result</h3><p>Once we’ve completed the setup, we have a beautiful flow.</p><p>When the user confirms her email, before the confirmation is written into our database, the Postgres trigger fires: A POST request is dispatched to our API, where we can create the necessary data for the user, send welcome emails, and collect metrics. If everything goes well, we return a 200 status code, and Postgres persists the email confirmation.</p><p>This flow prevents us from storing data for users who haven’t even confirmed emails and from marking any email as confirmed despite something having gone wrong.</p><p>I love it. It just makes sense.</p><p>I hope this was helpful!</p><h3>Bonus: Creating a Secrets table</h3><p>You probably don’t want to commit your supabase_hook_token value to GitHub.</p><p>And you probably don’t want to hard code your api_url, since it might change depending on staging environments.</p><p>Now, Supabase offers vault for this use case, but as of August 2024, it&#39;s still in beta. I tried setting it up, but it didn&#39;t work as expected — so I created my own secrets table. It&#39;s not approved by any security or cryptography expert. But it&#39;s certainly better than hard-coding the values.</p><p>After you’ve set up the internal schema, you want to create a secrets table with row-level security.</p><pre>create table if not exists internal.secrets (<br>    name text not null primary key,<br>    value text not null<br>);<br><br>alter table internal.secrets enable row level security;</pre><p>I probably don’t need to explain the create table statement, and Supabase has <a href="https://supabase.com/docs/guides/database/postgres/row-level-security">much better docs on Row Level Security</a> than I could ever write.</p><p>Next up, we add the get_secrets function:</p><pre>create or replace function internal.get_secret(<br>    sname text<br>) returns text <br>language plpgsql <br>security definer<br>as $$<br>declare<br>    result text;<br>begin<br>    result := (select value from internal.secrets where name = sname);<br><br>    if result is null then<br>        raise exception &#39;secret not defined: %&#39;, sname;<br>    end if;<br>    <br>    return result;<br>end;<br>$$;</pre><p>It’s a wrapper around a select statement against the secrets table, with a bit of an extra: We check whether the secret exists, and if not, we raise an exception.</p><p>In the declare block, we create a result variable of type text, so we have a something to read the value into. The if clause speaks for itself.</p><p>Raising an exception like this prevents annoying bugs. Imagine you deployed the trigger we wrote before, and the supabase_hook_token wasn&#39;t set. Every email confirmation would fail, and we would only notice in production.</p><p>With such a get_secret function, however, you can verify the token exists before you even deploy the trigger:</p><ol><li>Create a .sql migration file where you set up the internal schema, the secrets table, and the get_secret function.</li><li>Create a second .sql migration file where you set up the functions and the trigger of the main body of this post.</li></ol><p>Now add to the top of the second file:</p><pre>do $$<br>begin<br>  perform internal.get_secret(&#39;api_url&#39;);<br>  perform internal.get_secret(&#39;supabase_hook_token&#39;);<br>end;<br>$$;</pre><p>With this in place, the create function and create trigger statements in the .sql file won&#39;t even execute if you haven&#39;t set the values. The migration will fail and print, “secret not defined: api_url”.</p><p>Simple as that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e397859d2135" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Here’s How a Daily Engineering Log Can Help You Elevate Your Career as a Junior Developer]]></title>
            <link>https://juleswritescode.medium.com/heres-how-a-daily-engineering-log-can-help-you-elevate-your-career-as-a-junior-developer-d686ed85e38b?source=rss-4c24b8387ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/d686ed85e38b</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Julian Domke]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 09:01:35 GMT</pubDate>
            <atom:updated>2024-09-10T09:01:35.223Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you sometimes feel like you’re shipping less than your coworkers?</p><p>Do you sometimes forget decisions, or <em>why</em> you made these decisions?</p><p>Do you find it difficult to come up with reasons for your next promotion?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*VPuMaIaaikcum2ZX0__5rA.png" /></figure><p>Writing a daily engineering log can help you with all of these things and many more. Don’t take it from me, either; the author of the Pragmatic Engineer Newsletter, Gergely Orosz, <a href="https://blog.pragmaticengineer.com/work-log-template-for-software-engineers/">writes about the benefits of writing such a log</a>, and the famous <a href="https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/?ref=hackernoon.com">Pragmatic Programmer book</a> contains an entire chapter about its benefits.</p><p>I started writing such a log a couple of weeks ago.</p><p>Here are a few benefits I’ve noticed and, afterward, how I’m writing it.</p><h3>Benefit 1: You’ll Feel Accomplished Even When You’re Not Shipping</h3><p>It’s hard to objectively measure the output of an engineer.</p><p>You’ll do much work behind closed curtains before releasing a feature. When you spend weeks working on, say, adding a new payment provider — reading the docs, experimenting with their SDK, and putting the pieces together on a single git branch — you and others might feel your output is tanking. (Of course, they should <em>know</em> better, but reason will only weaken their feeling and never stop it.)</p><p>If you have a daily engineering log, it will show you’re working on something, even if you’re not shipping.</p><p>You’ll feel more confident about your work.</p><h3>Benefit 2: You have Proof of the Quality of Your Work</h3><p>The previous point doesn’t only affect how you feel about yourself.</p><p>It also affects how your superiors feel about you. If you don’t ship features but you do report discoveries about your topic or the completion of behind-the-curtain tasks, your coworkers will get a clearer image of what you’re working on. This makes them feel you’re being productive.</p><p>Keeping a daily log gives you plenty of things to report.</p><h3>Benefit 3: You Won’t Forget Your Discoveries</h3><p>As an engineer, you discover things every day.</p><p>These things might be exciting tech, ideas for your product, or issues you must attend. But your brain isn’t capable of remembering all of them. It doesn’t matter for merely interesting things, but forgetting business-critical ones creates huge problems (I can’t recall how often I caused a flood of 500s by adjusting a data structure and forgetting to clear our Redis cache).</p><p>Jotting down those things will make you more likely to remember them. Rereading your notes the next day even more so.</p><h3>Benefit 4: You stay Focused on Your Priorities</h3><p>There’s an infinite number of tasks in every company.</p><p>Your job is to pick tasks with the most leverage and prioritize them over the day-to-day, “the icon should be a pixel further to the left” type of stuff. But if you keep those priorities only in your head, you’ll have a hard time sticking to them. You risk forgetting some and getting swept up by others that are seemingly more urgent.</p><p>If you write your top priorities on your log template, however, and if you open it in the morning, you’ll reread and refresh your priorities every day.</p><h3>Benefit 5: You’ll Feel Better About Ending Your Work Days</h3><p>If you’re like me, you feel terrible if you end your workday without creating a single PR.</p><p>It feels like you haven’t made any progress. But, as mentioned in Point 1, this isn’t necessarily the case: It could be you understood something better, or that you reiterated your local changes’ design, or it could be that you talked to a coworker about a problem and together devised a good solution.</p><p>When the clock strikes 6 p.m., reading about those reviews, discussions, or discoveries in your daily log can yet give you a feeling of accomplishment and help you enjoy your evening’s free time.</p><h3>Example: Here’s How It Works</h3><p>A daily log doesn’t need to be fancy. In fact, it shouldn’t be.</p><p>It should contain a section that doesn’t change, where you put your priorities, daily goals, and reminders. It should contain another section where you can write freely, without a structure, to mirror your stream of thoughts.</p><p>I use Obsidian for this, but any note-taking software with templates will work.</p><p>I write the daily priorities right in my template, so whenever I create an instance of it, my current priorities show up on top. I have a simple command to create a new template instance in my “Daily Logs” folder. I run that command when I start my work day.</p><p>Next, I keep the log open on my screen. It doesn’t matter where or if it’s minimized as long as it is open. To quickly add to the log, I have a shortcut (Tab + 7) that’ll focus Obsidian and allows me to write without touching my mouse.</p><p>Lastly, I prefix various things with a keyword and a colon, or I use markdown tasks. When working on a project, I’ll add sub-points and reminders below it, using indentation to separate ideas.</p><p>Simple as that.</p><p>Here’s an image of a completed log:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9RF3Pxx1koH4PWpMaQqcQ.png" /><figcaption>A typical log of mine, with lots of scribbling at the bottom. Some lines are even in German.</figcaption></figure><p>Here are the keys to making a habit out of this:</p><ol><li>Open the list first thing in the morning.</li><li>Make it super simple to write into the log (Keyboard shortcuts help a ton).</li><li>Write <em>a ton</em> into the log at first — try to “think on paper”.</li><li>Always have the notes visible on your screen.</li></ol><p>It’ll take you a couple of weeks, but once writing a log has become second nature, you’ll be amazed by the benefits.</p><h3>P.S.: A Template for Copy-Pasting</h3><pre>#### Engineering Log - {{date}}<br><br>#### Current Learning Goals<br>- Architecture<br>- ...<br><br>#### Work Priorities<br>1. ...<br>2. ...<br>3. ...<br><br>---<br>#### Daily Checklist - Morning<br>- [ ] Read Learning Goals &amp; Work Priorities above<br>- [ ] Check Direct Messages <br>- [ ] Check Error Monitoring<br>- [ ] Check Issue Tracking Tool<br>- [ ] Check Personal Todo List<br><br>#### Daily Checklist - Afternoon<br>- [ ] Check GitHub Notifications<br>- [ ] Check: Are Releases Outstanding?<br>- [ ] Check any important RFCs<br><br>---<br>### Notes<br>- </pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d686ed85e38b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>