<?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 The Inked Engineer on Medium]]></title>
        <description><![CDATA[Stories by The Inked Engineer on Medium]]></description>
        <link>https://medium.com/@theinkedengineer?source=rss-a7cfccf536da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*laz2LohFna3EAS3qCj509w@2x.jpeg</url>
            <title>Stories by The Inked Engineer on Medium</title>
            <link>https://medium.com/@theinkedengineer?source=rss-a7cfccf536da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 04:49:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@theinkedengineer/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[Check if app is running unit tests the Swift way]]></title>
            <link>https://medium.com/@theinkedengineer/check-if-app-is-running-unit-tests-the-swift-way-b51fbfd07989?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/b51fbfd07989</guid>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Tue, 14 Jan 2020 10:38:46 GMT</pubDate>
            <atom:updated>2020-01-14T10:38:46.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxZAz81urryrGZqTWDicHg.png" /></figure><p>While writing unit tests for function in my navigation framework, <a href="https://github.com/TheInkedEngineer/BloodyMary/tree/feature/navigation">still in development</a>, I ran into a problem in the following function:</p><pre><strong>public</strong> <strong>func</strong> pushViewController( <br>  <strong>_</strong> viewController: UIViewController, <br>  animated: Bool, <br>  completion: (() -&gt; Void)?<br>) {</pre><pre><strong>self</strong>.pushViewController(viewController, animated: animated)</pre><pre><strong>guard</strong> animated, <strong>let</strong> coordinator = <strong>self</strong>.transitionCoordinator <strong>else</strong> {<br>  DispatchQueue.main.async { completion?() }<br>  <strong>return<br></strong>}</pre><pre>coordinator.animate(alongsideTransition: <strong>nil</strong>) { <strong>_</strong> <strong>in</strong> completion?() }<br>}</pre><p>When writing tests that might invoke this function, with the animated parameter set to bool, in a normal behaviour `<strong><em>self</em></strong><em>.transitionCoordinator</em>` is not nil when animated is set to true, but since no actual transition is happening (in a unit test), it is nil, and it breaks the completion block.</p><p>So I needed a way to set animation to false, even if it was set to true from the outside during unit tests. `#if DEBUG` was not an option, obviously.</p><p>I did further digging and noticed that if you run Thread.current.threadDictionary the thread running the XCTest contains the following key: com.apple.dt.xctest.waiter-manager</p><p>So I wrote this extension:</p><pre><strong>extension</strong> Thread {<br>  <strong>var</strong> isRunningXCTest: Bool {<br>    <strong>for</strong> key <strong>in</strong> <strong>self</strong>.threadDictionary.allKeys {<br>      <strong>guard</strong> <strong>let</strong> keyAsString = key <strong>as</strong>? String <strong>else</strong> {<br>        <strong>continue<br>      </strong>}<br>    <br>      <strong>if</strong> keyAsString.split(separator: “.”).contains(“xctest”) {<br>        <strong>return</strong> <strong>true<br>      </strong>}<br>    }<br>    <strong>return</strong> <strong>false<br>  </strong>}<br>}</pre><p>I opted to check for xctest alone and not the whole key to <em>future proof it, </em>from any possibile changes to the key.</p><p>So now the code looks like this:</p><pre><strong>public</strong> <strong>func</strong> pushViewController( <br>  <strong>_</strong> viewController: UIViewController, <br>  animated: Bool, <br>  completion: (() -&gt; Void)?<br>) {</pre><pre><strong>if</strong> Thread.current.isRunningXCTest {<br>  <strong>self</strong>.pushViewController(viewController, animated: false)<br>} else {<br>  <strong>self</strong>.pushViewController(viewController, animated: animated)<br>}</pre><pre><strong>guard</strong> animated, <strong>let</strong> coordinator = <strong>self</strong>.transitionCoordinator <strong>else</strong> {<br>  DispatchQueue.main.async { completion?() }<br>  <strong>return<br></strong>}</pre><pre>coordinator.animate(alongsideTransition: <strong>nil</strong>) { <strong>_</strong> <strong>in</strong> completion?() }<br>}</pre><p>If you liked this article, you may like this:</p><p><a href="https://medium.com/@theinkedengineer/write-better-swift-code-with-precondition-58be49c1c8e2">Write better Swift code with: Precondition</a></p><p>Here is my twitter:</p><p><a href="https://twitter.com/theinkedgineer">TheInkedEngineer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b51fbfd07989" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to leverage SwiftUI to write your UIKit view faster]]></title>
            <link>https://medium.com/@theinkedengineer/how-to-leverage-swiftui-to-write-your-uikit-view-faster-2d71912549c0?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d71912549c0</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Mon, 21 Oct 2019 12:04:30 GMT</pubDate>
            <atom:updated>2019-10-21T12:32:59.930Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cb5UQwoPHTUE-G6oQz3c7A.png" /></figure><p><em>SwiftUI</em> is the new cool thing on the block. But anyone who actually used it will tell you it still is not yet (October 2019) ready for production. Regardless of how true that statement is, unless you are shipping only for <em>iOS13</em> users, chances are you still are using <em>UIKit</em>.</p><p><em>SwiftUI,</em> however, can be super useful. By leveraging its <em>Automatic Preview </em>feature, you can write your <em>UIView</em> and see them rendered in real-time without having to build and launch every single time.</p><p>Here is how to do it:</p><h4>Start By Creating your normal UIViewController</h4><pre><strong>final</strong> <strong>class</strong> DemoViewController: UIViewController {<br><strong>  override</strong> <strong>func</strong> viewDidLoad() {<br>    <strong>super</strong>.viewDidLoad()<br>    <strong>self</strong>.view.backgroundColor = .red<br>  }<br>}</pre><h4>Create a new <em>SwiftUI</em> file</h4><p>Inside of this file, write the following code</p><pre>#if canImport(SwiftUI) &amp;&amp; DEBUG<br><strong>import</strong> SwiftUI<br><strong>@available</strong>(<strong>iOS</strong> 13.0, *)<br><strong>struct</strong> PreviewViewController: PreviewProvider {<br>  <strong>static</strong> <strong>var</strong> previews: <strong>some</strong> View {<br>    DemoViewController()<br>  }<br>}<br>#endif</pre><p>This checks if you are in <em>DEBUG</em> mode, can import <em>SwiftUI</em> and if <em>iOS13</em> is available.</p><p><em>PreviewProvider</em> is a protocol that produces view previews in Xcode.</p><h4>Extend your UIViewController and make it conform to UIViewControllerRepresentable</h4><p>This compiler will tell you that your ViewController does not conform to the protocol, that is because you need to implement the following:</p><pre><strong>extension</strong> DemoViewController: UIViewControllerRepresentable {</pre><pre><strong>func</strong> makeUIViewController(<br>    context:UIViewControllerRepresentableContext&lt;DemoViewController&gt;<br>    ) -&gt; DemoViewController {</pre><pre><strong>    let</strong> vc = DemoViewController()<br>    // update the values of the vc, if needed<br>    <strong>return</strong> vc<br>}</pre><pre><strong>func</strong> updateUIViewController(<br>    <strong>_</strong> uiViewController: DemoViewController, <br>    context: UIViewControllerRepresentableContext&lt;DemoViewController&gt;) {}</pre><pre>}</pre><p>VOILA!</p><p>Now, if you update your ViewController’s code, it will be reflected in the Preview.</p><h4>PRO TIP</h4><p>Copy your UIViewController to the SwiftUI file. When you are satisfied with it, move it back to where you please.<br>If you don’t then every modification you make, will require you to re-run preview because the preview will break since a file in the project was changed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d71912549c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I updated my curriculum after each job interview —  Here is what I did, and what you should do too.]]></title>
            <link>https://medium.com/@theinkedengineer/i-updated-my-curriculum-after-each-job-interview-here-is-what-i-did-and-what-you-should-do-too-255d3686b44c?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/255d3686b44c</guid>
            <category><![CDATA[minimalism]]></category>
            <category><![CDATA[curriculum]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[resume]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Thu, 03 Oct 2019 08:11:47 GMT</pubDate>
            <atom:updated>2019-10-03T08:11:47.671Z</atom:updated>
            <content:encoded><![CDATA[<h3>I updated my curriculum after each job interview — Here is what I did, and what you should do too.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2AAvrNJfFOcBSMV0jU7Ew.png" /></figure><p>In this article, I will go over the three iterations that my curriculum went through. I will cover the reasoning behind modifications and give pointers so you too can get the most out of your curriculum and make it pop.</p><p>Before we dive in, first things first:</p><blockquote><strong>STOP USING CHARTS, STARS, PERCENTAGES and any other equivalent to represent your skills in a resume</strong>.</blockquote><p>I will go into the why later in this article. But I wanted this to be clear. If you take one thing from this article, please let this be it.</p><h4>All three curriculums are from 2019</h4><p>This might sound weird, but I did update and iterate over my curriculum three times within a year. Who knows, after receiving some feedback, I might have a V4 by the end of the year.</p><h3>Version 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWGesq4oCa1VpgkQ-4RuzA.png" /></figure><p>This is the first version of my curriculum. Actually, this design is from December 2017. However, I did update it on the go in January 2019 when I was job hunting.</p><p>It has everything you expect in a curriculum:</p><ul><li>Personal Information</li><li>Work Experience</li><li>Skills</li><li>Education</li><li>Spoken Languages</li></ul><h4>Layout</h4><p>The idea behind the layout was the following:</p><ul><li>Separated personal information from content with the background color switch.</li><li>Made sure the introduction came at the top so it would be the first thing the hiring manager reads.</li><li>Work experience, languages and education being equally important (hint: they are not) I tried to separate them vertically.</li><li>I opted for a visual timeline like line to display the different steps. It was a bad idea, more on this in version 2.</li><li>Used icons for sections to give it more “life”.</li><li>Font weight was wrong, titles were not bold whereas subtitles where.</li></ul><h4>Personal Info</h4><p>The stuff you’d expect, nothing crazy; name, phone number, email, location, and website.</p><h4>Introduction</h4><p>I opted to include a self-introduction. The reasoning behind this is to give an overview of who I am. In my case, I am REALLY into design, even tho I have an engineering background.</p><h4>Career</h4><p>The “work experience” section contained the company, my role and the period which are things you’d expect. The important part was to stick to <strong>BULLET POINTS</strong> when explaining my responsibilities. HR people don’t have all day to read your poetry. Trust me. STICK TO THE POINT.<br>A good habit is to display your work experience in reverse chronological order.<br>I did add what technology or architecture was used in every job to give more context to my bullet points.</p><h4>Education</h4><p>At this point in my career (4 years in), courses I took at university are irrelevant so there was no point in pointing them out in detail. I kept it high level and gave a general overview of what I did.<br>I did include relevant courses I did on Udemy, and these did help get callbacks. It’s a positive point when you show that you are willing to dedicate a part of your personal time for your professional growth.</p><h4>Languages</h4><p>Yes, I did say `<strong>STOP USING CHARTS, STARS, PERCENTAGES and any other equivalent to represent your skills in a resume`</strong> but in my defence, I learn from my own mistakes. I will be explaining in Version 2 below on why these are useless.</p><h4>Skills</h4><p>In this version, I had a list of soft skills. I read somewhere online that including these soft skills on your curriculum can boost your chance of bla bla bla.. point is they are useless really.<br>The tech skills are important to mention so the hiring manager can know what to expect from you and what to question you about during the interview.</p><p>Though this version is not particularly bad, it is too verbose and too dark. It can be too much for whoever is reading it.</p><h3>Version 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EzWQSAkgBrk5SqAiGDxXQ.png" /></figure><p>The first thing you notice in this version is that it has more white space, is generally more colourful and more tender or the eyes.</p><p>Different sections do pop out more, but later I came to realise that it is still clumsy in the upper part (more on this is version 3).</p><h4>Layout</h4><ul><li>Got rid of the different background color and used the image to properly divide the parts of the curriculum.</li><li>Fixed the font weight problem by giving titles a bigger font and by making them bold, too.</li><li>Introduced a single color that I used as a separator to give the curriculum more life.</li><li>I did get rid of the “timeline” because it took too much space, and made updating the curriculum a pain in the ass. Every time I moved an item a pixel or two, I had to move the dot as well. Getting rid of it was the smart choice.</li><li>Removed the bottom section and kept the two vertical sections. I needed the space since I had more work experience now.</li></ul><h4>Personal Information</h4><p>This time around, I thought I would add more personal information, such as my medium account to show my blog posts, and my dribbble to show my designs. I got rid of the website because I was not updating it, added my logo since I do want to start my own brand “THEINKEDENGINEER” and went for the more professional email instead of a general gmail email.<br>These steps are not necessary obviously since the curriculum does not serve an end client, but they were nice to have.</p><h4>Introduction</h4><p>I kept the introduction but made it less invasive and more straight to the point. It shows my interests, what kind of person I am, and what are my hobbies.</p><h4>Career</h4><p>No significant changes.</p><h4>Education</h4><p>I thought about it, and since I do not even remember any of the stuff I actually learned I saw no point in mentioning them at all. What is more relevant are the things I actually know how to do.</p><h4>Skills</h4><p>I got rid of the soft skills because they seemed to me like a bunch of words thrown around that anyone can just put them on the curriculum. Plus during the interviews I had with that first curriculum, no one seemed to care about them.<br>As for the technical skills, I skimmed them down to the ones that are relevant and the ones I am actually willing to work with again. There is no point in putting that I know <em>Xamarin</em> on my curriculum if I am not willing to work with it anymore (BECAUSE YOU WILL ALWAYS GET TO THE SAME CONCLUSION: NATIVE IS BETTER).</p><h4>Languages</h4><p>I got rid of the percentages, below is the explanation and opted for a more classical way of communicating my knowledge.</p><h4>No more percentages!!! Beautiful, right? Here’s why:</h4><p>No one, absolutely no fucking one, is 5 stars in any skill regardless. There is no way you know Photoshop, Python, Swift, Excel 5/5 or 100%. It is impossible. Technology is evolving every single day. By the time you finish writing your curriculum something new is introduced and made your knowledge not complete anymore.<br>In addition, when you put let’s say 80% or 4/5, again, what does it actually mean? What is that 20% that you think you need to achieve full score?</p><blockquote>My conclusion is this:<strong> You either know something or you don’t.</strong></blockquote><p>Once you actually land the job interview than you can detail what you can actually do when it comes to a tool and what you can’t. There is no point in putting it in a chart on your curriculum. No good can come out of it.</p><h3>Version 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_fAR8gtbiTsihFWEIJQaw.png" /></figure><p>I changed the font to “Futura” for titles, and “Open Sans” for text.</p><p>Even MORE white space.</p><h4>Layout</h4><ul><li>Used my name to divide the page at this point. With personal info in the top right corner, and the logo in top left corner as if it’s an invoice of some sort.</li><li>Education, Languages and Skills are not as important as the work experience so I extracted my career information from the vertical layout and had it on the top alone so it get all the main attention. And more room to breath since it is the section where the hiring manager will spend most of his time.</li><li>Got rid of the center layout and opted for a more classical, slightly left indented spacing.</li></ul><h4>Personal Information</h4><p>I got rid of my picture. <br>I am applying to software engineering jobs, my looks don’t really matter so there was no point in keeping the picture. It just takes up space, plus I am blond now (as of October 2019), so it does not really reflect my current looks, does it?<br>I got rid of my social media accounts but added back my website which now has a landing page with all my accounts. It just made more sense.<br>Oh and I updated my logo, do you like it more?</p><h4>Introduction</h4><p>I got rid of the introduction. After more job interviews, no one really cares. Plus I almost always accompany my curriculum with a cover letter where I can actually explain the same points in a more detailed manner so there was no point in keeping it.</p><h4>Career</h4><p>Three main changes, other than the layout:</p><ul><li>I merged my experiences by companies. I worked at VINHOOD at two separate occasions, in the previous version it created confusion for those reading my curriculum. Some even thought it was a typo so I merged both jobs in one.</li><li>I got rid of the tech stack used in each job because they will ask you about it again at the job interview so no reason really to include it.</li><li>In previous versions, I kept it general and always went for Software Engineer as a job title. I do believe I am a Software Engineer before anything else. Platforms change, languages change, etc.. But at the same time, I am now specialised in iOS Engineering so it made sense to define it in the job title itself.</li></ul><h4>Education</h4><p>No changes.</p><h4>Skills</h4><p>No changes</p><h4>Languages</h4><p>No changes</p><h3>TL;DR</h3><ul><li>less is more. They won’t read your curriculum that long. Stick to what is important</li><li>white space</li><li>STOP USING CHARTS, STARS, PERCENTAGES and any other equivalent to represent your skills in a resume.</li></ul><p>If you liked this article and wanna know why February 2019 is empty on my curriculum check out:</p><p><a href="https://medium.com/@theinkedengineer/3-weeks-later-i-quit-467eed836133">3 weeks later, I quit.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=255d3686b44c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write better Swift code with: Precondition]]></title>
            <link>https://medium.com/@theinkedengineer/write-better-swift-code-with-precondition-58be49c1c8e2?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/58be49c1c8e2</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[stdlib]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 16:17:04 GMT</pubDate>
            <atom:updated>2019-04-16T16:17:04.070Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqWu6za1Fap8Ls26tbgSlA.png" /><figcaption>Swift logo — source: <a href="https://commons.wikimedia.org/wiki/File:Swift_logo_with_text.svg">wikipedia</a></figcaption></figure><p>It might sound weird at first, but most often than not, it is better to let your app crash, then let it continue in an inconsistent state. It is even easier to debug a problem when a crash occurs, and you know where the crash is, compared to having an unexpected end result, where you have to guess where the error came from.</p><p>An efficient, elegant way to do so, is to use Swift’s Standard Library function — <a href="https://developer.apple.com/documentation/swift/1540960-precondition">precondition(_:_:file:line:)</a>.</p><p>Below is an example on how to use precondition and how it can make your code look better and more compact:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53c5391735f44c0323ef1bd3c6465486/href">https://medium.com/media/53c5391735f44c0323ef1bd3c6465486/href</a></iframe><ul><li>If we don’t put any control at all, we risk calculating a negative circumference which would then fuck everything up. Besides, by definition, a radius can not be negative.</li><li>Guard + fatalError would have gave us the same result, but precondition is more compact.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58be49c1c8e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Double Standards — The Cardi B case]]></title>
            <link>https://medium.com/@theinkedengineer/double-standards-the-cardi-b-case-4f5899ed6e1a?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f5899ed6e1a</guid>
            <category><![CDATA[entertainment]]></category>
            <category><![CDATA[drugs]]></category>
            <category><![CDATA[double-standard]]></category>
            <category><![CDATA[rape]]></category>
            <category><![CDATA[music]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Tue, 02 Apr 2019 22:10:56 GMT</pubDate>
            <atom:updated>2019-04-03T06:25:04.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>Double Standards — The Cardi B case</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kyo59IRqiASE_jv9NCD9lw.png" /></figure><p>Double standards are part of life. Whether it’s the rich old white man vs the ghetto black teenager, or how your manager treats you vs his favorite employee, double standards are everywhere. This does not imply that we should not shed light when they are present to try and fight them.</p><p>In this article, I want to discuss something that recently happened that made me mad about how serious it is. Drugging and raping confessions were looked over because the one who made them is a FEMALE pop star. When the allegations were against a male star, we all know how that ended up.</p><h3>The Cardi B case</h3><p>For those who do not know, Cardi B is a female rapper turned mega pop star from the Bronx, NY. She recently made headlines when a couple of her old videos resurfaced online where she admits to being a sex worker (which is illegal by law), who lured men with sex to drug them (which is illegal by law) and rob them (which is illegal by law).</p><p>let that sink in for a second…</p><p>She faced little to no backlash. What made things even worse for me, was the statement she put out after the fact to justify what she did.</p><p>Here is the full statement:</p><pre>I’m seeing on social media that a Live I did 3 years ago has popped back up. A Live where I talked about things I have to do in my past, I never claim to be perfect or come from a perfect world with a perfect past. I always speak my truth [and] I always own my shit.</pre><pre>I’m apart of a hip hop culture where you can talk about where you come from, talk about the wrong things you had to do to get where you are. I never glorified the things I brought up in that Live. I have never even put those things in my music because I’m not proud of it.</pre><pre>I made the choices that I did at the time because I had very limited options. I was blessed to have been able to rise from that, but so many women have not. The men I spoke about in my Live were men that I dated, that I was involved with, men that were conscious, willing and aware. I have a past that I can’t change, we all do.</pre><p>Well, let me start by calling bullshit on the content of that statement which was probably written by her publicist or PR disaster manager or whatever...</p><p>Let’s start with everything wrong with this statement:</p><ul><li>Speaking your truth does not exonerate you from what you did.</li><li>She says she comes from a culture where you can talk about where you come from, yet she says she does not include those things in her lyrics since she is not proud of them. Which one is it, Cardi? Rappers often talk about their drug and gang-related past, in their songs. Ranting on an Instagram live is not culture related.</li><li>She was a stripper. A ratchet stripper. She had options. Even if she did not, that does not give her a pass to do what she did.</li><li>Drugging and robbing your significant other is still a crime.</li><li>By definition, being drugged means NOT being conscious.</li><li>Please, introduce me to who’s into that crazy sex role-playing where you are drugged and robbed. I would want to rob them too. <br>I am being very sarcastic of course. Saying those men were conscious, willing and aware is just playing stupid.</li></ul><p>Had a man done those exact same things, he would have been behind bars by now. He would have every female movement against him. He would have been canceled. The list really just goes on and on. Just look up what happened to Bill Cosby and R. Kelly.</p><p>I am not saying that men should be forgiven for behaving immorally. However, just like men and dragged through the mud when allegations are made against them, women should receive equal treatment.</p><p>Actually, I can make a case how Louis C.K. masturbating over the phone is really nothing compared to what Cardi admitted to doing. Yet he is canceled while she is cashing multi-million dollars from Pepsi, Netflix, and Fashionova among others.</p><p>Cardi B should be canceled. Cardi B should face trial. Cardi B should go to jail.</p><p>Cardi B however, will just let this fade in a couple of months until the next man scandal when our attention span just shifts away and forget about this whole thing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f5899ed6e1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How-NOT-to recruit software engineers!]]></title>
            <link>https://medium.com/@theinkedengineer/how-not-to-recruit-software-engineers-1d493db9e873?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d493db9e873</guid>
            <category><![CDATA[recruitment]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[headhunting]]></category>
            <category><![CDATA[recruiting]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 06:52:09 GMT</pubDate>
            <atom:updated>2019-03-20T06:52:09.180Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lVrTZ1PLoUSH78CnlguIjg.png" /></figure><p>Hi there,</p><p>If you are a headhunter or recruiter, take this real-life example as a how-NOT-to recruit software engineers. Or anyone to be honest.</p><p>If you are anyone else, just read and have a good laugh.</p><h3>Round 1</h3><p>So around 7:33 pm, I get a message on LinkedIn from a <strong>SENIOR ICT Head Hunter </strong>asking me for my curriculum for a job opportunity in Milan, for a final client as a Software Engineer.</p><p>The message was the following:</p><pre>Buonasera, le chiedo gentilmente il cv perchè vorrei parlarle di un’opportunità su Milano, società finale, SW Engineer. Grazie (email)</pre><p>which roughly translate to the following:</p><pre>Good evening, I would like to kindly ask you for you CV because I would like to discuss with you an opportunity in Milan for a final client as a SW Engineer. Thanks (email)</pre><h4>Here is what is wrong:</h4><ul><li>She asked for my curriculum when she could have easily read my LinkedIn page.</li><li>The message felt like a copy paste. She did not even bother adding my name to give it (even if fake) the feeling that it was meant for me</li><li>I do understand that headhunters want to keep the name of the company private for obvious reasons, but at least let me know what sector they work in.</li><li>I know the position is a software engineering position. Can I know more, please tho? Like my responsibilities? the technology I will work with? domain I will work in? Is it a frontend, backend, mobile position?</li></ul><p>Headhunters need to realize that software engineers choose the company and position as much as the company chooses them.</p><h3>ROUND 2</h3><p>I usually never answer to such messages on LinkedIn because I feel they are nothing more than spam. But it was a Tuesday night, 9:55 p.m precisely, I had no plans and I am currently looking for a job, so I was like fuck it, let’s see where that goes. So I sent her an email, with my curriculum attached and kindly asking for more information. It went something like this:</p><pre>Ciao -----,<br>come da te richiesto su LinkedIn, ecco una copia del mio curriculum!<br>Intanto potresti dirmi qualcosa in più riguardo la posizione?</pre><pre>Grazie,<br>Firas</pre><p>which translate to:</p><pre>Hello ----, <br>As per your request, here is a copy of my curriculum!<br>Meanwhile, would you please tell me more regarding the position?</pre><pre>Regards,<br>Firas</pre><p>So I made it clear that I would like to know more about what she is offering, but I am willing to cooperate by attaching my curriculum.</p><p>Now,</p><p>Guess what her answer was..</p><p>no not that,</p><p>not that either,</p><p>After less than 10 minutes, precisely at 10:04 pm, she replies with the following message:</p><pre>Grazie,</pre><pre>Ti giro gentilmente la RAL bonus e benefits. Inoltre quanto conosci Restful infrastruttura a microservizi.</pre><pre>La posizione è quella di SW Engineer.<br>Grazie e attendo tue,</pre><pre>-----</pre><p>Which translates to (omitting the typo she made):</p><pre>Thanks, </pre><pre>Can you please tell me your RAL, bonuses and benefits? Moreover how much do you know about micro-service RESTful infrastructure?</pre><pre>The position is for a SW Engineer.</pre><p>Nah, you read that right!!!!</p><p>PS: RAL is basically your annual income before tax in Italy.</p><h4>Here is what is wrong:</h4><ul><li>She did not read my curriculum. No way 9 minutes after I send my curriculum she read the email, curriculum and had the time to write her answer. Not when I sent it via email at 9:55 p.m you.</li><li>She made a typo. I point that out because of her extremely fast response time.</li><li>She did not read my curriculum, otherwise, she would not have asked such a question. It is stated in my curriculum.</li><li>WHY THE FUCK do you care how much I currently get paid? How is this relevant? Moreover how is it even relevant before you interview me and assess my skills? I will never understand this when it comes to Italian hiring policy.</li><li>She never answered my concerns regarding the job position.</li></ul><p>I never answered back. I am tempted to answer with a link to this article. But I wouldn’t want to be the bad guy.</p><p>Companies, please hire good recruiters that care about the human in people they are hiring.</p><h3>TL;DR</h3><ul><li>Customize your initial message</li><li>Tell us information about the job, if possibile the company too.</li><li>Don’t ask for a curriculum on LinkedIn.</li><li>Actually read our curriculum when you ask for it.</li><li>Do not ask us how much we are currently getting paid. For sure not before assessing our skills.</li><li>Treat us like humans, not machines</li><li>And did I mention telling us information about the job?</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d493db9e873" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 weeks later, I quit.]]></title>
            <link>https://medium.com/@theinkedengineer/3-weeks-later-i-quit-467eed836133?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/467eed836133</guid>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[advice]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Fri, 08 Mar 2019 12:52:44 GMT</pubDate>
            <atom:updated>2019-03-08T12:52:44.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qygYORb-w4EK1T3ljOdorw.png" /><figcaption>Quickly made with <a href="https://vectr.com+/">https://vectr.com</a></figcaption></figure><blockquote>You are as good as the people you surround yourself with.</blockquote><p>I believe in a simple philosophy. You are as good as the people you surround yourself with. Whether that is in life, work, or any situation in general.<br>That is why exactly, 3 weeks after starting my new job I quit.</p><p>Let me tell you a quick fact about consultancy in Italy. The code is trash more often than not. No tests. No comments. No proper architecture. And most importantly, NO CODE REVIEW. I’ll talk about these problem in a whole different article. Bottom line is, I wanted to bring that culture to consultancy.</p><h4>Why I got the job</h4><p>Change is harder in big corporations so I stumbled upon this small consultancy in Milan, saw they had a job opening, so I did what no one ever does, I DMed the CEO directly, explained my passion, and asked to be considered for their iOS position and UX position.</p><p>The feedback I got was positive, and after a series of primary interviews, I landed the final one with the project manager and CTO of the company.</p><p>During that final job interview, I made it abundantly clear that my number one goal is to work in a company and environment that will help me grow as a software engineer. I don’t care about the job title or the pay, all that is useless if I am not getting better each and every day.</p><p>I was assured that even tho the code is not top notch at the moment, they do believe in clean code, team culture and don’t want developers that copy and paste code from stackoverflow.</p><p>We agreed to do a 3 month trial period to see if I like what they have to offer and if they like my work too.</p><h4>Reality</h4><p>Day 1, 2 and 3, I had no company macbook, and for legal reasons I could not use mine. So I spent the first three days just experimenting on playgrounds with future things they had in mind to develop.</p><p>Day 4, my macbook finally arrived, but my credentials are still not yet activated. To be fair, this did not depend on them but on their client. I use a colleague’s credentials and download the project. An hour later, I knew there was no way I will stay longer than those 3 month, here’s why:</p><ol><li>The podfile was not versioned. Coupled with not setting a specific cocoapods version let to several hours of problems before getting the project actually up and running.</li><li>A payment app racking hundreds of thousand of lines of code, hundreds of thousand of users had 0 comments. ZERO.</li><li>Architecture was non existent. Folder hierarchy was non existent.</li></ol><p>Bottom line, the code was bad and unmaintainable.</p><h4>Things got worse</h4><p>I don’t want to go into the details of everything that was wrong in the code, because that is not what made me want to leave instantly. It was who I ended up working with.</p><p>I believe in a culture based on feedback. In order for a person to improve, [s]he needs to accept feedback, work on it, and give feedback back to help other improve. It’s really simple.</p><p>However, what I ended up facing was cynical, passive aggressive colleagues who took constructive feedback as critisicm. The mind state basically is “as long as it compiles, it works.”</p><p>Below is a screenshot of a conversation I had with one of those colleagues:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9kRhJFYBfg9rvbseVe8cg.png" /></figure><p>It translates to the following</p><pre>ME: just an info, let url = link != nil ? link! : .homepage is better written as let url = link ?? .homepage</pre><pre>Him: yeah yea as you wish</pre><pre>ME: no man, it&#39;s not as I wish, that&#39;s the right way to write it</pre><pre>Him: that&#39;s you way, write it however you want</pre><p>That was the last drop in the bucket. Working in a toxic environment is a no no for me. People who refuse to get better, can not help you get better.</p><p>A week later, I sent an email to the CEO, thanking him for the opportunity and resigning citing the same reasons I wrote in this email in more details.</p><h4>Bottom Line</h4><p>Never settle for a job, even if the pay is good. Aim for a job that offers you colleagues that can help you improve and become a better version of you daily.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=467eed836133" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Morning Standup — 1 done right. 1 done awfully wrong.]]></title>
            <link>https://medium.com/@theinkedengineer/morning-standup-1-done-right-1-done-awfully-wrong-4bd5ec6cf205?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bd5ec6cf205</guid>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[stand-up]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Fri, 22 Feb 2019 14:17:15 GMT</pubDate>
            <atom:updated>2019-03-07T10:47:10.483Z</atom:updated>
            <content:encoded><![CDATA[<h3>Morning Standup — 1 done right. 1 done awfully wrong.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSxVoVGyRn1KuhELEBrFjQ.png" /></figure><p>In this article I want to discuss two morning stand up formats I was part of. One made me feel like everyone NEEDS to have a morning stand up, but the other made me rethink it. So I decided to write this article.</p><p>Out of respect I will not be using the companies’ real names. Let’s call them <strong>companyA</strong> and <strong>companyB</strong>.</p><p><strong>CompanyA</strong> is an iOS software-house, with around 80 people working there divided in different teams. 3 product teams (iOS engineers + designer + product manager), an ASO team, a PUA team, a people’s operation team, a marketing team, a software tools team, a data science team and an infrastructure team.</p><p><strong>CompanyB </strong>is a medium size consulting company. The project we were put on was for a bank and their new payment app. We were 4 teams. An iOS engineering team, an android engineering team, a backend team, and a maintenance team (I still have no idea what that team is, or does).</p><h3>The one done right</h3><p>The stand up was at 9:00 AM sharp to the second (Working hours in Italy are from 9:00 AM to 18:00 PM). Each day, a team had not more than 10 mins to present what they were working on since the last standup (that’s 1–2 weeks depending on the team) and to allow questions, if any. The presenter had to prepare a non mandatory slideshow (most did tho) focusing on main points, elaborate them, allow questions and at 9:10 AM tops, everyone was at their desk working. Each team then had its own way to manage in-team daily updates. My team, one of the product teams, tried different approaches, none were optimal. My personal favourite was the end of day slack message explaining what was done, and if something particularly was difficult to resolve.</p><p>This approach guaranteed a general overview of what teams are doing, without <strong>investing</strong> more than <strong>10 mins</strong> per day. And left the liberty to teams to decide what suits them better in terms of daily alignment.</p><h3>The one done wrong, oh so awfully wrong</h3><p>The standup was at 9:30 AM, and that’s the first fuck up. Having a stand up 30 mins after starting working hours is not a good idea. It will push people to arrive late-ish, then waste 10–15 mins waiting for 9:30 AM. Even those who actually start working at 9:00 AM, find themselves not so productive because you can’t get into your zone knowing that you will be interrupted. So you are left doing not so important tasks and being non productive most of the times.<br>Did I say 9:30 AM? I meant 9:32, 9:34, 9:31, depending on when people actually show up, and then you have to go call X because he did not show up etc..</p><p>The stand up was every member of every team talking about what they did the day before and what they plan on doing the current day. <strong>THIS IS A BAD IDEA</strong> for several reasons:</p><ul><li>I don’t care about what someone from the android team is working on everyday or what they did yesterday. If anything, a single person should speak per team and say what the team was able to do the day before.</li><li>Some are shy. A girl for 14 days straight said: “I am working on plastic card”. You don’t understand what she means? Well neither did I. All I knew from that was that she’s slow as hell.</li><li>One personA from a team might be talking about a problem he is facing, personB from his team comes up with a solution or proposition and feels comfortable sharing it in front of everyone.</li><li>People got bored and spent time on their phones</li><li>You leave the room with nothing to gain and around <strong>20 mins lost</strong>. Note that I used <em>invested</em> in the first example, but <em>lost</em> in this one.</li></ul><p>Just like most things in life, a morning stand up can be useful or a waste of time depending on how you manage it. Choose wisely.</p><p>Agree with what you read? In the famous words of Jeb Bush: <strong>Please Clap</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl0NwPo3VHujpJDI4w%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fjustin-jeb-bush-please-clap-applause-l0NwPo3VHujpJDI4w&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl0NwPo3VHujpJDI4w%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="252" frameborder="0" scrolling="no"><a href="https://medium.com/media/834d9bc377a57b3a38092de96571c6a8/href">https://medium.com/media/834d9bc377a57b3a38092de96571c6a8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bd5ec6cf205" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift Codable — WHAT THE FUCK is it?]]></title>
            <link>https://medium.com/hackernoon/swift-codable-what-the-fuck-is-it-a38c636130b6?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/a38c636130b6</guid>
            <category><![CDATA[codable]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Fri, 22 Feb 2019 08:23:44 GMT</pubDate>
            <atom:updated>2019-03-08T18:28:55.866Z</atom:updated>
            <content:encoded><![CDATA[<h3>Swift Codable — Decoded!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*KaHhS_0biZ98aaMHCpvYUw.png" /></figure><p><strong>Codable</strong> is a <strong>Swift protocol</strong>, more specifically a typealias that encloses two protocols: <strong>Encodable</strong> and <strong>Decodable</strong>.</p><pre>typealias Codable = Encodable &amp; Decodable</pre><h3>Wait, what?</h3><p>Before we delve into the details of <strong>Codable </strong>let’s go over the meaning and functionality of some keywords.</p><ul><li><a href="https://developer.apple.com/documentation/swift/encodable"><strong>Encodable</strong></a> is a type that can encode itself to an external representation using an encoder. In other words, it can convert its content to a particular format to accommodate external requirements.</li><li><a href="https://developer.apple.com/documentation/swift/encoder"><strong>Encoder</strong></a> is a protocol. It is responsible for converting encodable elements into other formats, such as JSON or XML. It does so by dictating a set of rules, some of which are configurable as we will see later.</li><li><a href="https://developer.apple.com/documentation/swift/decodable"><strong>Decodable</strong></a> is a type that can decode itself from an external representation using a decoder. In other words, it can unwrap data represented in different formats into Swift compatible types.</li><li><a href="https://developer.apple.com/documentation/swift/decoder"><strong>Decoder</strong></a> is a protocol as well. It is responsible for converting encoded data to elements into other formats, such as JSON or XML. It does so by dictating a set of rules, some of which are configurable as we will see later.</li></ul><p>To sum it up, encoding and decoding is the conversion between the native and custom Swift data structures and data formats. It is done using encoders and decoders. The most common conversion is between native Swift types and <a href="https://www.json.org/"><strong>JSON</strong></a>.</p><h3>Why do I need to learn this protocol?</h3><p>Before the introduction of Codable at <a href="https://developer.apple.com/videos/play/wwdc2017/212/">WWDC 2017 — What’s new in Foundation</a>, developers used third-party tools like <a href="https://github.com/SwiftyJSON">SwiftyJSON</a>, to jump from Swift types to JSON and vice versa. That came with a lot of overhead code to write and maintain.</p><p>The most common use case for encoding and decoding data is client-server communication. Whether it’s your own server or that of a third party API.</p><p>When data is returned from a server, usually in a JSON format, by conforming to Codable, you can pass that data to a <a href="https://developer.apple.com/documentation/foundation/jsondecoder">JSONDecoder</a> and it will create a Swift object for you. Below is a very simple example of a typical use case.</p><h4>Example</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d2c3756ce5cad267c350895f2df9e90/href">https://medium.com/media/7d2c3756ce5cad267c350895f2df9e90/href</a></iframe><h3>How does it work</h3><p>When a Swift type conforms to Decodable, three things happen:</p><ul><li>a private enum called <strong><em>CodingKeys: String, CodingKey</em></strong><em> </em>is created</li><li>an <strong><em>encode(to:Encoder)</em></strong> function is created</li><li>an <strong><em>init(from:Decoder)</em></strong> is created</li></ul><h4>What the fuck are those?</h4><p><strong><em>CodingKeys</em></strong> is an enum that maps a variable name to its data representation and vice versa. In other words, in Example A.1, the Coding Keys would have looked something like this:</p><pre>enum CodingKeys: String, CodingKey {<br>  case name<br>  case alias<br>}</pre><p>We will cover more complex cases later on in this article. For now, keep in mind that <em>CodingKeys </em>should contain all variables present in a given structure spelled in the same exact way unless you want to make your life a living hell.</p><p><strong><em>encode(to:Encoder) </em></strong>is part of the <strong>encodable protocol.</strong> Inside of this function, using the given encoder and CodingKeys, the object transforms itself from a Swift representation into the appropriate data format.<br>It does so in the following manner:</p><ul><li>It starts by creating a <strong>container</strong> of type <strong>KeyedEncodingContainer</strong>, which is an element that provides a view into an encoder’s storage, making encoded properties accessible via keys provided to it. These keys are none other than the CodingKeys previously defined.</li><li>It encodes each variable inside of that container given its appropriate key.</li></ul><p><strong><em>init(from:Decoder) </em></strong>is part of the <strong>decodable protocol.</strong> This initialization transforms a data representation, using the given decoder, into a fully initialized instance of itself that is ready for use. It does so in the following manner:</p><ul><li>It starts by creating a <strong>container</strong> of type <strong>KeyedDecodingContainer</strong>, which is an element that provides a view into a decoder’s storage, making encoded properties of a decodable type accessible via keys provided to it. These keys are none other than the CodingKeys previously defined.</li><li>It assigns to each variable the value decoded from the container for the proper key.</li></ul><p>Below in example, A.2, is the full implementation, including “hidden” elements that were autogenerated by swift.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6e035e12673808c0c976aa2cc81ca54/href">https://medium.com/media/d6e035e12673808c0c976aa2cc81ca54/href</a></iframe><h3>What if I want to customize things?</h3><p>By adhering to the Codable protocol you get a lot of things out of the box for free. But sometimes that is not good enough. The good news is, everything is customizable. CodingKeys, decoders and encoding/decoding functions.</p><h4>Customizing CodingKeys</h4><p>A typical use case for customizing CodingKeys is when the name of the variable inside the structure and its data representation does not match. This can happen for a variety of reasons. Anything from not liking how the name giving to a certain variable to different naming conventions. For instance, JSON uses <a href="https://en.wikipedia.org/wiki/Snake_case">snake_case</a> whereas Swift uses <a href="http://wiki.c2.com/?LowerCamelCase">lower camel case</a>.</p><p>Going back to our example, a person’s date of birth will typically be called <em>dateOfBirth</em> in a Swift object, whereas in a JSON it will be <em>date_of_birth</em>.</p><p>To fix this, we customize our CodingKeys by naming the <em>enum case</em> the same way as we named our Swift variable, but modifying its raw value to “date_of_birth” as shown below.</p><pre>enum CodingKeys: String, CodingKey {<br>    case name<br>    case alias<br>    case dateOfBirth = &quot;date_of_birth&quot;<br>}</pre><p>By doing so, anytime a Person instance is to be encoded it will assign “date_of_birth” as a dictionary key in the JSON, and whenever it wants to decode data into a Person instance it will look for the key with that same value.</p><p><strong>N.B.</strong>: In the off chance you need to override CodingKeys just to deal with snake_case to camelCase conversion when working with a JSONDecoder, you do not necessarily need to do, since the decoder offers an option to automatically do it for you as we will see in the “Customizing decoders” section.</p><h4>Customizing Decoders</h4><p>Out of the box Decoders like the JSONDecoder have room to be tweaked so you get the best performance out of them. As mentioned previously, if the only difference between your Swift Type and JSON data is the casing, you do not have to override the whole coding keys. The JSONDecoder has a keyCodingStrategy with a convertFromSnakeCase that does that for you. Another option is choosing the date decoding strategy like .iso8601 format.<br>The best way to know about all of those is obviously to check <a href="https://developer.apple.com/documentation/foundation/jsondecoder">the documentation</a>.</p><p>Below is Example B, showcasing how to apply what we learned so far in our Person code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/770b046ab1ee517a39a07deacf0a47e3/href">https://medium.com/media/770b046ab1ee517a39a07deacf0a47e3/href</a></iframe><h4>Overriding Encoders and Decoders</h4><p>You should try and avoid overriding the encoder and decoders unless you absolutely have to. They are already optimized for you. But sometimes you need to for extreme cases like when the <a href="https://developer.apple.com/documentation/swift/dictionary/2893562-encode">key of a dictionary is not a String or an Int</a>, or to execute certain code when certain values are decoded. Who knows, the possibilities are infinite.</p><h3>TL;DR</h3><ul><li>a Codable element is one that can encode itself into data formats (transforms itself into JSON for instance) and decode itself from data formats</li><li>most of the work is done for you automatically when conforming to codable</li><li>everything is customizable</li></ul><p>Like what you read? In the famous words of Jeb Bush: <strong>Please Clap</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl0NwPo3VHujpJDI4w%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fjustin-jeb-bush-please-clap-applause-l0NwPo3VHujpJDI4w&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl0NwPo3VHujpJDI4w%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="252" frameborder="0" scrolling="no"><a href="https://medium.com/media/991ca6880a710196269674376e6a963c/href">https://medium.com/media/991ca6880a710196269674376e6a963c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a38c636130b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/swift-codable-what-the-fuck-is-it-a38c636130b6">Swift Codable — WHAT THE FUCK is it?</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WHY and HOW to Use Strings as Arrays in Swift]]></title>
            <link>https://medium.com/@theinkedengineer/why-and-how-to-use-strings-as-arrays-in-swift-cdf5f74947fd?source=rss-a7cfccf536da------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdf5f74947fd</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[The Inked Engineer]]></dc:creator>
            <pubDate>Mon, 24 Sep 2018 09:43:10 GMT</pubDate>
            <atom:updated>2018-10-01T20:00:08.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eaeetv5KS3uZu4B9E892Ig.png" /><figcaption>Swift logo — source: <a href="https://commons.wikimedia.org/wiki/File:Swift_logo_with_text.svg">wikipedia</a></figcaption></figure><p>The first programming language I ever learned was Javascript, and I learned it to use <a href="https://d3js.org/">D3.js</a> for my bachelor’s thesis. For my first job as a Mobile Developer, I had to use C#, <a href="https://visualstudio.microsoft.com/xamarin/">Xamarin’s</a> language choice. At my second job as a software engineer at a wine startup, I used Python and <a href="https://www.djangoproject.com/">Django</a> to develop a website, a web application and an API.</p><p>One of the things that these three languages had in common, was how you can access a string via <a href="https://www.webopedia.com/TERM/S/subscript.html">subscript</a>.</p><p>Now, as an iOS engineer, I am working with Swift, an Apple-designed protocol-oriented programming language. It is easy to use, robust and designed for safety. This, however, comes with its price.</p><h4>THE PROBLEM</h4><p><strong>1. Too complicated<br></strong>Often, as in the case of String, you find yourself doing complex operations to do a simple operation. For instance, if you need to access the nth letter in a string, every time you have to do the following operation:</p><pre>let s = &quot;abc def&quot;<br>s.index(s.startIndex, offsetBy: 2) //this returns c </pre><p>And if you need a range, it’s even more complicated:</p><pre>let s = &quot;abc def&quot;<br>let start = s.index(s.startIndex, offsetBy: 4)<br>let end = s.index(b.startIndex, offsetBy: 6)<br>s[start...end] // this returns def</pre><p>At first, it might not seem much, but if you work with strings a lot, this will become an overhead compared to the <a href="https://docs.swift.org/swift-book/LanguageGuide/Subscripts.html">subscript</a> solution.</p><p><strong>2. Not Safe<br></strong>Another problem is how Swift deals with an out of bounds offset. Fatal error and the app crashes. This is not a behaviour you would want. For instance, when subscripting an array, there aretwo ways to go about it. The <em>sure</em> way that comes with the risk of crashing the app with an out of bound index, or the <em>safe</em> way and dealing with an optional value.</p><h4>SOLUTION</h4><p>Swift offers several powerful tools that would allow you to overcome those two problems. You can leverage extensions, subscripts and safe: to make strings act like arrays and access subparts of it, or single characters via subscript.</p><p>Below is a gist with the code updated to Swift 4.2</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/351e252edfac2d478dd4fc99f0d3abce/href">https://medium.com/media/351e252edfac2d478dd4fc99f0d3abce/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdf5f74947fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>