<?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 Luke Mayhew on Medium]]></title>
        <description><![CDATA[Stories by Luke Mayhew on Medium]]></description>
        <link>https://medium.com/@mayhewluke?source=rss-65ce9635b2e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*vUntRYIs1CO1MtYNkxZBaA.jpeg</url>
            <title>Stories by Luke Mayhew on Medium</title>
            <link>https://medium.com/@mayhewluke?source=rss-65ce9635b2e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 16:11:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mayhewluke/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[My wife is like my job (and I hope she reads this)]]></title>
            <link>https://medium.com/@mayhewluke/my-wife-is-like-my-job-and-i-hope-she-reads-this-466bbcdc13ac?source=rss-65ce9635b2e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/466bbcdc13ac</guid>
            <category><![CDATA[work]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[relationships]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Luke Mayhew]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 14:17:33 GMT</pubDate>
            <atom:updated>2019-08-26T14:17:33.955Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learning to love better can make you happier and more productive at work</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gi9EbGFscl8z1JFa" /><figcaption>Photo by <a href="https://unsplash.com/@brookelark?utm_source=medium&amp;utm_medium=referral">Brooke Lark</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><em>I’ve had a full decade to learn how to love my wife. Only now am I realizing how that can teach me to be happier and more productive at work.</em></blockquote><p>I love my wife. Conclusion: my wife and my job are <em>different</em>.</p><p>I love my wife. Conclusion: my wife and my job are <em>similar</em>.</p><p>Like any word, “love” will mean something different depending on who you ask, and when. But my wife and I have long since come to an understanding of what <em>we</em> mean when we talk about love.</p><p>It’s both the thing that draws us together, and the thing that <em>keeps</em> us together. It’s a feeling — and it’s a verb. It’s an action. It’s a choice.</p><p>I will never love anything in this world like I love my wife, so what does any of this have to do with my job? I’ve had a full decade to learn how to love my wife. Only now am I realizing how that can teach me to be happier and more productive at work.</p><h3>Absence makes the heart grow fonder</h3><p>If I was to sum up my experience of love these past three days in one word, I’d have to go with “agony”. See, my wife’s been out of town to visit family, and I’ve seriously been considering Googling “is loneliness fatal?”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*78bkD8r7xNGVmRrR.gif" /></figure><p>Maybe that seems a bit melodramatic to you. I know that when I was a kid and my father would leave town for a work trip my mother would tell us it was going to be a hard time for her, and in all my thirteen or fourteen years of wisdom I’d think, “What? Come on, he’s just one person. You’re an adult, what difference does it make?”</p><p>Note to teen Luke: don’t be an asshole. It makes ALL THE DIFFERENCE. Or so says my pining, lonely heart. Which may be prone to just a smidge of hyperbole right now, given its emotional state, but if you’ve ever been in my shoes you know how real it feels.</p><p>My wife and I have been together for just about 10 years now, and “in sickness and in health” turned out to not just be an “old age” thing. Neither did “for richer or for poorer” (emphasis on “poorer”) turn out to be a joke. We’ve seen some shit, folks, and been dealt some rough hands. And through it all we’re still here, still together, and still loving each other.</p><p>And it’s been almost half a decade since we were last parted. So yeah, when she’s been my world day in and day out all these years, it’s a pretty big freaking deal when she’s suddenly gone.</p><h3>The measure of a life</h3><p>My wife and I had a conversation recently about mortality, and life, and its significance. Now, I am far from being wise in this area, but with my wife gone my moping turned into contemplation, and I found myself trying to find some way to process everything I was feeling in her absence. Here’s what I realized:</p><p>We live in a world that likes to play up how wonderful and dreamy things are when we see folks in love. Maybe it’s the star-crossed lovers — the young Romeos and Juliets whose passion burns so bright. Maybe it’s the elderly couple watching the sunset and holding hands, the embodiment of contentment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kZvD8hS1dwAfHWbr.jpg" /><figcaption><a href="https://unsplash.com/@evertonvila?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Everton Vila</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>But what about when that person is gone? What do we call that then? Sorrow? Grief? Anguish? Sometimes even those words are not enough. Love burns with the brightest of pains. But that doesn’t make it any less beautiful.</p><p>In my melodramatic moping I realized that life felt so strange and empty without my wife around, so hollow and surreal, and yet that’s exactly the beauty of the 8th wonder of the world we call love. And maybe, just maybe, that’s one measure of the worth of a life — the impact we feel when they’re gone.</p><h3>Impact of a life</h3><p>Sometimes the impact of a person’s life is <em>presence</em>. My wife’s presence in my here and now is the bright center that my universe revolves around. Yank that out, and it’s like sucking all the air out of my lungs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/0*CwEb7xGXe_ZvdiOD.gif" /></figure><p>Other times the impact of a person’s life is <em>legacy</em>. I am who I am today because of who my wife is, and who she’s been to me. I even owe her my life, in a very literal way. I am her legacy, and so is the countless other lives she has touched and changed besides mine.</p><p>And yet, I wasn’t writing this post a week ago. Or a month ago. Inspiration suddenly struck right after she left on her trip. Coincidence? I think not.</p><p>Life is nothing if not adaptable. And that can be for better or for worse. In this case, I had gotten used to how wonderful my wife is, and stopped truly <em>seeing</em> her any more. It took losing that impact before I could <em>see</em> the impact — through the hole left by its loss.</p><h3>Impact of a job</h3><p>I’ve had a number of jobs in my lifetime, and I’ve lost a number of jobs too (as is the way of things). And if there’s one thing I’ve learned about jobs, it’s this:</p><ol><li>Every job sucks.</li><li>Every job has some amount of good in it.</li></ol><p>So then why is it that when I look back I see such a predictable pattern in my job history:</p><ol><li>Get a job.</li><li>Like the job, more or less.</li><li>Get grouchier and bitchier about the job over time.</li><li>Eventually move on to another job (nothing lasts forever) and rinse and repeat.</li></ol><p>Maybe you’re reading this and nodding your head, thinking, “Yup, seems about right.” If so, then this one is for you, my friend, because no, that’s not a good pattern. In fact, it doesn’t need to be a pattern at all.</p><p>Every job sucks. Every job has some amount of good in it. So what’s the difference between when I start a job, and when I am grouchy and bitchy about it? (hint: it’s not usually the job that changes)</p><p>Looking back, I can actually see the holes left behind by the lost impact of my lost jobs:</p><ul><li>I owe my career to my first boss who took me on as a developer despite no real experience.</li><li>I owe a lot of my people-skills, wisdom, and skill in boundaries to my early work in social work.</li><li>My last job gave me a way to feed my family and gave us a financial future without me having to hate my life.</li><li>My current job is teaching me how to pick my battles, and find my courage.</li></ul><p>The key word here is “looking back”. Hindsight is 20/20, and our perspective on the present is usually not just short-sighted, but downright out of touch with reality in most cases.</p><h3>Making the shift</h3><p>Just a few weeks ago I got into a fight with my wife. I don’t remember what it was about, but it felt like a big kerfuffle at the time. Me stomping off mad, grumping in my head about how frustrating she was, how she manages to ruin all the things, how we’re never going to get anywhere with our lives if we can’t even make this work between us, or whatever the monologue was that time. And goodness knows what her inner diatribe was like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*DZsZ8NT13ej23JRB.jpg" /><figcaption>Photo-realistic depiction of my face in that moment (Photo by <a href="https://unsplash.com/@buchstabenhausen?utm_source=medium&amp;utm_medium=referral">Philipp Pilz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Funny thing is, from everything I’ve told you about her so far already you should already be able to see how off-base that thinking was. So how have we made it through all these years when all it takes is a single spark for me to get my head that far up my ass?</p><p>Simple: by making a choice. Day after day. A choice to see the beauty, and forgive the warts.</p><p>And yet, at work I did the opposite. I would get hung up on all the different frustrations, and lose sight of all the good things I had going for me at that job. No wonder I’d get unhappy and stressed. But I realize now that I had the power all along to be happier and more productive.</p><p>If there was one thing I would say to 10-years-ago Luke about both love <em>and</em> work, it would be this:</p><blockquote><em>Lean into what’s good. Release what’s stuck.</em></blockquote><p>Lean into what’s good. Or what could be good, and is worth the fight. But always remember to ask yourself if this is a hill you’re willing to die on. Pick your battles, and especially pick what you refuse to let go of. When you find something that’s just not going to change, or isn’t worth the pain to push on, learn to let it go.</p><blockquote><em>Life’s too short to waste time fighting in the shit. Put your energy into what’s good.</em></blockquote><p>In other words, gain some perspective, stop wasting time on being unhappy with what you can let go of, and make a choice to see the beauty and forgive the warts. Not because your job deserves it, but because <em>you</em> deserve to be happier and more productive.</p><p><em>Originally published at </em><a href="https://www.webuildlegends.com/my-wife-is-like-my-job"><em>https://www.webuildlegends.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=466bbcdc13ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Good programmers are worthless ― this is who I’d rather hire]]></title>
            <link>https://medium.com/@mayhewluke/good-programmers-are-worthless-this-is-who-id-rather-hire-de2e8d6d8ca8?source=rss-65ce9635b2e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/de2e8d6d8ca8</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Luke Mayhew]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 14:16:57 GMT</pubDate>
            <atom:updated>2019-08-26T14:16:57.208Z</atom:updated>
            <content:encoded><![CDATA[<h4>You say you write good code. So what? No one needs code. We need solutions.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wq0xRE4fwAruyYhG" /><figcaption>Photo by <a href="https://unsplash.com/@officestock?utm_source=medium&amp;utm_medium=referral">Sebastian Herrmann</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’re a good programmer, don’t worry — it’s ok. I won’t judge you. In fact, I won’t even blame you. It’s probably not your fault, after all. It’s probably just a combination of passion, the education system, and the millions of messages we’re bombarded with every day that’s throwing you off. And that’s ok (though <a href="https://medium.com/better-programming/curing-developer-burnout-obsession-obligation-and-harmony-3c66259d6712">passion has its downsides</a>, and <a href="https://medium.com/better-programming/redeeming-compsci-sometimes-you-need-to-learn-the-useless-before-you-find-its-use-2f50bd85b3d1">education can be problematic</a> too).</p><p>But if I had a choice, I wouldn’t want to hire a good programmer. Not even a great programmer. I’m serious — just check out what I wrote in every cover letter I wrote this year:</p><blockquote><em>You’ll want to know all about me. Here’s the thing: I wouldn’t say I’m a good coder.</em></blockquote><p>Yes, I wrote that in every single cover letter. And yes, I did get hired, and by a place that really values what I bring to the table. Sounds crazy? Here’s what I wrote next:</p><blockquote><em>I </em><strong><em>am</em></strong><em> a great developer, though.</em></blockquote><p>I’m not just being pedantic here about the terms coder and developer. What I’m trying to do is make a very real, and very important point if you want to be a top professional in our field:</p><blockquote><em>Your value doesn’t come from the </em>quality<em> of your work. It comes from the </em><strong><em>impact</em></strong><em> your work has.</em></blockquote><p>In other words, if you’re just a <em>good</em> programmer, you’ve only made it halfway. What you really need is to be an <em>effective</em> developer.</p><h3>An exercise in missing the point</h3><p>A couple years back I got to work on a really cool IoT project. As a web development agency, we’d been wanting to break into IoT for a while. And as a team, we were excited about the potential impact of IoT, <em>and</em> the experience of actually working with IoT technologies.</p><p>So of course we were really excited about this project. Aaaand we were in over our heads. All of a sudden we were dealing with a <strong>ton</strong> of new challenges we’d never thought of before:</p><ul><li>Different sensor and edge device connectivity types</li><li>Different connectivity protocols</li><li>Delivering over-the-air updates without bricking the device</li><li>Ingesting and process massive data pipelines</li><li>…and much, much more.</li></ul><p>And that’s only the real technical concerns. Then there were all sorts of non-technical concerns that we also had to keep in mind:</p><ul><li>How do we provide support to this client after project completion?</li><li>How do we manage the risks of doing something in a completely new field to us?</li><li>How do we develop quickly enough to be profitable when we have no existing work to draw from?</li><li>…and on and on it went.</li></ul><p>Yeah, we were in waaaay over our heads. Not as in a “well that’s impossible” way, but as in a “Hahah ok, good luck, I’m just going to whip up some popcorn and watch the fireworks — who knows, maybe you’ll make it through without setting anything on fire!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*GehBxRrsKI0G6ztF.gif" /></figure><p>But here’s the problem — there’s something missing from that list of concerns. Have you ever noticed that no one likes to hang out with you if you only ever talks about yourself? That’s partly ’cause it makes you an asshole, and also partly because it makes you pretty damn irrelevant.</p><p>And yet, as programmers, we often end up conditioned to think only from our own perspective. Notice how almost all the points in the lists above are all about “me”? What technology do <em>I</em> have to solve, how do <em>we</em> turn a profit on this?</p><p>They’re good questions, but good only gets you halfway, remember? We could’ve absolutely <em>nailed</em> every single one of those questions and it still would’ve made about as much difference as a fart in a jacuzzi.</p><p>Why? Because as a professional, you’re not programming for your own sake — you’re programming to have an impact on someone else. And if you can’t deliver on that value, you’re a bit of an asshole, and pretty damn irrelevant.</p><p>(Don’t believe me? We ended up losing the contract on the project, and all the brilliant work we did being <em>good programmers</em> just became a liability the company had to pay for. Ouch.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/0*Qa4sa1maLOSeZZW-.gif" /></figure><blockquote><em>As a professional, you’re not programming for your own sake — you’re programming to have an impact on someone else. And if you can’t deliver on that value, you’re a bit of an asshole, and pretty damn irrelevant.</em></blockquote><h3>At the intersection of “good” and “need”</h3><p>So here’s the bottom line. Being <em>effective</em> means pairing the <em>good</em> you can do with the <em>need</em> that people have. Ever seen anyone trying to sell oxygen to folks who can breathe just fine? Nope. But when you’re on the lung transplant list, any price becomes a good price. See? <em>Need</em>.</p><p>But there’s a catch with all this — we’re not sensible creatures. We’re emotional, egotistical, and have tragically limited and self-centered perspectives. In other words, we are naturally inclined to lose sight of what need <em>really</em> looks like, and just start thinking that whatever matters to us <em>is</em> the very definition of need.</p><p>Take that IoT project for example. We had folks on the business side of things asking need-based questions like, “What value are we actually selling here?” or “How will this help the client to scale?” Now contrast that to the developer we had who kept insisting that if we were going to win the contract we needed to do Machine Learning in the project.</p><p>Now, none of us really knew much about Machine Learning except that it can provide huge benefits when applied to IoT, but I knew enough to know that Machine Learning isn’t <strong>value</strong>. And that’s because it doesn’t meet a need. No one ever woke up one day and went, “Holy crap, I just realized what I need! I need Machine Learning!” They may have thought “I need Machine Learning to <strong>do something</strong> for me”, sure, but Machine Learning itself is a concept, a set of techniques, not actual value. It’s when the <em>application</em> of that concept creates a <em>result</em> that meets a <em>need</em> that we actually get value.</p><blockquote><em>Value occurs at the intersection of what is “good”, and what is needed. Without both, you have nothing.</em></blockquote><h3>Solving the maze</h3><p>When I was a kid, my father taught me a brilliant trick about solving mazes: start from the end and work backward. If you want to be an effective developer, this should be your guiding light too.</p><p>Here’s how it works. Before you start coding, before you start researching, before you even start thinking you understand the problem, ask yourself “What is the <strong>root need</strong> we need to address here?”</p><p>Why? Well, ever seen those lists of “10 Most Useless Inventions Ever Made”? You don’t want to end up on one of those lists. You don’t want to be one of those poor bastards who thought they had a good idea, only to find out that somewhere along the way they went just a degree or two off course and ended up in a whole different timezone than the actual value they should’ve been aiming for. By fixing yourself on that root need right from the start, you give yourself a guiding star to make sure you nail that need and deliver value.</p><p>However, keep in mind that the key phrase here is <strong><em>root</em></strong> need. Needs are always a hierarchy, and what seems like the real need at first is usually not where it all starts. For example, we might say that the root need is the customer’s need for effective collaboration, but the reality is that the need to solve that stems from the need to get customers to pay us, which stems from the need to keep a roof over our heads, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*IjWHnk9Buu_OqkQx.gif" /></figure><p>Not being a root need doesn’t make a need any less important, but not knowing your real <em>hierarchy</em> of needs <em>will</em> eventually throw you off course, and waste your time and effort on things that, in the end, just don’t matter. Know the needs, know your course, maximize your effort.</p><p>So would I hire a good programmer? Maybe, if there wasn’t anyone else. But an effective developer — someone who knows <strong>what</strong> to do, not just <strong>how</strong> to do — that’s the real deal. That’s who my money would be on.</p><blockquote><em>Don’t do things right. Do the </em><strong><em>right</em></strong><em> things right.</em></blockquote><p><em>Originally published at </em><a href="https://www.webuildlegends.com/good-progammers-are-worthless-who-id-rather-hire"><em>https://www.webuildlegends.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de2e8d6d8ca8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curing developer burnout: obsession, obligation, and harmony]]></title>
            <link>https://medium.com/better-programming/curing-developer-burnout-obsession-obligation-and-harmony-3c66259d6712?source=rss-65ce9635b2e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c66259d6712</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Luke Mayhew]]></dc:creator>
            <pubDate>Thu, 08 Aug 2019 16:30:28 GMT</pubDate>
            <atom:updated>2019-08-09T14:23:03.070Z</atom:updated>
            <content:encoded><![CDATA[<h3>Curing Developer Burnout: Obsession, Obligation, and Harmony</h3><h4>Find your most productive form of passion</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-D32TuKHBxGyssS2YpgZAA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@coltonsturgeon?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Colton Sturgeon</a> on <a href="https://unsplash.com/search/photos/harmony?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>My parents once said that I was like a light switch — either “on” or “off”, with no in-between. Since then I’ve been called “intense”, “obsessive”, and “relentless”. I was even told once I had “an addictive personality” — not in the sense that people just love me that much, but “it’s a good thing you don’t drink ’cause you’d be a binger for sure”. My wife is a tad more kind — she just says, “Well, you’re definitely a ‘passionate’ person.” I like the sound of that — passion is good, right? <em>Wrong</em><strong>.</strong> Turns out passion has been poisoning me for years.</p><p>For a “passionate person”, I have to confess that I don’t really have many passions. The ones that I do have, though? Oh boy, I’m an eleven out of ten for sure. When I like or want something I go all in, full-bore, and I don’t back down, like that psycho dog savaging the hell out of their chew toy.</p><p>Take when I was a kid for example. My oh-so-extensive list of hobbies was: reading novels, playing video games, the end. When I was in Grade 4 my school made us track how many minutes a week we spent reading. Turns out I was already clocking in at 2000+ minutes per week. That’s <em>over 33 hours a week</em>, in Grade 4. So I didn’t just <em>enjoy</em> reading, I <em>loved</em> <em>the heck out of it</em>.</p><p>But that’s a good thing right? Reading makes kids smart and stuff — how could that backfire? Especially when all the most awesome people did the awesome things they did in life because of that level of drive and passion. Surely now as an adult I must be conquering mountains, founding corporate dynasties, or solving world hunger, right?</p><p>Um, nope. Actually, I’m recovering from burnout in starting a business, which I did while recovering from burnout as an employee, which I did as recovery from burnout in social work, which I did while recovering from burnout in retail sales. Do you see the theme yet?</p><p>Burnout. The funny thing about burnout is— passion doesn’t protect you from it. In fact, the wrong kind of passion can push you <em>into</em> burnout (and <a href="https://medium.com/better-programming/redeeming-compsci-sometimes-you-need-to-learn-the-useless-before-you-find-its-use-2f50bd85b3d1">stunt your career</a>). What it comes down to in the end is not so much <em>what</em> you do, or even <em>how</em> you do it — it’s about the fact that you get it done.</p><h3>Three Modes of Doing</h3><p>Beep. Beep. Beep. Beep. Your alarm is going off. Oh god, morning? Again? Already? What day is it? They’re all such similar drudgery it’s hard to keep track. Friday?! Sonofabitch — it feels like a Saturday. For a moment I had hope… ah well. An agonizing roll over, a blind swat at the alarm, and it’s time to peel yourself out of bed to another day of work. Again. Why do you still do this to yourself five days a week? Oh yeah. That paycheck. The one that feeds you. Right. That.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*XIx0z85nCdTr_QzB.gif" /></figure><p>Welcome to the hell that is <em>obligation</em>.</p><p>We’ve all been there. We all know the drill. Doing something because you “have to”, and hating every minute of it.</p><p>Maybe it’s that job where no one gives a shit about your ideas and you’ve got to listen to Morgan Mouth-breather one desk over as your daylight hours burn, just to pad someone else’s pocket. Or maybe it’s just the never-ending stream of laundry or dishes. Or trying to eke some semblance of health out of your body — doctors, tests, treatments, lifestyle changes, and on and on it goes.</p><p>In other words, it’s all those times you “have to”, or else. But at least it’s not that way <em>all</em> the time. After all, there are those rare moments where you actually get to do something because you <em>want</em> to, and that’s <em>always</em> a good thing, right? Well, only a Sith speaks in absolutes. True living has more complexity than that.</p><p>Click. Scroll, scroll, scroll. Click. You’re window-shopping houses like a boss. Only, it’s not actually window-shopping any more, is it? You’ve been at Better Corp for a month already and you still can’t believe the number of zeroes they’re dropping into your account each month. Zeroes that have opened up a whole <em>world</em> for you. All those things you’ve wanted for so long are finally yours for the taking (better make sure that house has a money vault so you can swim in your coins like Scrooge McDuck). Sure, Contrary Carson argues with <em>everything</em> you say or do, and goddamn is that legacy codebase ever a mess. But hey, for that kind of money…</p><p>This, folks, is <em>Obsessive Passion</em>, and it’s been my friend through many dangers. However, unlike Shadowfax, it’s not as pure and noble as it seems. I mean, sure, it can be the fuel you need to get through the tough spots in life. The reason you dig in and carry on and make those good things happen. And actually <em>wanting</em> to do what you’re doing — whatever the reason — is a huge step up from just suffering through an obligation. It’s always nice to be able to feel good about what you’ve done and feel like it was worth it in the end.</p><p>But that’s the key phrase — <em>in the end</em>. It reminds me of a joke I heard once about someone hitting themselves in the head with a hammer over and over. Horrified, an onlooker asked why on earth they would do such a thing. The reply? “Because it’ll feel so good when I stop.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*7OLIU-3cuuEpbV50.gif" /></figure><p>Um, what? That’s crazy, right? Except, unfortunately, that’s what’s going on with Obsessive Passion. It’s all about the <em>result</em>. The motivation is in getting to the result, the enjoyment is in getting closer to the result, the satisfaction is in achieving the result — the result, the result, the result. And what if we never get that result? What if that bug is actually coming from a closed-source dependency that you can’t fix? What if that promotion you’ve been working so hard for goes to someone else? (I can tell you from experience — all the pain you went through to get there suddenly comes crashing down like an Acme anvil).</p><p>For almost three decades I thought this was just how life worked. Passion was when you were motivated by a goal to push yourself through any amount of stress, pressure, and pain to get there.</p><p>And then one day, I heard of a better way…</p><p>You’re setting up the build and dev tools for a new repo at work and it’s forcing you to finally learn about Webpack properly. Normally this is the sort of work you’d hate, but it’s felt pretty painless so far. Almost fun, actually. There’s been something strangely enjoyable about getting this all set up and running, even with all the docs to read and strange behavior to troubleshoot. It feels good to be building up your knowledge and expertise and personal capacity each step of the way.</p><p>Now that you’ve got that proxy working, it’s time for a pull request. Wait, what? It’s been <em>6 hours</em> already? And all those commits were just today? Yikes, time sure does fly when you’re having fun. Wait — did you just say “fun”? Since when was this kind of work <em>fun</em>? Isn’t it normally supposed to be stressful, painful, or <em>at least</em> uncomfortable? Only, it feels like you could do this all day. In fact, you actually <em>want</em> to do this all day!</p><p>This, my friend, is <em>Harmonious </em>Passion, and it’s every bit as wonderful as its name makes it sound. It’s when work stops being <em>work</em>. When work’s something you want to do not because it <em>will</em> be worth it, but because it <em>is</em> worth it — right now, here, at the moment. Unlike Obsessive Passion, which focuses on what you’ll get out of the results, Harmonious Passion is all about finding worth <em>in</em> the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/0*G8B3gHjxMz9B6qeg.gif" /><figcaption>I have no idea who this is but he knows what’s what.</figcaption></figure><p>“Ok,” I can hear you saying, “so what’s the big deal? Passion is passion. If there are two different types then big whoop, why not just stick with Obsessive Passion?”</p><p>OK, but I notice you aren’t saying that about Obligation. “Why not just stick with Obligation instead of having Passion?” said no one ever. And yet Obligation and Obsessive Passion both share a common core — they make the process the enemy.</p><p>Think about the stuff you have to do out of Obligation — maybe it’s the housework, maybe it’s that crap your boss keeps putting on your plate (heck, maybe it’s listening to your boss at all!). Chances are, that’s the stuff you hate, the stuff you really don’t want to be doing. Now, take one of those things you’ve been putting off and procrastinating about. Imagine someone would pay you a million dollars to do it, as long as you could get it done under a tight deadline. What would that look like now? You’d still not like doing the work, but you’d certainly be passionate about getting it done!</p><p>That’s why Obligation and Obsessive Passion <em>both</em> lead to burnout. The whole time you’re engaging in them you’re still at odds with whatever you’re having to do. In other words, you’re fighting against your own experience of life. But your experience is what it is, and being “not ok” with that is like having a psychological autoimmune condition — your psyche literally tears itself apart, with one part fighting the other. I don’t think I have to tell you that that’s a bad situation — let’s just point to my decade-long history of burnout!</p><h3>Learning to See</h3><p>So is it possible to learn to tap into Harmonious Passion more, instead of Obligation or Obsessive Passion? You bet — in fact, that example of Harmonious Passion was actually a real experience I had earlier this week. Like most good things in life, though, it doesn’t come easy. The first step is <em>awareness</em>. You can’t work on what you’re not aware of, so it’s critical to start seeing Obligation, Obsession, and Harmony in yourself, and understanding what’s going on there for you.</p><p>Here’s what you need to do. When doing something, start identifying whether you’re engaging in Obligation, Obsessive Passion, or Harmonious Passion. Then start digging into <em>why</em> it’s that one for you. Why are you only Obligated? Or what is it about what you’re doing that you enjoy and is leading to your Harmonious Passion? It’s all about learning what’s working or not working for you. Then, once you know what makes you tick, you’ll be able to start working on how to hack the system, and start finding ways to “upgrade” your normal mode of doing.</p><p>Try these techniques to uncover what’s really going on with you:</p><ul><li>Ask yourself “Why am I doing this?” (if the answer starts with “I have to [something]” or “I need [something]”, then chances are it’s not Harmonious Passion)</li><li>“Am I enjoying myself?” (if the answer is “no”, it’s not Harmonious Passion. If you’re surprised it’s a “no”, it’s probably Obsessive Passion)</li><li>Look for signs of stress (for me it’s burning, tense shoulder muscles. Noticeable stress is a good sign it’s probably not Harmonious Passion)</li><li>Can you step back or walk away and leave it unfinished, or do you “have to” reach a certain point? (the latter is more likely Obsessive Passion)</li><li>Would you still want to do this even if you never accomplished anything? (if “yes”, it might be Harmonious Passion!)</li></ul><p>These are just a handful of techniques I’ve found helpful, but there’s plenty more information out there on Obsessive/Harmonious Passion, with lots of good ways of identifying them. Use whatever works best for you, but make sure you start cultivating that awareness because the next post will be all about how to leverage your awareness to upgrade Obligation and Obsession into healthier, more productive alternatives!</p><p>In the meantime, drop me a comment and let’s talk about what’s worked and not worked in your journey of cultivating awareness!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c66259d6712" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/curing-developer-burnout-obsession-obligation-and-harmony-3c66259d6712">Curing developer burnout: obsession, obligation, and harmony</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Only the best developers learn useless things (carefully)]]></title>
            <link>https://medium.com/better-programming/redeeming-compsci-sometimes-you-need-to-learn-the-useless-before-you-find-its-use-2f50bd85b3d1?source=rss-65ce9635b2e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f50bd85b3d1</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Luke Mayhew]]></dc:creator>
            <pubDate>Sun, 14 Jul 2019 00:35:07 GMT</pubDate>
            <atom:updated>2019-07-17T15:39:07.357Z</atom:updated>
            <content:encoded><![CDATA[<h4>Finding a balance in how we learn</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*RxQW2tsGJ79lq91WcGtU3g.png" /></figure><p>I used to think that Computer Science was for chumps. That it was all just a bunch of academic BS of no use to anyone in the real world (unless you’re one of those neckbeards working on compilers or something). CompSci seemed like a black hole for money; sucking poor, naive developers into a degree in missing the point. Was that a bit harsh? Sure — I was a young, puffed-up web developer whose self-taught success made him think he was on top of the world. But, was it true? Well, maybe not <em>entirely</em> as it turns out.</p><p>See, I actually ended up needing something from Computer Science the other day. I know — shocking, right? Thing is, I’ve always prided myself on being ruthlessly pragmatic. As much as I love learning, I’m not interested in knowledge for its own sake. I’m here to make a difference — to get real stuff done here in the real world. I’ve got plans, goals, and a drive to make things happen, and anything that’s not moving me toward that would be well advised to stay the hell out of my way. If you want to chase some academic, theoretical whatever your whole life then hey, that’s fine too, but that’s not my shtick. So quite frankly I’ve never had time or patience for CompSci. I always figured if it was actually useful in the real world I would come across a need for it and then reach out and learn it, just like everything else I’ve taught myself.</p><p>And sure, there’s definitely something valid to that. I mean, I owe my success as a highly effective senior developer to it, after all. But that’s only one kind of learning — let’s call it <strong>push-based learning</strong> since you have to be pushed into it. And like just about everything in life, it has its strengths — but also its weaknesses (I got called on those weaknesses in a job interview recently, actually. Who knew interviews could teach you <a href="https://blog.usejournal.com/how-to-avoid-ruining-lives-front-end-security-matters-26d4f906c7a6">how to avoid ruining lives</a> <em>and</em> how to not suck at growing in your own life as well?)</p><h3>Push-Based Learning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n4H9M5kI7yMUO8Kp.png" /></figure><p>As a kid, I always had an affinity for computers. Maybe it was due to the countless hours spent playing games on monochromatic screens with pixels the size of your fist. Maybe it was the fact that my father had been a software developer for decades. Maybe neither, maybe both. In the end, I don’t know what made computers click for me, but I do know what got me to learn how to program for the first time at the tender young age of 10. Games. Hot dang did I ever love games — maybe even more than I loved novels — and I’d been playing some old-school (even back then) text-based adventure games. A combination of gaming <em>and</em> storytelling? I was all over that. So when my father told me I could actually make these wondrous marvels? Yep, sign me straight up.</p><p>So he taught me how to build a basic text-based adventure game which I managed to use as a kickass school assignment. What an amazing feeling. I made everyone I knew play that thing, biting my nails as I watched them play and searching for any indication of enjoyment. The thrill, the rush of building a world we could step into and ride our imaginations to the ends of the world. With that excitement shining in my eyes, surely that was the start of my journey with programming and from that point, I started passionately coding into the wee hours of the night by CRT-nightlight — right?</p><p>Nope. See, no one else I knew really liked text-based adventure games, and what’s the point in building a game no one will play? Knowing that the wide world of programming had so much more to offer, my father tried teaching me more — drawing 2D graphics on the screen — but that fell through and I dropped out of the programming scene.</p><p>Did you spot where things went wrong? <a href="https://www.webuildlegends.com/obsessive-harmonious-obligated-you-choose">I was chock-full of obsessive passion but never learned to tap into harmonious passion</a>. And that, in part, was because I was following <strong>push-based learning</strong>. With push-based learning, we only learn when there’s a clear and current demand for the outcome of that learning. In other words, I couldn’t be bothered to learn those 2D graphics because I didn’t see a need for putting colored lines and simple geometric shapes on the screen.</p><p>But there’s a problem with that: <em>I don’t have perfect insight</em>. I couldn’t see it at the time, but those shapes I was putting on the screen were the foundation for more advanced programming that <em>would</em> have gotten me somewhere. As much as I love web development, imagine if I continued pursuing those skills back when I was ten and ended up with the skills needed to get hired as a game developer. Holy crap. Building those godawful text-based adventure games as a kid got me so fired up, I can’t even imagine what my life could’ve been like if I hadn’t said “I don’t see the point” and dropped out.</p><p>Push-based learning is great for keeping us on track and well-grounded in our current reality, but its gaping flaw is that it’s completely vulnerable to the unknown unknowns. Sometimes, you don’t know how useful something will be until you’ve actually learned it and can now see its use cases. If you’re lucky, you’ll stumble across these things and find out enough to at least have an idea of the gaps in your knowledge. But how often are we not even stumbling onto these things and having them slip through our grasp entirely? I have no idea — and that’s the whole point (and the danger).</p><h3>Pull-Based Learning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XqmyQ8rdhiT88eeu.jpg" /><figcaption>Photo by <a href="https://unsplash.com/@robertwalsh0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rob Walsh</a> on <a href="https://unsplash.com/search/photos/dreamer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Pull-based learning is the counterpart to push-based learning. It’s all those times you learned something just in case it might come in handy or because you enjoyed the learning itself (you’ve done that at least once or twice, right?). It’s no silver bullet though — as always, there are both strengths and weaknesses here.</p><p>The first weakness — and probably the one that has been behind most of my scorn for it in the past — is that folks who primarily follow pull-based learning often end up just being <em>so damn useless</em>. With pull-based learning there’s a very real danger of getting lost down a rabbit hole — or worse, a rabbit <em>warren</em> — with nothing tangible to show for it. You know what I mean — we’ve all seen those folks who know so much about things like blockchain, or the internal workings of some compiler, but when you ask them if they’ve ever come across a case where that knowledge provided better cost-to-benefit ratio than any other option, the answer ends up being “no” in the vast majority of cases.</p><p>The second big weakness I’ve seen when folks chase pull-based learning too hard is that they start to think that it’s the <em>learning itself</em> that’s the goal, or where the value is. Take Haskell for example — it’s hard to learn, and that’s not a good thing. But a lot of Haskellers — once they’ve got the hang of it — seem to see that pain as a badge of honor, rather than something to be improved on. As if the challenge of the learning gives the learning itself some kind of extra worth somehow.</p><p>Or there are all of the developers who love functional programming (as I do), use JavaScript as their weapon of choice (as I do) and end up jumping through crazy, convoluted hoops to force functional programming into their JavaScript (as I sometimes do), even when the language design really doesn’t want to cooperate with that. And when asked why, I’ll get answers about all sorts of features of functional programming — “it’s point-free” or “it separates ‘data this’ from ‘functionality that’”.</p><p>But the truth is, something like point-free style is a <em>technique</em>, not a <em>benefit</em>. <em>How</em> does point-free help us <em>here</em>? What’s the <em>impact</em>? Getting too caught up in pull-based learning seems to often blind us to the difference between the <em>value</em> of knowledge (which is the <em>result </em>of the application of that knowledge, and is dependent on the context of that application), and the knowledge itself.</p><h3>Yin and Yang</h3><p>So where does this leave us? If both styles of learning have their weaknesses — is there no hope? The answer, like with most things in life, is a balance in finding the right tool for the job. We can’t truly thrive without pull-based learning taking us to places we’d otherwise never go, and we can’t be effective without push-based learning keeping us on track.</p><p><strong>When using push-based learning, keep the following in mind:</strong></p><ul><li>Don’t be so results-focused that you lose the drive for anything that isn’t pushed on you.</li><li>Remember that you have unknown unknowns — you can’t say that something is more important just because it’s more needed when you don’t know how useful something unknown might be!</li><li>When we’re too grounded we lose creativity, flexibility, and openness to new. Take a step back every so often to survey other options and approaches to deliberately remove your blinders.</li></ul><p><strong>When using <em>pull</em>-based learning, keep the following in mind:</strong></p><ul><li>Don’t get lost down the rabbit holes! Take a step back every so often to ask yourself “Are there things I know/can do already that could be good/close enough?”</li><li>Remember that as a developer, your <em>professional</em> knowledge and skillset exists for a purpose — creating real-world value. Don’t get sucked into valuing knowledge for its own sake. Its value is in the impact it creates — use that as your evaluating rubric.</li><li>Exploration (as with pull-based learning) can lead to greater creativity, flexibility, and openness to new things, but at the cost of focus and drive. Be willing to put your pull-based learning on the back-burner when life throws curveballs at you that need to be dealt with here and now.</li></ul><p>And above all — try not to judge others who more naturally fall into a different part of the spectrum (yes, I know, my bad, I’m working on it). Take a lesson from the Yin and Yang — nothing is solely good, nothing is solely bad. We need all types of folks to make the world go round, and we all need a well-rounded personality. Just try to use the right tool for the job!</p><p><em>Originally published on my blog (</em><a href="https://www.webuildlegends.com/redeeming-compsci-use-in-the-useless"><em>https://www.webuildlegends.com</em></a><em>)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f50bd85b3d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/redeeming-compsci-sometimes-you-need-to-learn-the-useless-before-you-find-its-use-2f50bd85b3d1">Only the best developers learn useless things (carefully)</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to avoid ruining lives (front-end security matters)]]></title>
            <link>https://medium.com/@mayhewluke/how-to-avoid-ruining-lives-front-end-security-matters-26d4f906c7a6?source=rss-65ce9635b2e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/26d4f906c7a6</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Luke Mayhew]]></dc:creator>
            <pubDate>Tue, 30 Apr 2019 20:28:17 GMT</pubDate>
            <atom:updated>2020-07-30T15:05:32.217Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*UOMDrxWKTjbgTLouZ7-C0A.gif" /><figcaption>You don’t want to be this guy.</figcaption></figure><p>Ever been asked something in an interview that just totally stumped you? I have. It’s been a while, but I remember those painful moments where you’re racking your brain and coming up blank. I had a new one the other day though. A worse one. See, it’s one thing to be asked something hard and not know. But when I was asked to explain Cross-Site Scripting, I <em>knew</em> it was Web Dev 101 concept — I remember learning about it way back when after all. So after 5 years of professional experience, <em>I knew I should know</em>, and I <em>still</em> came up blank.</p><p>But if this was just about looking stupid in front of my interviewers, it wouldn’t be quite such a big deal (even though it would still be a “1/10 would not do again”). The thing is, though, I knew that by not knowing about basic front-end security, I wasn’t just letting myself down in the interview, I was letting the world down.</p><p>Alright, sure, I get that that sounds a bit melodramatic — it’s just a bruised ego, right? And security is really for back-end devs anyway, isn’t it? If that’s what you’re thinking I’ll let you off easy this time and just chalk it up to you coming down with a bad case of “not-my-job-itis” today (we all have those moments sometimes, just don’t let it become a habit).</p><p>Except here’s the thing: the internet is a dangerous place. What would happen to your company if it became that latest hacking scandal? What if a friend or family member who uses your company’s product broke down and told you how that hack had ruined their life? Maybe hackers stole their life savings. Maybe their reputation was ruined and they lost their job. The impact of the Ashley Madison hack of 2015 was measured in lives lost, not just passwords stolen. Imagine your friends and loved ones torn apart by that security breach. And now imagine that it came back to you, and your work, and something you could have done toward better security but didn’t.</p><p>As makers of technology, we have a responsibility to the people we serve. A lot of responsibility, actually, and one area of that responsibility is keeping them safe. Do you really want to just say “Oh well, not my job. I’ll let someone else tackle security — like the back-end devs or devops folks”? Good luck saying that to your loved ones whose lives have been ruined by using your work. Nothing in development happens in isolation — a front end does nothing without a back end, and a back end can’t be used without a front end into it, and on and on it goes. We all work together, and washing your hands of things that “aren’t my job” is irresponsible and dangerous.</p><p>So yes, security <strong><em>is</em></strong> our concern as front-end developers. And here’s the quick-n-dirty on the two most common ways we can protect our people:</p><h4>Cross-Site Scripting (XSS)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*P4nj9fJjSeJ9-c0rwSZqlg.png" /><figcaption>You think this only happens to back-end devs? Think again. (<a href="https://xkcd.com/327/">https://xkcd.com/327/</a>)</figcaption></figure><p>XSS is remarkably straightforward for a security exploit. It essentially boils down to giving a malicious party a way to inject code into your site, and have the browser run it thinking it’s part of your site. Here’s an example of all it takes to be vulnerable to this exploit:</p><pre>const username = document.querySelector(&#39;input&#39;).value;<br>document.querySelector(&#39;#greeting&#39;).innerHTML = `Hi ${username}!`;</pre><p>Seems harmless enough, but what happens if the user types some malicious code into the input element? For example:</p><pre>&lt;img src=”x” onload=”const cookies=document.cookie; const xhr=new XMLHttpRequest(); /* Send cookies to attacker’s site here */” /&gt;</pre><p>An XSS vulnerability essentially gives the attacker full access to do anything that the user could do — sending a bank transfer, stealing all of their data; if your code can do it, the attacker can do it. The good news is that it’s fairly easy to avoid, especially when using modern frameworks and libraries rather than direct DOM manipulation. Keep in mind that the example above isn’t the only way XSS can happen — it can happen when using URL query parameters, or server-rendered content (either through traditional server-side languages/frameworks like Ruby on Rails, or through server-side rendering of front-end content like React). For a the full details on XSS check out the very handy <a href="https://excess-xss.com/">Excess XSS</a> site.</p><h4>Cross-Site Request Forgery (CSRF)</h4><p>What? Another Cross-Site something or other? What the heck? Yes, it’s confusing (I actually explained (very poorly) CSRF instead of XSS in my interview), but don’t worry, I’ll give you an easy way to remember the difference at the end of the post.</p><p>A CSRF attack works by taking advantage of two things:</p><ol><li>Browsers automatically send all cookies for a site whenever performing a request to that site.</li><li>This is true of any request to that site, regardless of where it’s originating from.</li></ol><p>Imagine we’ve got an endpoint on the back end that looks something like https://bank.com/transfer?to=landlord&amp;amount=1000 . We think that’s all fine and dandy, because it’s locked down to only work for authenticated users. However, all a CSRF attacker has to do is create a link (in an email, on a website, etc.) that hits that endpoint with malicious parameters and then trick you into clicking it. For example:</p><pre>&lt;a href=&quot;<a href="https://bank.com/transfer?to=meanperson&amp;amount=1000000">https://bank.com/transfer?to=meanperson&amp;amount=1000000</a>&quot;&gt;<br>  OMG this is the CUTEST cat picture EVER!<br>&lt;/a&gt;</pre><p>You click that, the request goes off to the bank, the browser kindly sends your authentication cookies, and the bank shrugs and says “Ok, if you say so, my oh-so-authentic-looking user.” Now, if you’re a smarty-pants you might be thinking, “Ok well sure, but GET requests shouldn’t be making changes, so problem solved.” Not so fast. The same technique could be done by tricking you onto a site with a form that auto-submits (via JS) a POST against the site with the right info.</p><p>So how do we defend against this? Well, that’s a tad trickier than with XSS. In fact, there are multiple different approaches, but one common one for Single Page Applications is to make use of a CSRF token. This token is generated by the server and added to the page for the SPA to grab once it’s loaded. The SPA sends the token with each request, and the server can then verify that the request has both the authentication token <em>and</em> the CSRF token. Since any request originating from an attacker would be coming from a site that <em>wasn’t</em> served up with one of our CSRF tokens, requests triggered by an attacker get rejected.</p><p>As always with security there’s a lot of edge-cases and different implications to consider, so make sure you do your homework on CSRF before implementing it and calling it a day!</p><p>XSS and CSRF are only the tip of the iceberg when it comes to web security. They’re the two that are most likely to affect you as a front-end developer, but they’re by no means the whole picture. Even if the solutions aren’t always implemented on the front-end, don’t forget that each of us has a part to play, and we can only play that part if we’ve got the eyes to see and mind to understand. A safer web for our families, friends, and ourselves starts with each of us taking responsibility and working together!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*AjR1b3YCadRqKH6p-7_VHw.gif" /></figure><p><strong>P.S.</strong> I promised you an easy way to remember the difference between Cross-Site <em>Scripting</em> and Cross-Site <em>Request Forgery</em>, and I don’t like to disappoint, so here it is. Cross-Site <strong>Scripting</strong> involves injecting a <strong>script</strong> into the real webpage, and Cross-Site <strong>Request</strong> Forgery involves tricking the user (or the browser) to make a <strong>request</strong> that they don’t really want to, starting from a malicious webpage/email/etc. So “… Scripting” is allowing the bad guys to inject a script, and “… Request…” is tricking you into making a (bad-for-you) request. Simple, yes, but only once you can see the pattern without being dazzled by the extra words :)</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26d4f906c7a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>