<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Martin Arista</title>
    <description>The latest articles on Forem by Martin Arista (@mrtnrst).</description>
    <link>https://forem.com/mrtnrst</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F51564%2F32a3f011-1fd0-4860-864a-4d6b6b0cabd7.JPG</url>
      <title>Forem: Martin Arista</title>
      <link>https://forem.com/mrtnrst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mrtnrst"/>
    <language>en</language>
    <item>
      <title>4 Ways to Review a Pull Request</title>
      <dc:creator>Martin Arista</dc:creator>
      <pubDate>Sun, 10 Jan 2021 17:33:17 +0000</pubDate>
      <link>https://forem.com/mrtnrst/4-ways-to-review-a-pull-request-1b8f</link>
      <guid>https://forem.com/mrtnrst/4-ways-to-review-a-pull-request-1b8f</guid>
      <description>&lt;p&gt;Generally, I review pull requests twice&lt;sup&gt;1&lt;/sup&gt; a day. Once when I sit down to start the workday and after lunch. I do this because, as a coworker, I don't want to be a blocker for anyone. Also, it gets me back into the work groove when starting my day and coming back from lunch. Lastly, and my personal favorite, I can procrastinate a bit starting my work.&lt;/p&gt;

&lt;p&gt;I do get excited to review others' work to see how they solved a problem;  I get to learn something new while I'm at it. Here are the top four things I'm doing and looking out for during a review.&lt;/p&gt;

&lt;h3&gt;
  
  
  The "Just going to throw this out there..." Comment
&lt;/h3&gt;

&lt;p&gt;We all have our own opinions on what the code should do and the correctness. We've all given a "nit" comment but, I want to make sure I'm giving &lt;em&gt;feedback&lt;/em&gt; and not telling others my way or the highway.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Always call out your nit&lt;/li&gt;
&lt;li&gt;What you'd like to see updated&lt;/li&gt;
&lt;li&gt;Why you want it updated&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are the softest of my comments during a review, very take it or leave it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Were you done with that?
&lt;/h3&gt;

&lt;p&gt;I try to frame my comments as questions rather than direct statements. There could be a requirement I'm unaware of or some bug they were working around. Again, maybe I'll learn something. This could be one of those moments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ok, now do it again
&lt;/h3&gt;

&lt;p&gt;We all strive for 100% code coverage, and &lt;em&gt;most&lt;/em&gt; times that's a lofty goal that only sets you up for failure&lt;sup&gt;2&lt;/sup&gt;. There are two things I expect with new code, anything else is just extra gold: were tests added, and are they more tests than we previously had. It's simple and one of the most effective ways to get people writing tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does this button do?
&lt;/h3&gt;

&lt;p&gt;I am not, and no one should be, a coworker who takes work, tosses it to QA for review, and waits for feedback on bugs. We are a team, right?  The last thing I do is walk through the testing steps in the PR description, leave any weird finds I have in the review box. Something a la this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PnX0NIgc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://docs.github.com/assets/images/help/pull_requests/review-summary-comment-window.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PnX0NIgc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://docs.github.com/assets/images/help/pull_requests/review-summary-comment-window.png" alt="github pull review comment" width="720" height="444"&gt;&lt;/a&gt;&lt;/p&gt;
Image courtesy of Github



&lt;h2&gt;
  
  
  ✨BONUS APPROVALS✨
&lt;/h2&gt;

&lt;p&gt;Ok so, approvals to me are just as important as reviewing. I like to leave more than just the green check we all are waiting for. Sometimes it's an emoji, like this one 🌭, and other times it's a gif like this one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/l0Ex6Ut39Zj7DzJn2/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/l0Ex6Ut39Zj7DzJn2/giphy.gif" alt="david schitts creek saying im obsessed" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
i will always celebrate a win for anyone #personalcheercaption



&lt;p&gt;Those are always a favorite and I use gifs more than I'm willing to admit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's your Process?
&lt;/h2&gt;

&lt;p&gt;Here is my process and I hope you're able to take something from it. How do you review work? What do you find the most encouraging when receiving feedback? Let me know in the comments!&lt;/p&gt;

&lt;h5&gt;
  
  
  Footnotes
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Anyone can message me and ask for a review. Twice a day, I have a dedicated time to look and check.&lt;/li&gt;
&lt;li&gt;One day I'll write something about having tests that cover every single line only ends up meaning you miss more than you intended. It's a hot take, I know. That doesn't mean you shouldn't write tests, please, write your tests.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>52postproject</category>
      <category>github</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Goals and More in 2021</title>
      <dc:creator>Martin Arista</dc:creator>
      <pubDate>Sat, 02 Jan 2021 19:00:27 +0000</pubDate>
      <link>https://forem.com/mrtnrst/goals-and-more-in-2021-4c0b</link>
      <guid>https://forem.com/mrtnrst/goals-and-more-in-2021-4c0b</guid>
      <description>&lt;p&gt;A goal I’ve had for a long while was to write one post every week. It didn’t have to be long or something profound, just something. Anything. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Challenge
&lt;/h3&gt;

&lt;p&gt;The #challenge I have for myself, write one thing a week, about anything, published every Friday(or Saturday, Sunday, or any day that ends in &lt;em&gt;y&lt;/em&gt;. Just get it out!).&lt;/p&gt;

&lt;h3&gt;
  
  
  My &lt;em&gt;Ideal&lt;/em&gt; Outcomes
&lt;/h3&gt;

&lt;p&gt;The big mental hurdle I’ve had with this is what do I write about? &lt;em&gt;Anything.&lt;/em&gt; I’ve had a few years of mishaps and broken code that I’ve fixed and maybe someone else could learn from my mistakes? No pressure honestly, I’m not perfect, no one is. Half the time, like when I’m onboarding new coworkers, I wince at my old work and mutter “Do as I say, not as I do.” (Small secret, I make a note to go fix whatever I did wrong and loop it into my next PR.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cxEiTBr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ywh60d0a9652wibj63oc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cxEiTBr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ywh60d0a9652wibj63oc.gif" alt="Adventure Time - Sucking at something is the first step to being good at something" width="474" height="266"&gt;&lt;/a&gt;&lt;/p&gt;
This is me now and forever.



&lt;p&gt;Hey, that’s not a &lt;em&gt;bad&lt;/em&gt; idea actually. My next post can be about how I handle pull requests, from both myself and from coworkers. It will mostly be an ode to smaller PRs and my awkward OCD.&lt;/p&gt;

&lt;p&gt;If anyone wants to follow along, or get started yourself, I'm tagging all these posts with the hashtag &lt;strong&gt;#52postproject&lt;/strong&gt; for easy tracking. And on that note, I’ll end it here (I did mention these might be short didn’t I?). &lt;/p&gt;

&lt;p&gt;What are you plans for the New Year? Big or small, what would you like to check off your list of things?&lt;/p&gt;

</description>
      <category>52postproject</category>
      <category>devjournal</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Strongly Typed Identifiers</title>
      <dc:creator>Martin Arista</dc:creator>
      <pubDate>Tue, 03 Apr 2018 00:29:30 +0000</pubDate>
      <link>https://forem.com/mrtnrst/strongly-typed-identifiers-61j</link>
      <guid>https://forem.com/mrtnrst/strongly-typed-identifiers-61j</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;This post originally appeared on my blog &lt;a href="//www.medium.com/mrtnrst"&gt;mrtnrst&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you ever typed a word so many times it looks misspelled? As someone who types for a living, I tend to have trouble with this. The beauty of a misspelled word in programming is consistency. If it’s wrong everywhere, it’s right- right? However, loosely typed identifiers can lead to problems down the road for both our future selves and other code maintainers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2AxnUUIJSPNh1sgIR4SbJZDg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2AxnUUIJSPNh1sgIR4SbJZDg.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting with Colors
&lt;/h2&gt;

&lt;p&gt;With most UI/UX programs, we tend to work with color, generally stemming from a style guide. Let us consider this function:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This color view can be anything we want it to be but our guide says we can only use the colors given to us. Rather than having to remember an RGB value to create each time, let’s make it easier on ourselves.&lt;br&gt;
With a small bit of setup, we can fix something that is prone to errors. We can utilize structs to achieve this.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This is one of the simple use cases of a strongly typed identifier. The goal of this is to make sure we keep avoidable errors to a minimum.&lt;/p&gt;




&lt;h2&gt;
  
  
  Graduating to Strings
&lt;/h2&gt;

&lt;p&gt;Another pain point and source of frustration is when strings are used all willy-nilly. For instance, this function here:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;A few things could happen when using this function. To name a few: misspelling of the id parameter, finding a different object with the same id or causing a crash when inside the function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2AHzyTMffW_7lCyKmbGWG_cQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2AHzyTMffW_7lCyKmbGWG_cQ.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let us take a second and strongly type these functions. We want to create a struct so we can be explicit and readability is at the highest.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;h2&gt;
  
  
  Generics, Structs, and Strongly Typed Identifiers
&lt;/h2&gt;

&lt;p&gt;More wisdom from Edna.Even with the extra struct, both uses still pass the compiler. Do you know why our function still accepts these values? As with all types, a String is a String no matter the alias. How about we change the type alias into something that is unique to that struct?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2AhIaLC8ON7Ch5OnBWPAsMuw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2AhIaLC8ON7Ch5OnBWPAsMuw.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is when we implement the protocols &lt;code&gt;RawRepresentable&lt;/code&gt; and &lt;code&gt;Equatable&lt;/code&gt; and sprinkle in Generics to create this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;As for the usage of this new and improved function:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;h2&gt;
  
  
  Voila!
&lt;/h2&gt;

&lt;p&gt;We have now locked up our function and kept the errors at bay. There are many different ways you can keep function associations close and organized. My advice to you is to start with low hanging fruit and keep building.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2ANb48ETsZv8ZliOuV7TX67w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2ANb48ETsZv8ZliOuV7TX67w.gif"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
