<?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 RJ Robinson on Medium]]></title>
        <description><![CDATA[Stories by RJ Robinson on Medium]]></description>
        <link>https://medium.com/@RJrobinson?source=rss-3a1e7768af4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Ll6aegd_qrgRlDHtr1LP1w.jpeg</url>
            <title>Stories by RJ Robinson on Medium</title>
            <link>https://medium.com/@RJrobinson?source=rss-3a1e7768af4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 12:47:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@RJrobinson/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[Companies Have Only Themselves to Blame for the “Engineering Shortage”]]></title>
            <link>https://medium.com/@RJrobinson/companies-have-only-themselves-to-blame-for-the-engineering-shortage-110714cb0b22?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/110714cb0b22</guid>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 16:26:33 GMT</pubDate>
            <atom:updated>2025-12-22T16:26:33.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M-D893BPTEBsdKOA" /><figcaption>Photo by <a href="https://unsplash.com/@introspectivedsgn?utm_source=medium&amp;utm_medium=referral">Erik Mclean</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Every few months, a VP of Engineering posts on LinkedIn about how difficult it is to find good developers. The replies fill up with HR folks nodding along, recruiters offering their services, and bootcamp grads wondering what the hell they’re supposed to do now. Sadly, the 2015s were a decade ago.</p><p>Alert: There’s no shortage of engineers. <br>There’s a shortage of engineers that companies are willing to hire and develop. ( and we are going to get to that last part real quick. )</p><h3>The Junior Role That Requires 5+ Years of Experience</h3><p>I had a recruiter reach out to me about a senior role, and included in that nugget of a form letter was a comment about how they also had a “Junior Software Engineer” role that required 5+ years of experience.</p><p><strong>Read that again. <em>Junior</em>. Five years.</strong></p><p>This isn’t an edge case. It’s the norm now. Not the first time I have seen this either. Companies have collectively decided they only want to hire people who are already good at the job. They want fully-formed senior engineers who can hit the ground running on day one, require zero mentorship, and somehow magically exist despite no one being willing to train them, invest in them, and actually put them on a trajectory for success.</p><p>Where exactly do these engineers come from? Other companies, apparently. It’s a giant game of musical chairs where everyone is trying to poach from everyone else, and nobody wants to sit down and actually develop talent. (If you&#39;re keeping track at home, I have called out developing talent yet again )</p><h3>The Death of the Training Pipeline</h3><p>When I started in this industry 14+ years ago, companies understood that junior engineers were an investment. You hired smart people who could learn, paired them with senior folks, gave them progressively harder problems, and in a few years you had loyal, skilled engineers who knew your systems inside and out.</p><p>That model is dead.</p><p>Now companies want to hire senior engineers at mid-level salaries, work them until they burn out, and then complain about retention problems. Training budgets got slashed. Mentorship programs got deprioritized. The attitude became “we don’t have time to train people, we need people who can deliver now.” And I get that. Deliverability is paramount in business success.</p><p>And then everyone acts surprised when there aren’t enough experienced engineers to go around.</p><h3>The Bootcamp Problem (That Companies Created)</h3><p>Bootcamps get a lot of hate, and some of it is deserved. I was a bootcamp grad, and my experience was that of perfect timing and relentless drive. I haven&#39;t stopped learning and diving into this world at any point. Finished my bootcamp. Went to undergrad. Finishing my master&#39;s. <br>Bootcamps exist because companies created the demand for them.</p><p>When the industry was desperate for talent in 2015–2018, companies hired boot camp graduates left and right. They viewed the bar from a different angle because they needed people. Could we hire someone with basic skills and develop them? Some of those hires worked out great. Others didn’t. That’s how hiring works.</p><p>But now companies want to have it both ways. They want to pay bootcamp-grad salaries while demanding CS-degree-plus-five-years-experience qualifications. They flooded the market with entry-level positions during the boom, trained none of those people properly, and now complain that there aren’t enough senior engineers.</p><p>You made this bed. Lie in it.</p><h3>The Real Problem: Demand for Great Engineers Exceeds the Industry’s Ability to Create Them</h3><p>Here’s what’s actually happening: the demand for <em>great</em> engineers far exceeds the industry’s ability to retain and develop new talent.</p><p>Great engineers don’t spawn fully formed. They’re built over years through mentorship, challenging projects, code reviews, production incidents, and learning from people who came before them. That pipeline takes time and investment.</p><p>But companies don’t want to invest. They want to extract. They want engineers who already have the skills, already have the experience, and are somehow still willing to accept below-market compensation.</p><p>Meanwhile, perfectly capable junior and mid-level engineers are stuck in limbo. They can’t get hired because they don’t have enough experience. They can’t get experience because no one will hire them. Some of them give up and leave tech entirely.</p><p>And then VPs tweet about the talent shortage.</p><h3>What Would Actually Fix This</h3><h3>What Would Actually Fix This</h3><p>It’s not complicated, but it does require actual effort.</p><p><strong>Hire junior engineers.</strong> Real ones. People with potential who need development. Budget for the fact that they won’t be fully productive for 6–12 months. That’s not a bug, it’s the deal.</p><p><strong>Stop requiring 5 years of experience for entry-level roles.</strong> <br>You look ridiculous.</p><p><strong>Accept that training is part of the cost of doing business.</strong> You can’t outsource engineer development to bootcamps and universities and then complain about the results. A CS degree teaches theory. A bootcamp teaches syntax. Neither teaches someone how to navigate your codebase, understand your domain, debug your production systems, or work effectively on your team. That last mile of development is <em>your</em> job. It always has been. Pretending otherwise doesn’t make it someone else’s problem — it just means you’re not getting the engineers you need.</p><p><strong>Pay people fairly.</strong> If you want senior engineers, pay senior rates. If you’re paying junior rates, hire juniors and train them. You don’t get to demand five years of experience and offer entry-level compensation. Well, you can demand it — you just won’t get it, and then you’ll tweet about the talent shortage.</p><p><strong>Keep the pipeline full.</strong> This is basic supply and demand. You need a steady queue of early-career engineers moving through your organization. Here’s why:</p><p>First, you need engineers who can handle the CRUD work — pun intended. It’s expensive for a senior or staff engineer to spend their day on straightforward bug fixes, simple feature flags, or find-and-replace refactors. I’m not saying this work is beneath them. I’m saying it’s cost-prohibitive. You’re paying $200k+ for someone to do work that a well-supported junior could handle at half the cost while <em>learning your systems in the process</em>. That’s a two-for-one deal you’re leaving on the table.</p><p>Second, your senior and staff engineers need to be doing senior and staff work — making architecture decisions, coordinating across teams, providing mentorship, and developing technical strategy. Every hour they spend on ticket-queue busywork is an hour they’re not spending on the high-leverage problems only they can solve. A healthy pipeline means your expensive talent can focus on expensive problems.</p><p>Third, and this is the one everyone forgets: your seniors are going to leave. They’re going to get poached, burn out, start a company, or just decide they want to do something else. If you haven’t been developing juniors into mids and mids into seniors, you’re starting from zero every time someone walks out the door. Your institutional knowledge leaves with them, and you’re back to posting “Junior Engineer, 5+ years required” and wondering why nobody’s applying.</p><p>The companies that figured this out have a continuous flow of talent at every level. The ones that didn’t are stuck in an endless, expensive cycle of external hiring, ramp-up time, and attrition. <br>Pick your cost.</p><h3>What “Developing Engineers” Actually Looks Like</h3><p>Here’s where most companies fail. They think development means “assign them tickets and hope they figure it out.” Let me space this out for you…</p><p><strong>That’s not development.</strong></p><p>Real development is intentional, structured, and takes actual time from your senior people. Here’s what it looks like in practice:</p><p><strong>Pair programming that isn’t performative.</strong> Not “let me take over your keyboard and show you how smart I am.” Actual pairing where the junior drives, makes mistakes, and learns to debug their own thinking. The senior asks questions instead of giving answers. “What do you think happens if we call this before that?” “Where would you look to figure out why this is slow?”</p><p><strong>Code review as teaching, not gatekeeping.</strong> A good code review doesn’t just say “change this.” It explains <em>why</em>. “This works, but here’s why it might cause problems at scale.” “This pattern tends to bite us later because…” Every PR is a chance to transfer knowledge. Most companies treat it as a checkbox.</p><p><strong>Graduated complexity.</strong> You don’t throw a junior into your most critical system on day one. You give them a bug in a well-understood area. Then a small feature. Then a larger feature. Then ownership of a component. Each step builds on the last. This requires someone actually thinking about their growth trajectory, not just assigning whatever ticket is next in the backlog.</p><p><strong>Production exposure with guardrails.</strong> Juniors need to see what happens when code hits real users. Let them shadow on-call. Walk them through an incident retrospective. Show them how to read the dashboards. When something breaks, don’t shield them from it — explain what’s happening and how you’re thinking through the fix.</p><p><strong>Explicit knowledge transfer.</strong> Your senior engineers have years of context in their heads about why things are the way they are. That knowledge walks out the door when they leave unless you’re actively transferring it. Documentation is part of it, but so is sitting down and explaining “here’s why we built it this way, here’s what we tried that didn’t work, here’s what I’d do differently now.”</p><p><strong>Time that’s actually protected.</strong> This is the hard part. Mentorship takes hours. Real hours that could be spent shipping features. If you measure your senior engineers purely on output and then wonder why they don’t mentor anyone, you’ve answered your own question. Development has to be valued, measured, and rewarded — not treated as a nice-to-have that happens in the gaps.</p><p><strong>Psychological safety to fail.</strong> Juniors need to be able to ask “dumb” questions, break things in staging, and admit when they’re stuck. If your culture punishes people for not already knowing everything, your juniors will hide their gaps instead of addressing them. They’ll ship code they don’t fully understand. They’ll stay junior forever.</p><p>None of this is revolutionary. It’s how engineering culture used to work before everyone decided they only wanted to hire fully-formed seniors. It takes time and it costs money, but it’s cheaper than the endless cycle of poaching, burnout, and attrition that most companies are stuck in now.</p><h3>Now Let’s Talk About You</h3><p>Alright, we’ve successfully blamed the companies. And they deserve it. But let’s be honest with ourselves too.<br>I’ve met engineers with “Junior” in their title for three, four, five years. At some point, that’s not just the company’s fault. I’ve had conversations with some of these folks, and I always ask the same two questions.First:</p><blockquote><em>“What gaps do you think are keeping you at this level?”</em></blockquote><p>Most people can answer this. They know. “I’m not great at system design.” “I struggle with debugging production issues.” “I don’t understand the infrastructure side.” “Database design scares me.”</p><p>Good. Self-awareness is the first step.</p><p>But it’s the second question that separates people who stay junior from people who don’t:</p><blockquote><em>“What are you doing to close that gap?”</em></blockquote><p>And too often, the answer is… nothing. Or “I’m hoping to get more exposure at work.” Or “I’m waiting for my company to send me to a training.”</p><p>That’s not a plan. Hoping someone else fixes your career for you is a recipe for disaster, as the previous few chapters highlighted how companies are doing a poor job at this.</p><p>Look, I don’t advocate for grinding away your nights and weekends on corporate work. Your off-hours are yours. But honing your craft as an engineer is going to require some homework. <br>That’s true of every profession. Doctors study. Lawyers study. Electricians study. The idea that you’re going to level up purely through osmosis during business hours is a fantasy.</p><p>You don’t need to mass-produce side projects or have a monster GitHub profile. But you do need to be intentional about your growth:<br>Read the docs for the tools you use every day but don’t fully understand. Actually read them.</p><p>When you hit a bug you can’t figure out, don’t just ask someone for the answer — ask them to walk you through how they’d debug it.</p><p>Pick one thing you’re weak at and spend a few hours a week getting less weak at it. System design? Read a book. SQL? Do some exercises. Testing? Write tests for code that doesn’t have them.<br>When your company offers learning resources, use them. A shocking number of engineers have access to O’Reilly, Pluralsight, or internal training budgets and never touch them.</p><p>Ask for feedback, and actually listen to it.</p><p>Not “good job” feedback — real feedback about where you need to improve.<br>Your company should be investing in your development.</p><p>Absolutely. But your career is yours. If your company isn’t developing you and you’re not developing yourself, you’re going to stay exactly where you are.</p><p>The engineers who grow fastest are the ones who take ownership of their own trajectory, even when their company isn’t doing its part. Especially when their company isn’t doing its part.</p><p><em>I’m a staff software engineer with 15 years of experience and an EMT. I write about engineering and the messy intersection of life. I</em></p><p><em>f this resonated, follow along — more to come. @_AwesomeRob</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=110714cb0b22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“This Degree is Too Easy” — A Different Perspective from Someone 60% Through WGU’s MSSWE]]></title>
            <link>https://medium.com/@RJrobinson/this-degree-is-too-easy-a-different-perspective-from-someone-60-through-wgus-msswe-b6cd1aa145cd?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6cd1aa145cd</guid>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Sat, 06 Dec 2025 04:23:42 GMT</pubDate>
            <atom:updated>2025-12-06T04:23:42.393Z</atom:updated>
            <content:encoded><![CDATA[<h3>“This Degree is Too Easy” — A Different Perspective from Someone 60% Through WGU’s MSSWE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z_scZMI9wm1mnTYx" /><figcaption>Photo by <a href="https://unsplash.com/@marvelous?utm_source=medium&amp;utm_medium=referral">Marvin Meyer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>I recently saw a post online claiming that WGU’s Master of Science in Software Engineering program is “too easy.”</h3><p>I don’t completely disagree. However, I will push back a bit.</p><p>Let me explain…</p><h3>This Program Wasn’t Designed for Beginners</h3><p>Let’s get something out of the way: this program is designed for people already working in the field, and has been for some time.</p><p>The fact that non-software engineers, or those in very early career stages, enroll in these programs and then expect to emerge as experts in software engineering baffles me. That’s not what this is. This is a competency-based program, not an academically grueling one. You’re demonstrating what you already know … not learning everything from scratch.</p><p>If you’ve been working in software for any length of time, you’ve likely encountered most of this material before. Requirements gathering. Agile methodologies. System design. Architecture patterns. You’ve lived it. The program requires you to formalize, articulate, and defend that knowledge.</p><p>That’s different from “easy.”</p><h3>“Easy” vs. “Less Volume”</h3><p>I spent time at Georgia Tech’s renowned OMSCS program. I absolutely loved it. It wasn’t necessarily <em>hard</em>, but it was challenging — and it was a lot. Like, a %^*&amp;ing ton of work.</p><p>Every single week: papers, quizzes, discussion posts, office hours, group projects. Thing after thing after thing. I spent 20–30 hours a week on coursework, often on subjects I had rarely touched in 15 years of working in the industry. It was very academic. Theoretical. Rigorous in a traditional sense. Again. I&#39;m not saying that this is bad. It&#39;s actually amazing, and that&#39;s why I loved the program.</p><p>The PAs at WGU aren’t any less <em>difficult</em> than what I did at Georgia Tech, in my opinion. The difference is volume and schedule. At GT, you’re drowning in weekly deliverables on a fixed timeline. At WGU, you move at your own pace.</p><p>I have a full-time job. I have a kid. I don’t have 30 hours a week to dedicate to school, no matter how much I want to. Some weeks I would. Some weeks, I would fall behind. This led to late nights, missed sleep, and poor work performance. I’m in my 40s. I have a family. I no longer have that kind of time. That’s why I came back to WGU. Georgia Tech was amazing, and if I ever find the time, I’d go back in a heartbeat. But right now, time is the one thing I don’t have. Ok, enough about how I have no time, but I needed to write a 2-page blog post at 11 pm on a Friday.</p><p>WGU lets me own my schedule. That’s not a weakness of the program — it’s the entire point.</p><h3>You Own Your Experience</h3><p>Here’s the uncomfortable truth about competency-based education: you get to decide how much you put in.</p><p>Want to skate by with the bare minimum? Sure. You can probably do that. If checking a box is your goal, the program will allow you to do so.</p><p>Or you could write the most detailed, research-heavy projects possible. You could spend weeks refining a single paper until it’s publishable. You could delve deeply into every topic, treating each performance assessment as an opportunity to master a specific skill.</p><p>That’s your choice. You’re an adult.</p><p>Could I fly through these PAs? Absolutely. I already know a lot of this material. I’m confident I could pass most of them with minimal effort. 10 classes in 10 weeks. I could be a speed runner. 100%</p><p>But here’s what 15 years as a software engineer has taught me: <strong>fundamental skills are always what get me through the tough problems.</strong> Not the fancy new framework. Not the clever hack. The fundamentals.</p><p>So I slow down. I dig in. I treat each PA as an opportunity to reinforce foundations I thought I already understood. And every single time, I learn something I didn’t know — or I strengthen a mental model that was shakier than I realized.</p><p>That’s not the program being easy. That’s me choosing to make it valuable.</p><h3>What I Actually Like About This Program</h3><p>Let me be clear: I’m not here to be a WGU apologist. The program has its flaws. Some courses feel redundant. Some rubrics are vague. The AI detection situation is a mess (but that’s a topic for another post).</p><p>But here’s what I genuinely appreciate:</p><ul><li><strong>It draws from modern software methodologies.</strong> This isn’t outdated textbook theory. The material reflects how software is actually built today.</li><li><strong>It challenges me to think critically about what I’m building.</strong> Not just <em>how</em> to build something, but <em>why</em> — and whether I should build it at all.</li><li><strong>It forces me to communicate technical decisions to non-technical stakeholders.</strong> If you’ve never had to explain a microservices architecture or machine learning pipelines to a VP who just wants to know why the project is late, you’re missing a critical engineering skill.</li></ul><p>That last one matters more than most engineers want to admit.</p><h3>“There’s Barely Any Coding in the Software Engineering Master’s?”</h3><p>A Discord friend recently said this to me. And honestly, I get it. On the surface, it appears to be a valid criticism.</p><p>But here’s a question I’ve been asked many times in my career: <em>What’s the difference between a software programmer and a software engineer?</em></p><p>This is not a Master’s degree in programming. It’s a degree in engineering.</p><p>We moved past programming in undergrad. We moved past it in our first few years on the job. By now, you should know how to write code. That’s table stakes.</p><p>This program is about zooming out:</p><ul><li><strong>Architecture and system design</strong> — How do you structure a system that will evolve over years?</li><li><strong>Design Patterns and Trade-offs</strong> — When Is a Microservice the Right Call? When is it overkill?</li><li><strong>Risk assessment and mitigation</strong> — What happens when this fails? How do we plan for it?</li><li><strong>Stakeholder communication</strong> — Can you explain your technical decisions to someone who doesn’t code?</li><li><strong>Build vs. Buy Decisions</strong> — Should we build this ourselves or use an existing solution?</li><li><strong>Scalability and Maintainability</strong> — Will this system survive success? Will the next engineer be able to understand it?</li><li><strong>Leading teams through technical complexity</strong> — Can you guide a team through ambiguity and make decisions with incomplete information?</li></ul><p>A programmer writes code.</p><p>An engineer designs systems, anticipates failures, makes trade-offs, and most importantly, communicates <em>why</em>.</p><p>If you want a degree that’s 90% coding, consider getting a boot camp certificate. There’s nothing wrong with that — but it’s a different goal.</p><h3>The Trade-Off of Competency-Based Education</h3><p>The program gives you what you put into it. That’s the deal.</p><p>Some people want a degree — a checkbox for HR, proof that you have the credential.</p><p>Some people want a job — a line on the resume that gets you past the recruiter. Good luck if your skills as an engineer are shit.</p><p>Some people want skills — and this is the camp that actually succeeds in the long term.</p><p>You don’t build skills by half-reading the material and flying through a PA in one sitting. You might pass, sure. But you don’t get to turn around and complain that the program was “too easy.” You didn’t engage with it. You skated by. These are decisions that YOU make.</p><h3>So, Is It Too Easy?</h3><p>Maybe. Maybe not.</p><p>It depends entirely on what you’re trying to get out of it.</p><p>If you show up looking to check a box, you’ll check the box.</p><p>If you show up looking to coast, you can probably coast.</p><p>However, if you show up seeking to refine your fundamentals, formalize your experience, and challenge your assumptions, the program will meet you there.</p><p>Easy doesn’t mean worthless. Unless you make it that way.</p><p>Challenge yourself. You get out what you put in.</p><p>That’s it.</p><p><em>I’m currently 60% through WGU’s MSSWE program while working full-time as a software engineer. I write about engineering and the messy intersection of life. If this resonated, follow along — more to come.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6cd1aa145cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Dark Side of Gamification: How Uber, Lyft, and DoorDash Exploit Customers and Drivers]]></title>
            <link>https://medium.com/@RJrobinson/the-dark-side-of-gamification-how-uber-lyft-and-doordash-exploit-customers-and-drivers-4c42bd954b0b?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c42bd954b0b</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[gamification]]></category>
            <category><![CDATA[dark-gamification]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 16:41:18 GMT</pubDate>
            <atom:updated>2024-09-14T16:41:18.742Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Is technology serving us, or are we serving it?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DTbwp91Bp0XvoG93" /><figcaption>Photo by <a href="https://unsplash.com/@grixo?utm_source=medium&amp;utm_medium=referral">Javier Grixo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This question haunted me as I stood outside the Phoenix airport earlier this year. The desert sun cast long shadows, and the heat was intense, but I was more preoccupied with the unsettling feeling growing in my chest. I had just opened the Uber app to request a ride to my hotel, expecting the usual convenience. Instead, I was met with an unusually high fare, even though the airport wasn’t particularly busy. Something didn’t add up.</p><p>As a senior software engineer with a passion for human-computer interaction, I couldn’t shake the feeling that there was more beneath the surface. This wasn’t just about surge pricing — it felt like a symptom of a deeper issue.</p><h3>The Comfort of the Known World</h3><p>In our daily lives, apps like Uber, Lyft, and DoorDash have become symbols of convenience and control. They represent a <strong>known world</strong> where services are just a tap away, providing us with utility, predictability, and a sense of safety. Need a ride? Open an app. Craving your favorite meal? It arrives at your doorstep in minutes. Technology, in this context, is our obedient servant. It’s living in the future, and at times feels like magic.</p><p>This seamless integration of services into our routines has positive aspects:</p><p>-<strong> Utility:</strong> Immediate access to transportation and food.<br>- <strong>Predictability:</strong> Consistent and user-friendly experiences.<br>- <strong>Safety:</strong> Cashless transactions and the ability to share trip details.</p><p>Yet, beneath this comforting surface lies a nagging doubt. Reports of driver dissatisfaction, opaque pricing algorithms, and questionable corporate practices occasionally bubble to the surface. But we often dismiss them, preferring the comfort of our routines.</p><h3><strong>The Unseen Chaos</strong></h3><p>That evening in Phoenix, as I questioned the unexpected fare, I began to sense the edges of an <strong>unknown world</strong> — a realm of hidden algorithms and manipulative practices that disrupt the order we rely on. This chaos isn’t just about technical glitches or occasional mistakes; it’s a systemic issue that threatens the fairness and trust we place in these platforms.</p><p>A few months later, I stumbled upon a <a href="https://www.youtube.com/watch?v=OEXJmNj6SPk"><em>YouTube video by Harry Campbell, “The Rideshare Guy”</em></a>, which delved into the tactics used by ride-sharing companies to exploit drivers. I revisited Yu-Kai Chou’s <a href="https://yukaichou.com/gamification-book/"><em>Actionable Gamification: Beyond Points, Badges, and Leaderboards</em></a>, and the pieces began to fall into place.</p><p>The chaos became clearer:</p><p>- <strong>Unseen Manipulation:</strong> Drivers being subtly coerced into working longer hours for less pay.<br>- <strong>Unpredictability</strong>: Surge pricing that doesn’t always reflect actual demand.<br>- <strong>Exploitation</strong>: Customers nudged into spending more through psychological tricks embedded in the apps.</p><p>This unknown world presented threats and unpredictability, but it also offered an opportunity — a chance to uncover these issues and advocate for change.</p><h3><strong>The Collision of Worlds</strong></h3><p>The realization that these platforms might be exploiting both their drivers and customers felt like a sudden collision between the known and the unknown. The comfort and convenience we had grown accustomed to were being undermined by hidden practices designed to maximize corporate profits at the expense of individuals.</p><p>This clash wasn’t just a personal inconvenience; it was a moral conflict. The principles of fairness, care, and liberty were at odds with cheating, harm, and oppression. The companies that promised freedom and innovation were, in some ways, subverting those very ideals. And while I admire the engineering marvel that these apps have implemented, there is a dire ethical concern here.</p><p><strong>Responding to the Chaos</strong></p><p>As someone deeply embedded in the tech industry, I felt a responsibility to delve deeper. Was this just an isolated incident, or was it indicative of a broader pattern? I began researching, reading articles, analyzing app mechanics, and even speaking with drivers. I also was a driver myself for a time in my life where I needed some extra cash.</p><p>What I found was both illuminating and disheartening.</p><p><strong>The Quest for Bonuses: A Double-Edged Sword</strong></p><p>Uber’s “Quest” feature offers drivers bonuses for completing a set number of rides within a specific timeframe. On the surface, it seems like a fair incentive — a way for drivers to earn more. But in reality, it’s a sophisticated tool to keep drivers on the road longer, often for diminishing returns.</p><p>Consider a driver named Alex, who is close to hitting his bonus target. Suddenly, he notices that the rides he’s being offered are shorter and less profitable. The algorithm appears to be manipulating his assignments, making it harder for him to reach the goal without putting in extra hours. Meanwhile, another driver, Ben, who isn’t close to any bonus, receives more lucrative rides to keep him engaged.</p><p>This isn’t mere speculation. Its an educated guess, as I do not have access to their source code. However, as a senior software engineer, I understand how algorithms can be designed to optimize certain outcomes — in this case, maximizing coverage and minimizing payouts.</p><p><strong>Acceptance Rates and the Illusion of Choice</strong></p><p>Drivers are pressured to maintain high acceptance rates. Declining too many rides can lead to penalties, loss of bonuses, or even deactivation. This system erodes their autonomy, forcing them into a corner where they must accept rides that may be unprofitable or unsafe.</p><p>Imagine Sarah, a driver who prefers not to drive late at night for personal safety reasons. If she declines too many requests during those hours, her acceptance rate drops, jeopardizing her standing with the platform. The choice between personal safety and livelihood shouldn’t be one anyone has to make.</p><p><strong>The Burden of Ratings</strong></p><p>Driver ratings significantly impact their ability to earn. This type of gamification can be beneficial to the service, the drivers, and the riders. Drivers are required to maintain professional attire, clean cars, and safe rides. Same for riders, as if a rider has a high rating by being nice and polite, and accepts the social contract of riding in someones car from point A to point B, makes the experience mutually positive. But there are negatives of this as well. A single negative review can have outsized consequences. This creates an environment of constant stress, where drivers feel compelled to go above and beyond without any additional compensation. Water, snacks, and chargers are some of the “bonuses” that drivers employ in their favor, but also at their expense.</p><p>They perform emotional labor — engaging in friendly conversation, offering amenities — all to maintain that high rating. For anyone who has ever worked in the service industry, emotional labor can be stressful against rude riders. Yet, the system doesn’t account for factors outside their control, like traffic or a rider’s bad day.</p><h3>Manipulating Customers: The Other Side of the Coin</h3><p>Customers aren’t spared from these manipulative tactics.</p><p><strong>Surge Pricing: Playing on Fear</strong></p><p>Back at the airport, the surge pricing I encountered wasn’t merely a reflection of supply and demand. It played on the <strong>fear of missing out</strong>. The app alerted me that prices were high and could go even higher. This creates a sense of urgency, pushing customers to make quick decisions without fully considering the cost.</p><p>The algorithms are designed to maximize profits, not necessarily to provide fair or transparent pricing.</p><p><strong>Gamified Loyalty Programs: The Cost of Rewards</strong></p><p>Companies like DoorDash use gamified loyalty programs to encourage more frequent ordering. They tap into our desire for rewards and status, offering points, badges, or exclusive deals.</p><p>But these incentives often lead us to spend more than we normally would, chasing rewards that don’t truly offset the additional expenses. It’s a subtle form of manipulation, encouraging overconsumption under the guise of personalization and value. One thing you may also notice, is that the prices are not the same.</p><h3>Real-Life Example: The Hidden Costs of DoorDash</h3><p>When I still had DoorDash installed, I decided to order a meal through the app. As I added items to my cart, I noticed that the total cost was approaching <strong>$50</strong> — and this was <em>before</em> the service charge and the “suggested tip” were applied. Surprised by the high price, I decided to investigate.</p><p>I canceled the order and drove directly to the restaurant to place the same order in person. Amazing… the exact same items cost me <strong>$40</strong> at the restaurant. This means that DoorDash had added an extra <strong>$10</strong>, resulting in a <strong>25% markup</strong> over the original price.</p><p>Curious about this discrepancy, I spoke with the restaurant owner. They were unaware of the price difference and mentioned that they didn’t control how DoorDash adjusted their menu prices. This lack of transparency affects both customers and restaurants, as the additional charges can deter customers without benefiting the establishment. So, again, the restaurant, the driver, and the user are all being squeezed while the app is making cash hand over foot.</p><p>But the hidden costs didn’t stop there. DoorDash also wanted to charge a <strong>$3.99 service fee</strong> and suggested a tip of <strong>20%</strong>. Let’s break down the total cost if I had proceeded with the DoorDash order:</p><ul><li><strong>Base Meal Cost on DoorDash</strong>: $50</li><li><strong>Service Fee</strong>: $3.99</li><li><strong>Suggested Tip (20% of $50)</strong>: $10</li></ul><p><strong>Total Cost via DoorDash</strong>: <strong>$63.99</strong></p><p>In contrast, ordering directly from the restaurant cost me:</p><ul><li><strong>Base Meal Cost at Restaurant</strong>: $40</li><li><strong>Optional Tip (20% of $40)</strong>: $8</li></ul><p><strong>Total Cost Directly</strong>: <strong>$40</strong></p><p><strong>Difference in Total Cost</strong>: $63.99 (DoorDash) — $40 (Direct) = <strong>$23.99</strong></p><p>This means ordering through DoorDash would have cost me approximately ~<strong>37% more</strong> than ordering directly from the restaurant. I haven’t done and end to end test on how much the driver makes from this, but this markup seems insane.</p><p>This experience underscores several concerns:</p><ol><li><strong>Inflated Prices</strong>: DoorDash increases menu item prices without the restaurant’s input, or a lack of properly disclosing them leading to unexpected costs for customers. I would assume that this disclosure was in some long winded EULA that obviously the hop you don’t read.</li><li><strong>Additional Fees</strong>: The service fee and suggested tip significantly increase the total cost.</li><li><strong>Lack of Transparency</strong>: Restaurants may be unaware of how their menus are priced on the platform as any one time, affecting their relationship with customers.</li></ol><p><strong>It’s important for consumers to be aware of these hidden costs.</strong> While the convenience of delivery is appealing, the financial impact can be substantial. For a meal that should have cost $48 with a tip, paying nearly $64 is a significant difference.</p><p><strong>Personalized Notifications: Nudging Behavior</strong></p><p>We’ve all received those notifications: “Your favorite restaurant is offering free delivery for the next hour!” or “Order now to get a special discount!”</p><p>These prompts are strategically timed and personalized based on <strong>our habits.</strong> They leverage data analytics to nudge us toward making purchases we weren’t planning to make, impacting our spending habits without us even realizing it.</p><h3>The Ethical Dilemma</h3><p>Confronted with these insights, I felt a growing sense of moral responsibility. <strong>The convenience these platforms offer is undeniable</strong>, but at what ethical cost? Is it acceptable to benefit from systems that exploit others, even indirectly?</p><p>This isn’t just about individual choices; it’s about systemic issues that require collective awareness and action. The moral conflict here is profound:</p><p><strong>- Care vs. Harm:</strong> Are these companies caring for their stakeholders, or are they causing harm through exploitation?<br><strong>- Fairness vs. Cheating:</strong> Is the playing field level, or are the scales tipped in favor of corporate profits?<br><strong>- Liberty vs. Oppression:</strong> Do drivers and customers have true freedom, or are they subtly controlled by opaque algorithms?</p><h3>Taking Action: Becoming the Hero</h3><p>I realized that awareness was the first step toward change. As a technologist and consumer, I could no longer remain passive. I began sharing my findings, discussing these issues with friends, colleagues, and anyone who would listen.</p><p>I reduced my use of these platforms, seeking alternatives where possible. More importantly, I started advocating for greater transparency and ethical considerations within the tech community.</p><p>This isn’t a battle that can be won overnight, but collective efforts can lead to meaningful change.</p><h3>A Call to Consciousness</h3><p>The intersection of technology and human values is delicate and crucial. We must ask ourselves whether our pursuit of convenience is worth the ethical compromises we’re inadvertently supporting.</p><p>By becoming more informed consumers and advocating for fair practices, we can push companies to prioritize ethics alongside innovation.</p><p>We can:</p><p>- <strong>Demand Transparency:</strong> Insist that companies disclose how their algorithms affect drivers and pricing.<br><strong>- Support Fair Alternatives:</strong> Choose services that treat workers equitably and operate transparently.<br><strong>- Engage in Dialogue:</strong> Encourage conversations about the ethical implications of technology in our lives.<br><strong>- Advocate for Regulation:</strong> Support policies that protect both consumers and workers from exploitative practices.</p><h3><strong>Conclusion: Reclaiming Our Agency</strong></h3><p>The comfort of our known world has been disrupted by the unsettling chaos of hidden exploitation. Yet, within this chaos lies an opportunity — a chance to reassess and realign our values with the technologies we embrace.</p><p>By recognizing the moral conflicts at play and choosing to act, we can transform this narrative. Technology should serve us all, not just the interests of a few.</p><p>But I can’t do this alone. <strong>I invite you to join the conversation.</strong> Share your thoughts, experiences, or insights on this topic. Together, we can help shape a future where innovation and ethics coexist harmoniously.</p><p>Feel free to connect with me on <a href="https://x.com/">X.com</a> (formerly Twitter) <strong>[</strong><a href="http://x.com/@awesomerob"><strong>@AwesomeRob</strong></a><strong>]</strong>.</p><p>Let’s engage in meaningful dialogue and work towards positive change in the gig economy and beyond.</p><blockquote>Through this narrative, I’ve sought to illuminate the complex dynamics at play in the gig economy’s use of dark gamification. It’s a story that affects us all, and together, we have the power to write its next chapter.</blockquote><h3>References and Resources</h3><ol><li>Chou, Y.-K. (2015). <a href="https://yukaichou.com/gamification-book/"><em>Actionable Gamification: Beyond Points, Badges, and Leaderboards</em></a>. Octalysis Media.</li><li>Campbell, H. (2020). <a href="https://www.youtube.com/watch?v=OEXJmNj6SPk"><em>The Dark Side of Uber’s Gamification</em></a></li><li>Zuboff, S. (2019). <em>The Age of Surveillance Capitalism</em>. PublicAffairs.</li><li>Rosenblat, A. (2018). <em>Uberland: How Algorithms Are Rewriting the Rules of Work</em>. University of California Press.</li><li>Eyal, N. (2014). <em>Hooked: How to Build Habit-Forming Products</em>. Portfolio.</li><li>Haidt, J. (2012). <em>The Righteous Mind: Why Good People Are Divided by Politics and Religion</em>. Pantheon Books.</li></ol><blockquote><strong>Disclaimer:</strong> I believe it’s important to be transparent in my work. While the thoughts and opinions expressed in this blog are entirely my own, I utilized the assistance of a language model to help brainstorm ideas, articulate concepts, and refine this content for coherence and clarity. I want to openly acknowledge this to maintain honesty and integrity in my writing. Technology like this aids in organizing thoughts and presenting them in a meaningful way to address modern problems effectively. I also employed brainstorming cards by PipDecks, a fantastic set of tools that helped me articulate what story I wanted to tell. Highly recommend.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c42bd954b0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop The Bleed: With Style!]]></title>
            <link>https://medium.com/code-meet-trauma/stop-the-bleed-with-style-27153d5d052e?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/27153d5d052e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ems-training]]></category>
            <category><![CDATA[style-guides]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 19:51:01 GMT</pubDate>
            <atom:updated>2023-02-12T19:53:57.939Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C_I83zainXh_hj9Z" /><figcaption>Photo by <a href="https://unsplash.com/@austinban?utm_source=medium&amp;utm_medium=referral">Austin Ban</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Table Of Contents</p><ul><li><a href="https://medium.com/code-meet-trauma">Main</a></li><li><a href="https://medium.com/code-meet-trauma/code-meet-trauma-an-emts-approach-to-legacy-maintenance-dcf6d255694c">Introduction</a></li><li><a href="https://medium.com/code-meet-trauma/code-meet-trauma-stop-the-bleed-b36887d2784f">Stop The Bleed!</a></li><li><a href="https://t.co/FjjqRinUaM">Style Guides</a></li></ul><p>Welcome back. The series so far has introduced the concept of “Stop The Bleed”, an EMS (Emergency Medical Services) mindset, and its potential applications in the field of software development. In the introduction, we explored the ideas that the fast-paced, high-pressure environment of EMS can provide valuable lessons for software developers in terms of efficiency, problem-solving, and prioritization. Some stories were outlined about recognizing that when there is an immediate threat to life, that that threat must be mitigated before any other life saving procedures can be done, can be applied to the health of a codebase.</p><p>“Stop the bleed” — a concept that refers to the importance of taking immediate action to address critical issues and prevent further harm. In software development, this means focusing on fixing critical bugs and ensuring that the codebase remains in a stable and functional state before moving on to other areas of concern.</p><p>The application of the EMS mindset in software development has the potential to improve the overall quality of code and increase efficiency in the development process. By adopting a “stop the bleed” approach, developers can focus on fixing the most pressing issues first and prevent the accumulation of minor problems that can quickly escalate into more significant, more difficult-to-fix issues.</p><p>As the first stop in our journey, we will discuss the importance of code quality.</p><p>Code Quality refers to the overall level of excellence and reliability of the code written by a software developer or a team. It encompasses a wide range of factors, including readability, maintainability, performance, security, and compliance with industry standards and best practices. That&#39;s all good on paper, but in practice, it can mean many things to many people. Software engineering is filled with intelligent people, and sometimes often, smart differentiate opinions. Sometimes these opinions can be dogmatic and robust. As we describe a “first” step in code quality, as a team of 3, 10, or even as a team of 1, there should be some formalized process on what standards a team should follow. This usually comes in the form of a style guide. These are important first steps that a team should take. They outline what rules should be followed. There should also be a process in the style guide on how to change something. Best practices are constantly evolving and with good reason.</p><p>Ten years ago, just about every patient with a hint of back pain would have a c-collar applied and placed on a long backboard to restrict spinal movement. I recall that this happened so many times a day that we would stock a truck with at least four backboards. We never knew how many patients would be at the scene of an accident, so we had to bring a few to handle the suspected spinal injuries. It was in the best interest of the patient, right? I recall going to a fender bender of a job. A school was struck, with minor damage, to the rear fender well. This school bus had thirty pediatric patients on it. Following the protocol, these patients should have been back-boarded and collared because these kids all said they had back pain. A seasoned EMT would know that the kids were just scared, and when you ask a scared kid if something hurts, then say yes. But, the protocol stated that they needed to be back boarded and collared, which was equally terrifying to a child. So, because of the dogmatic protocol, multiple agencies were called out, and most of these kids were placed under spinal restriction. This was not the correct decision, but it was the protocol.</p><p>Years later, it was discovered that for the majority of cases, patients rarely needed this level of spinal restriction, and it contributed to backboard injuries. How could this happen? The need to be “cleared” by a doctor before the board was removed meant patients would often be strapped down for hours in the Emergency department before anyone could see them. This thought process is changing as hospitals and doctors use data to determine that most people do not need this restriction.</p><p>Thankfully, these kids did not have to suffer through that and were removed from the boards quickly.</p><p>Today, the use of backboards is a lost art. I can’t remember the last time someone met the criteria for spinal immobilization. Newer EMTs, with less than five years on the job, can count how many patients meet the new guidelines. Guidelines are in place to help make decisions when there is ambiguity. I have seen many debates over even the simplest of changes throughout my career.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*QhsuaOAQmbeINghulco8kg@2x.png" /><figcaption>Imagine having to debate this in a PR.</figcaption></figure><p>Code quality is important for a number of reasons:</p><ol><li>Improved reliability: High-quality code is more reliable, less prone to bugs and crashes, and generally more robust. This leads to a better user experience and fewer support requests. Also improved Developer Experience, which I will dive into in a later blog post.</li><li>Increased efficiency: Code that is well-written, organized, and easy to understand can be maintained and updated more efficiently, saving time and resources in the long run.</li><li>Better collaboration: When code is of high quality, it is easier for multiple developers to work on the same codebase, reducing the risk of conflicts and facilitating collaboration.</li><li>Faster development: High-quality code is often faster and more efficient, allowing developers to implement new features and make changes to the codebase quickly.</li><li>Improved security: Code that follows best practices and is written with security in mind is less vulnerable to attack and data breaches, protecting both the users of the software and the reputation of the development team.</li></ol><p>The “Stop the Bleed” mindset can be applied to code quality, and this is undoubtedly an important concept to bear in mind. When you enter a new codebase, and it feels like the “Wild Wild West” when you are reading and writing code, there’s likely some “bleeding.” As engineers, we are always learning something new, and it is our responsibility to ensure that the codebase is of the highest quality. Improving the codebase’s health by enforcing quality standards is not easy, but ensuring that the code is up to the best standards is necessary.</p><p>The obvious step is to address the quality of the code itself. However, it is also important to take a step back and look at the bigger picture. The “bleeding” in this scenario is not the code; it is the developers. If you are the only one subscribed to the idea that the code should be written in a specific way, without a style guide, then you are setting yourself up for failure. It is important to ensure that all the developers in the team understand the importance of code quality and that they are all on the same page when it comes to standards and expectations. This will help to ensure that the codebase is as healthy as possible and that everyone is contributing in a positive way. The first steps here are to build a style guide with a team. You don’t have to start from scratch, there are many templated and opinionated style guides to choose from. From this initial meeting, set up a way to contribute to this style guide. I cannot stress enough the importance of getting the style guide agreed upon, and then have everyone follow the standards. When a team sets up a process, and then does not follow that process, what can happed is much worse.</p><p>Conversations about the use of semi-colons, variable names, and the number of lines in a method are often seen in pull request reviews, which can significantly slow the PR cycle time. Without a style guide to refer to, the same style violations are often repeated, leading to a lack of team cohesion and time wasted, and frustrating for all involved. Pull requests should not be used as a forum to debate the merits of one style over another; instead, if there is no style guide in place, these conversations should take place in a more appropriate setting and should result in a shared style guide that all team members are aware of and adhere to. This will create a sense of consistency while allowing for flexibility and individual preferences. Individual preferences are also necessary. This is why this is called a style guide, not style laws. Guides are meant to assist the developer in following practices that the team put in place, but this is software, and there are cases in which the guide can be deferred from, with good reason. A software developer should always be able to defend their position on why they made a a decision to not follow the style guide.</p><p>*Side tip: During an interview at a new company, ask to see their style guides and inquire about their quality standards. This is a great way to gain insight into how a team or company creates and enforces standards.</p><p>Once you have a style guide in place, the next step is to shift the nagging to a bot. This is a great way to automate the process of enforcing the rules that we have all agreed on. In the ruby world, we have several tools to help us enforce the rules we are all trying to follow. Rubocop, a ruby gem that runs static analysis, is a great tool to use, as it is able to detect any violations of the style guide, and alert the team to any syntax errors or other issues. Additionally, Rubocop can be used as a great teaching tool, allowing developers to learn best practices, and ensuring that everyone is writing code that adheres to the same standards. By using Rubocop, we can not only streamline the process of enforcing the rules, but also ensure that everyone is writing code that is consistent, readable and of high quality. Brakeman is a powerful security tool that offers an effective approach to improving codebase security. It can detect vulnerabilities in applications written in Ruby on Rails, and provide actionable insights to help identify and fix security flaws. Brakeman can also track changes over time to ensure the codebase remains secure and that any new changes don’t introduce security issues. It also provides detailed reports for developers to review and address any security concerns. Brakeman is an excellent asset for any Ruby on Rails developer looking to ensure their codebase is secure. These are but 2 examples directly related to the ruby world, but not limited to it. Every programming language has built-in tools to assist engineers in solving problems without manually going through the painstaking process. These processes have already been solved and can be automated, ultimately saving time and resources. It is important to note here that Code Climate’s “Quality” product is one such tool that I have been using for years, even prior to starting my job at the company. It enables you to perform all these checks as part of a pull request, thus reducing the need for debugging and striving for a higher code quality. Moreover, you can even get an automated overview of the entire codebase, enabling you to understand the structure and any potential issues that may arise from it.</p><p>By utilizing Code Climate’s “Quality” product, engineers can save time and resources by automating the process of debugging and striving for higher code quality. Additionally, the product provides an automated overview of the entire codebase in order to gain further insight into the structure and any potential issues. This can be especially useful when working with a large and unfamiliar codebase. Furthermore, the product is easy to integrate into existing workflows, making it a great choice for any development team. Static analysis is one of those tools I wish I could reverse engineer to an EMS Chart, highlighting areas where an EMT should have performed one action over another. Sadly, this is still a manual process, however, I would like to experiment with some AI tools in the future to improve this process.</p><p>The “Stop the Bleed” mindset, derived from the world of Emergency Medical Services, is a valuable concept for software developers. In this post, we highlight the need for team buy-in and then discuss how to set up and follow style guides. By focusing on fixing critical issues and maintaining the stability and functionality of the codebase, developers can improve the overall quality of their code and increase efficiency in the development process. Code quality is important for a number of reasons, including improved reliability, increased efficiency, better collaboration, faster development, and improved security.</p><p>A key aspect is the use of a style guide, which outlines the standards and expectations for the team and helps ensure consistency and readability in the codebase. Additionally, automating the process of enforcing these standards through tools such as Rubocop, Brakeman, and Code Climate’s “Quality” product can save time and resources while improving code quality.</p><p>Hey everyone! In our next series, we’ll be diving into the topic of “Developer Experience”, and how the “Stop the Bleed” mindset can help make it even better. Don’t miss out on the latest stories and info on software development and the EMS mindset!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27153d5d052e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-meet-trauma/stop-the-bleed-with-style-27153d5d052e">Stop The Bleed: With Style!</a> was originally published in <a href="https://medium.com/code-meet-trauma">Code, Meet Trauma</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code, Meet Trauma: Stop The Bleed!]]></title>
            <link>https://medium.com/code-meet-trauma/code-meet-trauma-stop-the-bleed-b36887d2784f?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b36887d2784f</guid>
            <category><![CDATA[ems-training]]></category>
            <category><![CDATA[code-quality-standards]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[code-quality]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Sat, 04 Feb 2023 14:03:04 GMT</pubDate>
            <atom:updated>2023-02-04T14:37:13.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mTD6cOsALJCSO93D" /><figcaption>Photo by <a href="https://unsplash.com/es/@lalunecreative?utm_source=medium&amp;utm_medium=referral">Matt Hudson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Table Of Contents</p><ul><li><a href="https://medium.com/code-meet-trauma">Main</a></li><li><a href="https://medium.com/code-meet-trauma/code-meet-trauma-an-emts-approach-to-legacy-maintenance-dcf6d255694c">Introduction</a></li><li><a href="https://medium.com/code-meet-trauma/code-meet-trauma-stop-the-bleed-b36887d2784f">Stop The Bleed!</a></li></ul><h3>It was a T<strong>hursday…</strong></h3><p>Actually, I don’t remember what day of the week it was, but it was at night. I was sitting in the squad room of the EMS station, where my partner and I, along with other EMTs, had just finished dinner. We were waiting for our next call, as the night was quiet. The squad room, as we affectionately call it, is where we come to check our trucks and equipment and try to grab a meal before the next call.</p><p>As EMTs, we work in a high-stress, fast-paced environment where the number of calls we receive can vary greatly. On some nights, we are slammed with emergency calls, while on others, it’s eerily quiet. This night was one of the quiet ones, and my partner, with his long blond surfer hair, a job shirt that was slightly too small for him, and a tendency to always draw the most exciting calls, was settling in for a nap.</p><p>In EMS, we use the terms “hot job” and “cold job” to distinguish between emergency calls. A hot job is a high-stakes or intense emergency call, such as a life-threatening situation. On the other hand, a cold job refers to a minor emergency call, such as a case of minor injuries or discomfort.</p><p>Just as we were getting comfortable, the tones from our radios and pagers, which function as an alarm system for dispatchers to alert EMTs of an incoming call, started blaring. The dispatcher reported a multiple-car crash with multiple injuries and people entrapped. This was the type of call, a <strong>hot job, </strong>that would test our training and experience, and we were eager to respond.</p><p>As Rescue technicians, a specialized team of EMTs trained to handle more complex and dangerous emergencies, such as vehicle accidents, rope rescue, or building collapse, we were ready for this challenge. The excitement was palpable as we sprang into action, responding to the scene of the accident and ready to provide the best medical care we could.</p><p>As we arrived, the scene looks something out of a movie. Three cars were involved, with intrusion into the patient compartments. For a total of 3 patients. One team was working on one of the vehicles, and my partner and I got another. My patient was an elderly man who was alert and talking to me. I asked him if anything hurt, and he started motioning at his leg. I could see that it was crushed by the steering wheel and impeded us from his rapid removal. As we tried to pry open the door, it was compressed between the two posts, and we would need to use hydraulic tools to free him. My partner and I suited up and started pulling tools off the truck. The “set” we take off is called peanut butter and jelly. 2 tools. A cutter and a spreader. Some will often refer to the spreader as the “Jaws of Life,” and I never liked that name. It&#39;s also a brand name for a tool company; if for anyone who knows the rivalry between Dewalt and x-brand tools, the same could be said for Holamatro. I love these tools, and our spreader, which can spread 10k pounds at the tips and opens to a whopping 32 inches, we call this tool the “honey badger” — because it doesn&#39;t care.</p><p>After taking an assessment, we knew we had to take the door off, and we may also have to perform a procedure called a dash roll. This is where you make some relief cuts near the A-post and behind the front strut to move the post away from the patient. Pretty standard stuff on an accident like this. These decisions were also made relatively quickly, which is important to remember later. With almost all non-verbal communication between my partner and I, we placed some protection around the octogenarian and went to work, first removing the door and then performing the dash roll. In the middle of these two moves, we now had a chance to assess the patient thoroughly. Day one EMT school is being able to perform Rapid Trauma Assessment. A drill we practice constantly to go head to toe with a victim and be able to assess life-threatening injuries. What a great catch this was. As I made my way down each of the patient&#39;s legs ( remember his legs are pinned by the steering wheel), the patient had also taken some shrapnel and was bleeding, however, was restricted by the pressure. If we didn&#39;t act fast, my patient could bleed out, or in fancy medical terms, hypovolemic shock. I reached into my partner&#39;s cargo pocket and pulled out his tourniquet. I fished it around the patient&#39;s legs and pulled very tight. Wound the TQ stick until I no longer noticed the blood rushing out of his thigh. If we had continued and rolled the dash, we would have taken all of the pressure off his leg, which could have led to him bleeding to death before we had time to react. A bleed like that can be fatal in three to four minutes. Without rapid intervention, he would have died.</p><p>But he didn&#39;t. Let me say it again. <strong>Stop the bleed</strong>. It saves lives.</p><p>A few years ago, I remember getting called to a car accident. This one was mid-day, and there was a reported CPR in progress. As my team and I rapidly made our way to the scene, we saw a bystander performing CPR on the sidewalk upon arrival. The patient had been the passenger and went unresponsive shortly after the collision. As we walked up, we noticed that there was a small pool of blood around the patient&#39;s arm, and upon further inspection, we found that there was also a larger pool of blood in the stepwell of the car. This seemed odd because the accident was not that severe, maybe one or two steps above a fender bender. The bystander was still doing what I would argue as great compressions under the circumstances. I started questioning where the blood was coming from because it didn&#39;t make sense. I started cutting away the sleeves of the patient. He was wearing an oversized down jacket, and this is one of the top 10 rules of EMS. “Never cut a goose down jacket.” Some rules are made to be broken as I cut away their sleeve, I found that the patient had a shunt in their arm that had been bleeding slowly. From this information, I could speculate that this had started before the accident. The human body has ~1.2–1.5 gallons of blood ( 5 liters ). Here&#39;s a little trick to estimate blood loss in the field in case you ever find yourself in need.</p><ol><li>“There was some bleeding” — It looks more dramatic than serious, likely &lt; 500ml</li><li>“There was a lot of blood” — It was dramatic and concerning, likely 500ml to 1L.</li><li>“There was a s**t ton of bleeding” &gt; 1L ( not good at all )</li><li>“Oh, F**k” — The worst type of descriptor when talking about blood loss.</li></ol><p>The patient was at a critical “Oh, F**k” level and in dire need of medical attention. I applied a tourniquet to the patient’s arm above the shunt to stop the bleeding. The reality of the situation was sobering, and the need for rapid transport and blood transfusion was evident.</p><p>The patient was loaded onto another ambulance and quickly transported to the hospital. Despite all heroic efforts, the patient did not survive. The after-action report revealed that the dispatch was correct, and the ambulance crews were on the scene within 5 minutes of being notified. Additionally, CPR was applied in the field, a rare occurrence that increased the chances of survival by over 20%. The entire process, from the time of the 911 call to the transfer of care to the hospital, was completed in less than 20 minutes, which is an exceptional timeline for this type of emergency call.</p><p>However, despite all the correct actions, the patient did not survive. The cause of death remains unclear ( I am not a medical examiner ), and the patient may have already lost too much blood before the arrival of EMS. Another possibility is that the excellent CPR continued to pump blood out of the patient, and the <strong>bleeding was not stopped</strong> quickly enough, leading to fatal consequences. This is purely speculative and based on limited information, but it highlights the importance of timely and effective medical interventions in emergencies. It highlights that even if you do everything correctly, your efforts are futile unless you stop the bleeding.</p><blockquote>What the heck does this have to do with software?</blockquote><p>As a senior software developer, I often apply my experiences as an Emergency Medical Technician (EMT) to software engineering. The idea of “stop the bleed” in software engineering is similar to its medical counterpart. In both cases, it’s about first identifying and fixing the most pressing issue. In software engineering, this means finding and fixing the problem degrading your system&#39;s health before it becomes a more significant issue. The mindset is always looking for the “why” because all the efforts made around it might lead to a negative outcome.</p><p>This adventure was to warm you up to the ideas and mindset of why stopping bleeding is so essential. It also wraps up our introduction to who I am and what this series will be about. In the following article, we will be talking about code quality. When it comes to code quality, having clean code is crucial for maintaining a healthy code base. However, maintaining code quality can easily be undone if others don’t follow the same guidelines. This can lead to a “bleed” in the code base, causing the efforts to maintain clean code to be impacted. Next time, we will dive into some stories about code quality, some more EMS stories, and some action items you can take to improve your code base&#39;s health. My goal here is to build a proactive mindset and a focus on code quality and best practices.</p><p><em>Disclaimer: The emergency calls described in this blog post have been slightly altered to protect the privacy of patients and emergency medical services (EMS) crews. The facts presented in this post may be based on actual calls or may have been combined for educational purposes.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b36887d2784f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-meet-trauma/code-meet-trauma-stop-the-bleed-b36887d2784f">Code, Meet Trauma: Stop The Bleed!</a> was originally published in <a href="https://medium.com/code-meet-trauma">Code, Meet Trauma</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code, Meet Trauma: An EMT’s Approach to Legacy Maintenance]]></title>
            <link>https://medium.com/code-meet-trauma/code-meet-trauma-an-emts-approach-to-legacy-maintenance-dcf6d255694c?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcf6d255694c</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Sun, 29 Jan 2023 16:40:58 GMT</pubDate>
            <atom:updated>2023-02-04T14:36:41.967Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aVm6Upk1hUzfhLVe" /><figcaption>Photo by <a href="https://unsplash.com/@vorosbenisop?utm_source=medium&amp;utm_medium=referral">Benjamin Voros</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ul><li><a href="https://medium.com/code-meet-trauma">Main</a></li><li><a href="https://medium.com/code-meet-trauma/code-meet-trauma-an-emts-approach-to-legacy-maintenance-dcf6d255694c">Introduction</a></li><li><a href="https://medium.com/code-meet-trauma/code-meet-trauma-stop-the-bleed-b36887d2784f">Stop The Bleed!</a></li></ul><p>Hi, I’m RJ Robinson, a now 40-year-old with a long-standing interest in computers and a natural talent for quickly picking up new technologies. Despite being intimidated by advanced math during my youth, I later discovered that I was much more intelligent than I initially thought. My experiences growing up in the 90s had left me feeling discouraged about fixing computers, but I found that I was much more capable than I gave myself credit for.</p><p>As an EMT, I applied myself fully to my work and quickly rose through the ranks to become a supervisor, rescue technician, and firefighter. People relied on me to be an important person on the scene of an emergency, and I took pride in knowing that I had the skills to handle whatever challenges came my way. However, despite my success in emergency services, I found myself living paycheck to paycheck and struggling to make ends meet in expensive New Jersey.</p><p>It wasn’t until I found myself bedridden for eight weeks after having my tonsils removed that I stumbled upon coding. What started as a fun hobby quickly became a passion, and I decided to attend a coding boot camp and pursue a new career. Despite the risks and skepticism from friends and family, I dove headfirst into this exciting new chapter in my life, driven by my experiences as an EMT and my ability to handle stress. Today, I’m proud to say that I’m on a new path that has transformed my quality of life and mental health and allowed me to live the life I have always dreamed of.</p><p>I am both an active EMT and a Senior Software Engineer. I serve as a volunteer EMS Chief for the second time, leading a team of 100 members and responding to over 4000 calls annually. In 2022, I dedicated over 1700 hours of volunteer service. Being an EMT is a significant part of my life. In my full-time role as a Senior Software Engineer at Code Climate, I am proud to be a part of an incredible team, building tools to improve developers’ experiences. Being in tech allows me to pursue my passions and work on things I love.</p><p>In 2022, I embarked on a journey to become a better writer and share my experiences and perspectives on technology and coding. I started writing blog posts about my field adventures and thoughts on various topics. I’ve always wanted to be a stronger writer. Writing has always been a way for me to solidify my understanding of a subject. By blogging about it, I aim to improve my writing skills and communicate my ideas more effectively.</p><p>In addition to improving my writing, I also wanted to bring a unique viewpoint to the table, drawing from my experiences as an EMT. I am sharing my experiences and insights on programming and engineering as seen through the eyes of someone who has been on the front lines of emergencies. This would offer a different perspective and provide value to others in the tech industry.</p><p>In this series of blog posts, I aim to draw parallels between the “Stop The Bleed” philosophy in emergency medical services and software engineering. “Stop The Bleed” is a course that EMS providers take when dealing with traumatic injuries, and it focuses on quick and effective responses to control bleeding. I will explore how this mindset and approach can be applied to various aspects of software engineering, such as code maintenance, problem-solving, and decision-making. By doing so, I hope to offer a unique perspective on software engineering and share valuable insights and lessons learned from my experience as an EMT.</p><p>Join me on this exciting journey as I share my perspectives on software engineering and delve into topics such as maintaining legacy code and drawing insights from my experiences as an EMT. I’ll also share some of my emergency call stories (PG-13), which may include some sensitive and graphic descriptions. Over the next few weeks, I will explore the connection between these two seemingly disparate aspects of my life and show how they intersect to inform my approach to software development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcf6d255694c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-meet-trauma/code-meet-trauma-an-emts-approach-to-legacy-maintenance-dcf6d255694c">Code, Meet Trauma: An EMT’s Approach to Legacy Maintenance</a> was originally published in <a href="https://medium.com/code-meet-trauma">Code, Meet Trauma</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Explicit Time Testing is Essential for Reliable Software: RSpec Best Practices]]></title>
            <link>https://medium.com/@RJrobinson/explicit-time-testing-is-essential-for-reliable-software-rspec-best-practices-e7081eccb21b?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7081eccb21b</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 19:07:33 GMT</pubDate>
            <atom:updated>2023-01-21T19:17:27.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pG9T-DqvVqAHMCyN" /><figcaption>Photo by <a href="https://unsplash.com/@loic?utm_source=medium&amp;utm_medium=referral">Djim Loic</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Testing is an essential part of any software development process, and RSpec is one of Ruby&#39;s most popular testing frameworks. If you’re working on a project with a lot of legacy code, like I have been, refactoring the code and improving the test suite can make the process more enjoyable for everyone.</p><p>I’ve learned over the years that using Time.now your test files can be a recipe for disaster. It&#39;s a code smell that stands out because I used to do it too. But after reading some great books from Uncle Bob, Kent Beck, and the Martin Series, I learned that testing should be explicit and deterministic.</p><p>Testing is not “the real world,” and while there are arguments to be made for using implicit specs, these are in the minority. So, I would like to highlight why using `Time.now` should be avoided, how you can ease into using explicit times, and plan your specs around explicit times.</p><pre>RSpec.describe Book, type: :model do<br><br>  let(:now) { Time.new(2023,01,01,0,0,0) } # Strict -- never changes. <br>  let(:actually_now) { Time.now } # NDT - Changes every test run. <br><br>end</pre><p>Deterministic tests (DTs) are a crucial principle in testing. These tests guarantee that the same output will be produced every time the test is run with the same input, ensuring that the tested system or algorithm is functioning correctly and consistently.</p><p>Using Time.now in tests can lead to non-deterministic tests (NDTs). These tests may produce different outputs, even with the same input each time. This can happen due to the nature of Time.now, which changes every time the test is run, leading to inconsistent inputs.<br>Working with time objects can be tricky, and incorporating time zones into the mix can make it even more complex. Anyone who has ever dealt with a flaky test knows that it can be a can of worms.</p><p>To avoid these issues, it’s recommended to set and test against time objects that you control explicitly. This will lead to better DTs and ensure that the tests are more reliable and easier to maintain.</p><p>At some point, a test that relies heavily on Time.now will likely fail at some point. This can lead to false test failures or test that pass on one machine but fail on another. The test suite becomes unreliable, and in almost every case where I had a flaky test that revolved around a time mismatch, it was because an NDT used `Time.now` vs. explicitly setting the time. By using exact times, our test becomes more reliable, consistently producing the same results and allowing us the control to change it to test some other aspect.</p><p>Ensure that your tests are deterministic. I will say that a few times because it’s worth repeating. Also, remember to keep your tests focused and straightforward. This means that each test should only test one specific aspect of the code and not include any unnecessary elements.</p><p>Another best practice when testing times is to avoid making unnecessary time adjustments. This means that you should only adjust the time in your tests if it is vital for the test to pass. For example, if you are testing a background job that runs at a specific time, it may be necessary to adjust the Time to ensure that the job runs at the expected time. However, if you are testing a feature that is not time-sensitive, it is best to avoid adjusting the time in your tests.</p><p>RSpec provides several valuable tools to help you test times, including shared contexts and shared examples. Shared contexts allow you to share code between multiple tests, which can be particularly useful when testing times. For example, if you have many tests that need to use the same time value, you can define a shared context that sets the Time and then includes that context in all of your tests. Shared examples are similar to shared contexts but are intended to be used for multiple examples within the same example group.</p><p>One of the most useful RSpec time helpers is travel, which allows you to temporarily change the current time in your tests. You can use travel to fast forward, rewind Time, or set Time to a specific point in the past or future. Here’s an example of how you might use travel to test a method that calculates the number of days until a specific date:</p><pre>describe &quot;#days_until_event&quot; do<br>  it &quot;returns the number of days until the event&quot; do<br>    event_date = Time.new(2022, 12, 25)<br>    travel_to(Time.new(2022, 12, 20))<br>    expect(days_until_event(event_date)).to eq(5)<br>  end<br>end</pre><p>Another practical RSpec time helper is freeze_time, which allows you to freeze time at a specific point. This is useful when testing code that relies on the current time, but you want to ensure that the time remains constant throughout the test. Here&#39;s an example of how you might use freeze_time to test a method that calculates the number of seconds since the start of the year:</p><pre>describe &quot;#seconds_since_year_start&quot; do<br>  it &quot;returns the number of seconds since the start of the year&quot; do<br>    freeze_time(Time.new(2022, 5, 15))<br>    expect(seconds_since_year_start).to eq(131_907_200)<br>  end<br>end</pre><p>Finally, the helper travel_back is the inverse of travel, it allows you to change the time in your tests to a point in the past. Here&#39;s an example of how you might use travel_back to test a method that calculates the number of days since a specific date:</p><pre>describe &quot;#days_since_event&quot; do<br>  it &quot;returns the number of days since the event&quot; do<br>    event_date = Time.new(2022, 12, 25)<br>    travel_back(10)<br>    expect(days_since_event(event_date)).to eq(10)<br>  end<br>end</pre><p>In conclusion, RSpec’s built-in time helpers, travel, travel_to, travel_back and freeze_time make it easy to test time-sensitive code and ensure that your tests are consistent and reliable. These helpers are very simple to use, and you can use them in any RSpec test to control the current time and make your tests more robust. Avoid using Time.now — remember to make your tests DTs and not NDTs. Explicitly test what you need too — and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7081eccb21b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Record 101: A Beginner’s Guide to Structure, Form, and Nullify]]></title>
            <link>https://medium.com/@RJrobinson/active-record-101-a-beginners-guide-to-structure-form-and-nullify-6b6a3bd1f600?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b6a3bd1f600</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 21:04:46 GMT</pubDate>
            <atom:updated>2023-01-20T16:19:13.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AHyw1h3EVHOLDles" /><figcaption>Photo by <a href="https://unsplash.com/@chrisyangchrisfilm?utm_source=medium&amp;utm_medium=referral">Chris Yang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><pre># Callbacks<br># Associations<br># Validations<br># Scopes<br># Class methods<br># Instance methods</pre><p>Active Record is like a magical unicorn that makes database management a breeze in Ruby on Rails. But like all unicorns, it can be a bit of a headbanger if you don’t understand how it works. That’s why I’m here to take you on a journey of why being mindful of how Ruby evaluates things is important.</p><pre>class Book &lt; ApplicationRecord<br>  # Callbacks<br>  before_destroy :do_this  <br>   <br>  # Associations<br>  has_many :authors, dependent: :nullfiy<br>  <br>  # Validations<br>  validates :page_numbers<br>  <br>  # Scopes<br>  scope :reviewed, -&gt; { where(reviewed: true) }<br>   <br>  def do_this<br>    &quot;like, comment, subscribe&quot; <br>  end <br>  <br>  # class methods<br>  def self.new_with_review<br>    # do magic things<br>  end<br>  <br>  # instance methods<br>  def read<br>    # do magic things<br>  end<br>end<br></pre><p>I was working with a friend, and he presented an issue he had where he wanted authors to be nullified upon destroying the book. ( class and method names have been changed to protect the innocent ).</p><p>In the example, the #before_destroy callback is placed below the scopes, which can be like trying to fight crime in a tutu — it might work, but it’s not the best idea. In the testing, every time he called #destroy on the record, it did what it needed to; it nullified the association, but the behavior he was looking for was that he wanted the associated records to be “#touched” before the nullification/destroy. When we tried to debug and got inside the “#do_this” call back that we had defined, we could not pull the records we were expecting because, at this point, the nullification had already happened. Nullification happened before our customer #do_this was called.</p><p>As we went through his code, we could not figure out what was happening.</p><p>Callbacks! They’re like the superhero sidekicks of Active Record, always there to save the day when you need them. For example, the #before_destroy callback is like Batman’s butler, Alfred. It always ensures everything is in order before the record is destroyed. In the example code, the #before_destroy callback calls the #do_this method, which performs some action. But like Batman’s bat signal, the order of callbacks is critical.</p><p>Looking at the amazing documentation, we found that there is no #before_nullify call back. Or is there? I’ll admit — I had to recruit my own rubber duck for this one so special thanks to JM :)</p><pre>class Book &lt; ApplicationRecord<br>   # Associations<br>  has_many :authors, dependent: :nullfiy<br>  <br>  # Validations<br>  validates :page_numbers<br>  <br>  # Scopes<br>  scope :reviewed, -&gt; { where(reviewed: true) }<br>  <br>  # Original Location! &lt;&lt;&lt;&lt;&gt;&gt;&gt;&gt;&gt;&gt;<br>  # Callbacks<br>  before_destroy :do_this<br>  <br>  def do_this<br>    &quot;like, comment, subscribe&quot; <br>  end <br>  <br>  # class methods<br>  def self.new_with_review<br>    # do magic things<br>  end<br>  <br>  # instance methods<br>  def read<br>    # do magic things<br>  end<br>end</pre><p>Looking at this `has_many :authors, dependent: :nullfiy` we see that the `dependent: :nullify` is present, and thus called before our custom #before_destroy callback kicks off. This is where, sometimes, the order in which callbacks are declared in your model matter.</p><p>The solution? Move the #before_destory callback to the top of the file. This way, it processes it sequentially, 1st the #do_this, and second the `dependent: :nullify` is called nulling out the IDs as expected.</p><p>This isn&#39;t to say that the above structure should be followed like dogma, but rather to be aware that sometimes…. order of methods matters.</p><p>Next up, we have associations. They’re like the family and friends of Active Record. They help you create relationships between records. For example, the has_many association is like having a big family. It creates a one-to-many relationship between two models. In the example code, the has_many :authors, dependent: :nullify association is like having a big family, but one of the kids keeps breaking things so you have to send them to their room (nullify). But like family dynamics, the order of methods can affect the behavior of the association.</p><p>Validations are like the bouncers at a club. They make sure that only the cool records get in. For example, in the example code, the `validates :page_numbers` validation is like the bouncer checking ID’s at the door. It ensures that the page_numbers attribute of a Book record is valid before it can be saved.</p><p>Scopes are like the filters on Instagram. They make sure that only the good stuff is shown. For example, the `scope :reviewed, -&gt; { where(reviewed: true) }` scope is like the “show me only the cute dogs” filter. It ensures that only Book records with a reviewed attribute set to true are returned.</p><p>Active Record also provides support for class methods and instance methods. Class methods are like the cool kids at school. They’re defined on the class level and can be called on the class itself—for example, the def self.new_with_review class method is like the cool kid who always knows the latest fashion trends. It creates a new Book record with a reviewed attribute set to true. Instance methods, on the other hand, are like the nerdy kids at school. They’re defined on the instance level and can be called on an instance of a class. For example, the def read instance method is like the nerdy kid who always has their nose in a book. It performs some action on a specific Book record.</p><p>In conclusion, Active Record is like a magical unicorn that makes database management a breeze in Ruby on Rails, but like all unicorns, it can be a bit of a headbanger if you don’t understand how it works. Understanding the order of methods and how they interact with each other is crucial to achieving the desired behavior. So, remember that the order of methods matters and have fun with your code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b6a3bd1f600" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using De Morgans Laws in your code]]></title>
            <link>https://medium.com/@RJrobinson/using-de-morgans-laws-in-your-code-876ac8524d0a?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/876ac8524d0a</guid>
            <category><![CDATA[augustus-de-morgan]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[boolean]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 20:59:51 GMT</pubDate>
            <atom:updated>2023-01-02T20:59:51.200Z</atom:updated>
            <content:encoded><![CDATA[<p>As I progress through the end of my BSCS coursework, I am in the middle of ( whispers ) discrete mathematics. <br>A lot of this so far, s learning how to read and write logical expressions without the use of ! , &amp;&amp; , or ||</p><p>In the context of this post, I will explain how they should look but will provide the rub equivalent as well.</p><p>I came across De Morgans Laws and found them to be interesting. In short, these laws describe how to distribute a negation symbol.</p><p>¬( p ^ q)</p><p>The ^ means “and,” so in Rubyist terms &amp;&amp; , also known as a conjunction</p><p>In the context here v mean “or,” or || respectively, also known as a disjunction</p><p>The above would read, in English, “not p and q.”</p><pre># in ruby<br>p = true<br>q = true<br><br>!(p &amp;&amp; q) # ¬( p ^ q)</pre><p>De Morgan’s laws are a set of logical equivalences that allow us to manipulate boolean expressions involving negations, conjunctions, and disjunctions. Named after the mathematician Augustus De Morgan, these laws provide a set of rules for distributing negations inside parenthesized expressions.</p><p>The first De Morgan’s law states that the <strong>negation of a disjunction</strong> is equivalent to the conjunction of the negations of the individual terms. In other words, if we have an expression of the form !(p || q), we can rewrite it as (!p &amp;&amp; !q). This is useful because it allows us to negate complex expressions by breaking them down into simpler parts and negating each part individually.</p><p>The second De Morgan’s law is the <strong>converse</strong> of the first law and states that the negation of a conjunction is equivalent to the disjunction of the negations of the individual terms. In other words, if we have an expression of the form !(p &amp;&amp; q), we can rewrite it as (!p || !q). Like the first law, this allows us to negate complex expressions by breaking them down into simpler parts and negating each part individually.</p><p>In the Ruby programming language, we can use these laws to manipulate boolean expressions in our code.</p><p>For example, consider the following code:</p><pre># De Morgan&#39;s First Law<br><br>p = &quot;the person is at least 18 years old&quot; <br>q = &quot;they will be admitted to the party&quot; <br><br>p &amp;&amp; q # The person is 18 and admitted into the party<br>!(p &amp;&amp; q) # the person is either not 18, or not allowed in the party. <br><br># now we can flip this using de morgans 1st law<br><br>(!p || !q) # the person is either not 18, or not allowed in the party.<br><br>#so... you can see that these are logically the same thing. <br>!(p &amp;&amp; q) === (!p || !q) <br></pre><p>Let&#39;s look at it the other way.</p><pre>p = &quot;The person has a job&quot;<br>q = &quot;The person has a trust fund&quot; <br><br>(p || q) # reads &quot;The person has a job or a trust fund<br><br>!(p || q) # reads &quot;The person does not have a trust fund, or does not have a job<br><br># lets flip this. <br><br>(!p &amp;&amp; !q) # The person does not have a job, and does not have a trust fund. <br><br>#logically speaking<br>(!p &amp;&amp; !q) === !(p || q) # these are the same. <br></pre><p>This is equivalent to the original expression and will behave similarly when executed. Understanding De Morgan’s laws allow us to write more concise and easily readable code that involves complex boolean expressions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=876ac8524d0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing GraphQL-Ruby Mutations With RSpec]]></title>
            <link>https://medium.com/@RJrobinson/testing-graphql-ruby-mutations-with-rspec-f5c7d02b1e58?source=rss-3a1e7768af4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5c7d02b1e58</guid>
            <category><![CDATA[rails-5]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[RJ Robinson]]></dc:creator>
            <pubDate>Fri, 05 Apr 2019 14:47:02 GMT</pubDate>
            <atom:updated>2019-04-05T15:00:48.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ps4t3r44UHYRmZXB" /><figcaption>Photo by <a href="https://unsplash.com/@seemurray?utm_source=medium&amp;utm_medium=referral">Chris Murray</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To start with, a little OpEd on how much I love working with GraphQL. I started tinkering with it about a year ago, and have since completed a project at work where we did a rewrite, an the results have been amazing. Pros and cons aside however, I needed a way to test.</p><p>This might not be the best solution for you, but this is what had worked on my team, and for our use case. <br>The tests needed to cover a few aspects. Did the user have access? We use our own Pundit hack. Were the proper arguments sent? And did the response come back as expected? This sounds like a basic controller test, so from there I treated it as such.</p><p>Usually, in an RSpec controller test, we have a #get or a #post method that allows us to interact with that endpoint, and I wanted to continue with that pattern. These usually return a #response object with everything we would want to test.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ada753dbb0a27216fcbf2634b03ceca/href">https://medium.com/media/7ada753dbb0a27216fcbf2634b03ceca/href</a></iframe><p>Once I defined the #query and #mutation methods, passing in the arguments were easy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d733f9edffad5b9e6721063f348fec68/href">https://medium.com/media/d733f9edffad5b9e6721063f348fec68/href</a></iframe><p>Say we have a simple book application, and we want to create a new book. <br>Below are the tests, and while this seems very basic, I hope it&#39;s clear enough to understand the ideas behind it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b069208750c9d9d96dbe5ca48e37e5b9/href">https://medium.com/media/b069208750c9d9d96dbe5ca48e37e5b9/href</a></iframe><p>Why did I decide to do it this way? A few reasons. One, I wanted to treat the mutation like any other post request. Data goes in, data comes out. I see a lot of tests trying to do some crazy things just to hit the resolver inside their mutation. I don’t really think that’s needed. Using the existing interface with the GraphQL Schema should test what you need to. Hope this helps, and I how you provide some feedback. I would love to see how everyone else tests. I can be found on twitter.</p><p><a href="https://twitter.com/rjrobinson?lang=en">RJ Robinson (@RJrobinson) | Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5c7d02b1e58" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>