<?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 Elvis Pestana on Medium]]></title>
        <description><![CDATA[Stories by Elvis Pestana on Medium]]></description>
        <link>https://medium.com/@elvis.pestana?source=rss-27a3aa8cbf1b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-MKvEFz77hklohLlaU6bFA@2x.jpeg</url>
            <title>Stories by Elvis Pestana on Medium</title>
            <link>https://medium.com/@elvis.pestana?source=rss-27a3aa8cbf1b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 07 Sep 2019 03:35:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/@elvis.pestana" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[No glorified hello worlds here]]></title>
            <link>https://medium.com/nearsoft-solutions/no-glorified-hello-worlds-here-8678ec3bc012?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8678ec3bc012</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[team]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Mon, 08 Jan 2018 00:28:31 GMT</pubDate>
            <atom:updated>2018-01-08T00:28:31.730Z</atom:updated>
            <content:encoded><![CDATA[<p>In the years I have been developing software, mostly web-focused, something was always missing: Unit testing. This was due to have been in companies whose culture abhorred anything that leads to delays, even justified. Something that could not be easily justified, cost-wise, as an advantage would be throw out the window.</p><p>My experience is limited to personal projects with perfect world requirements. So, in the end, I consider myself as a beginner on unit testing.</p><p>Where to start? I can analyze — and have analyzed — projects with unit testing implemented but nothing replaces hands-on experience in real projects with users and it’s edge cases. Glorified “hello worlds” do not count.</p><blockquote>Testing is like digital security. Whoever is responsible for this will always be in an ungrateful position to defend.</blockquote><p>Going back a little, I understand the advantages of unit testing. I’ve seen projects with testing implemented and the benefits it’s bringing to the table, but it’s been impossible to convince management of its importance — and even other senior developers. Maybe I’m not good at communicating the pros and cons.</p><p>Finally, the other issue that unit testing brings. Testing is like digital security. Whoever is responsible for this will always be in an ungrateful position to defend. When everything is going well, that unit testing is doing its job properly and the devs reap the benefits someone will probably say — or at least think:</p><blockquote>Why are we wasting time with unit testing if everything is going so well? Why am I paying you?</blockquote><p>Or even when the <strong>inevitable </strong>bugs occur:</p><blockquote>Why are we having problems? I thought we had unit testing. Why am I paying you?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CfdxLFqER3D-buDMmBh5sw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/5oyFrBF33Q4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Edu Lauton</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>This is aggravating.</strong></p><p>One time I was meeting the teams on a new company that, eventually, I joined and I remember asking “Do you do unit testing?”. The happy answer was “of course”. I was happy that I would be joining a company where I could get experience with unit testing on real-world projects. Little did I know he was referring to end-user testing. There was a team dedicated to testing entire user processes, from start to finish, to make sure everything was according to the requirements. This was good to have, but it was not unit testing. I later found that this company had an annoying habit of using industry standard names that meant something completely different inside the company. Consultants? = Glorified salesmen.</p><p>Articulating the advantages seems hard when even seasoned devs don’t want or care about unit testing. In real life, we also have to take into account company policy, personal interests — I want this project done ASAP! — which usually means getting closer to that bonus.</p><p>What are the usual pros? Let’s list them.</p><ul><li>Finds bugs early — The sooner a bug is found, the less likely it appears on production.</li><li>Improves code quality and readability — A big advantage for big projects.</li><li>Facilitates changes giving greater confidence to the developer that his changes did not break existing functionality, therefore…</li><li>… boosts developer productivity.</li></ul><p>Sum all of the above and you have the biggest pro since it reduces costs in the medium to long-term.</p><blockquote>I can analyze projects with unit testing implemented but nothing replaces hands-on experience in real projects with users and it’s edge cases. Glorified “hello worlds” do not count.</blockquote><p>What are the downsides? Let’s take a look:</p><ul><li>Does not guarantee bug-free code. This is the obvious one, but somehow some people believe unit testing to be magical.</li><li>Time-consuming. Same as saying it costs more. Can’t release the project on time, or the project must have features cut. Managers/Clients don’t like to hear that.</li><li>Unit tests can/will have bugs. This one is down to the quality of the dev team. Have less discipline here and you will get in trouble.</li></ul><p>It boils down to cost. A company culture that does not allow a developer to fail will not have unit testing. If you cannot count on your teammates to help, you will not have unit testing. If your company only sees you as a row on an excel spreadsheet, that means you will actually get burned with unit testing (cost) and then you will not have unit testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jsodd7y2uNxBeWED_ufuHg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/82TpEld0_e4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">G. Crescoli</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>After reading much about unit testing the greatest advantage I see is that it makes us focus and reflect on the code written. If your code is too big or hard to read, you will most likely refactor it. In a team, this will lead to increased productivity with higher quality code bases. As a developer, I don’t need any more reasons to like unit testing.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8678ec3bc012" width="1" height="1"><hr><p><a href="https://medium.com/nearsoft-solutions/no-glorified-hello-worlds-here-8678ec3bc012">No glorified hello worlds here</a> was originally published in <a href="https://medium.com/nearsoft-solutions">Nearsoft Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[And these debts will be paid with interest]]></title>
            <link>https://medium.com/nearsoft-solutions/and-these-debts-will-be-paid-with-interest-f3f836603441?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3f836603441</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technical-debt]]></category>
            <category><![CDATA[team-collaboration]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Mon, 01 Jan 2018 22:23:51 GMT</pubDate>
            <atom:updated>2018-01-01T22:23:51.620Z</atom:updated>
            <content:encoded><![CDATA[<p>Something that has always bothered me, in my programmer career is building code for the short term, or the temporary hack, that will remain forever in the code base. I find it that temporary hacks are nothing more than ignorance on how, and how long, it takes to solve a specific problem.</p><blockquote>“There’s nothing more permanent than a temporary hack.” — Kyle Simpson</blockquote><p>Does this mean I have never done it? Of course I have, and all programmers have done it at some point in their career and, like me, will probably do it again.</p><p>So we do it on purpose, right? Well <strong>yes </strong>and <strong>no</strong>.</p><p>Yes because we are pressured by deadlines to deliver a product on time and on budget. A good developer that does this on purpose is aware of its problems, so it takes notes and/or creates an issue on the issue tracker to solve it a later time. The problem here is the “<strong>a later time</strong>”. If your teammates and management in your company don’t understand that it has to be done, this will, almost every time, come bite you in the ass at a later date.</p><p>How? The two most common scenarios.</p><ol><li>Another hack will be made to compensate the shortcomings of the first one. This will pile on and a third, fourth, ad infinitum, hacks will be made to compensate the shortcomings of the previous one.</li><li>Since your name was on the commit and due to the shortcomings of said hack, you will take the blame for the time it takes to “fix” the hack — see scenario 1.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*og3DjfY1v_eU4q6vNRqXHw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/rX12B5uX7QM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ian Espinosa</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This eats away at the productivity of your team and causes a <a href="https://en.wikipedia.org/wiki/Sunk_cost">sunken cost</a>. The reasons for this cost are not obvious. The only thing that is noticed, by management, is that more money has to be spent on the project.</p><p>If someone on your team does not take notes on the hacks, this is a sign of future pain and suffering for the entire team.</p><p>Every month or so — your mileage may vary — some time should be set aside to solve these issues or risk getting drowned in them.</p><p>No , because the developer is unaware of the problems due to having low experience on how the code affects the code base. This is either inexperience as a programmer or inexperience with the code base itself. These hacks work great in the short term and give the appearance that the programmer can work in any environment, but is only leading to technical debt.</p><blockquote>And these debts will be paid with interest.</blockquote><p>If you scale of perfection is 1 to 10, with 10 being perfect, then always aim to 10 even though you will never get there. You will reach, hopefully, an 8 or even 9, but if you aim to the 8, you will be content with a 6 — until the day you have to maintain that code.</p><p>So my new year’s resolution will be to avoid hacks whenever possible and make sure my teammates understand the consequences of technical debt. Use mentoring, use technical tools — code reviews — or anything that is required to make sure everyone is on board.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3f836603441" width="1" height="1"><hr><p><a href="https://medium.com/nearsoft-solutions/and-these-debts-will-be-paid-with-interest-f3f836603441">And these debts will be paid with interest</a> was originally published in <a href="https://medium.com/nearsoft-solutions">Nearsoft Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It’s simple, right?]]></title>
            <link>https://medium.com/@elvis.pestana/its-simple-right-49264aeebd80?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/49264aeebd80</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Sun, 24 Dec 2017 20:36:56 GMT</pubDate>
            <atom:updated>2017-12-24T20:36:56.166Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Requirements:</strong></blockquote><blockquote>“Hi there. I want to create a website where I can put pictures and videos about stuff for sale and at the bottom, I want to put my contacts. What do I need and how much does that cost? It’s simple, right?”</blockquote><p>That’s all I have for requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oT0-Tqda8sGMdKH0SHPbOw.jpeg" /><figcaption>Just with this</figcaption></figure><p>Of course, I eventually ask for more details, but the details provided were not really unexpected since I know this person. Base on that I reach the conclusion that I need to:</p><ol><li>Buy a domain (email with that domain).</li><li>Host it somewhere.</li><li>Buy a design. A minimal design is preferable.</li><li>Pick a barebones open source CMS that is easily hackable (just in case).</li><li>Implement said design on chosen CMS.</li><li>Publish it all.</li></ol><h3>But wait!</h3><p>Guess who will have to manage this later? Me! The one who just wants to get this over with, but also wants to make sure the client has everything it needs. I will provide basic help in the near future (the next month or so), but I can’t let this take over my time.</p><blockquote>I actually dislike Wordpress, from a developer point of view</blockquote><p><strong>Enter Wordpress</strong>. I actually dislike Wordpress, from a developer point of view, but does make a lot of things simple. Short to medium term it gets the job done. It ticks all the boxes and there are dozens or more providers out there who can host and configure everything with just a few click.</p><p>My dislike for Wordpress has nothing to do with the language — PHP. It’s a nightmare if used in a context of full customization, but when the requirements are straightforward it’s actually a pretty good platform.</p><blockquote>My dislike for Wordpress has nothing to do with the language — PHP</blockquote><p>So, in the end, I decided to leave over-engineering behind and go for the simplest solution.Got a host that did everything I needed, paid for a full year. Wordpress installed using their interface and got the job done.</p><p><strong>KISS: </strong>Keep<strong> </strong>It<strong> </strong>Simple<strong> </strong>Stupid<strong> </strong>applies like a glove.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49264aeebd80" width="1" height="1">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reset root user password on WSL]]></title>
            <link>https://medium.com/@elvis.pestana/reset-root-user-password-on-wsl-aa3ecf82fbd6?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa3ecf82fbd6</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[wsl]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Sun, 10 Sep 2017 12:54:42 GMT</pubDate>
            <atom:updated>2017-09-10T14:46:54.703Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been a while since I used bash on windows, so I had forgotten the root user password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLDpmvkPgIYvX_8sgoPNZg.jpeg" /></figure><p>After some digging around I ended up finding how to do it:</p><p>Remember your <strong>default username</strong> for WSL, then enter a admin command prompt on Windows (WIN+X then A), then run the following command to the default user to <strong>root</strong> so that you can login with no password:</p><pre>lxrun /setdefaultuser root</pre><p>Keep the admin command prompt open, then enter the WSL cli application and change the default user password by issuing the following command:</p><pre>passwd default_username</pre><p>After entering the new password for <strong>default_username</strong> exit the WSL cli and set the default user to the <strong>default_username:</strong></p><pre>lxrun /setdefaultuser default_username</pre><p>Done. You can now enter the WSL cli application and get back to whatever you were doing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa3ecf82fbd6" width="1" height="1">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tools of the trade 2017]]></title>
            <link>https://medium.com/nearsoft-solutions/tools-of-the-trade-2017-ad3679bda48d?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad3679bda48d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Thu, 31 Aug 2017 22:12:32 GMT</pubDate>
            <atom:updated>2017-12-28T15:29:05.890Z</atom:updated>
            <content:encoded><![CDATA[<p>A developer’s tool stack is something usually very personal (spaces for indent always), but I decided to share this so that I could keep a personal record of how this changes over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dCYgstQ4ugVR4YF-7lQ-pg.jpeg" /><figcaption>Many buttons, many options.</figcaption></figure><p>Let’s start with the hardware:</p><ul><li>Macbook Pro 2017 (13“)</li><li>27&quot; 4K Monitor (LG)</li><li>Mouse Logitech MX Master</li></ul><p>I mainly develop with PHP so that of course influences my current development stack on the software side:</p><ul><li>IDE: PHPStorm | Visual Studio Code | occasional use of Vim.</li><li>For command line: <a href="http://iterm2">iTerm2</a> with Oh My Zsh (<a href="https://gist.github.com/kevin-smets/8568070">https://gist.github.com/kevin-smets/8568070</a>). MacOSX built in <strong>Terminal</strong> defaults are horrible and decided to pick something that would look better overall.</li><li>Homebrew to manage packages on MacOSX.</li><li>Environment based on Docker containers.</li><li><a href="https://www.spectacleapp.com/">Spectacle App</a> for managing windows. MacOSX is pretty horrible in this regard.</li><li>Browser: Google Chrome. Safari is used to house the Slack web app. Desktop Slack is horrible (for memory consumption).</li><li>For DB management I use two different applications. <a href="https://www.mysql.com/products/workbench/">MySQL Workbench</a> for production environments and <a href="https://www.sequelpro.com/">Sequel Pro</a> for dev/local.</li></ul><p>That’s the basics. There are a few more apps that are mostly there for experimentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad3679bda48d" width="1" height="1"><hr><p><a href="https://medium.com/nearsoft-solutions/tools-of-the-trade-2017-ad3679bda48d">Tools of the trade 2017</a> was originally published in <a href="https://medium.com/nearsoft-solutions">Nearsoft Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adventures in Laravel 5.4 land — view management]]></title>
            <link>https://medium.com/nearsoft-solutions/adventures-in-laravel-5-4-land-view-management-746d9336a6b8?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/746d9336a6b8</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[laravel-blade]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Thu, 03 Aug 2017 19:01:02 GMT</pubDate>
            <atom:updated>2017-10-19T23:36:30.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olJUeL2ziDvUPnXBBbPCYA.jpeg" /></figure><p><em>update: This also works fine in Laravel 5.5</em></p><p>Recently started working with Laravel (5.4) and so far it’s been a joy to work with.</p><p>The first roadblock I encountered was on <strong>how to organize views/templates</strong>.</p><h3>Page templates</h3><p>I went down the simplicity path, having the following rules:</p><ol><li>Grab the controller name, exclude the <em>Controller</em> part of the name, put it to lowercase. With this we have a folder that will house the templates that are used by that controller. For example: <em>HomeController</em> &gt; Home &gt; home.</li><li>Let’s assume that we create a method inside HomeController whose job is to load a generic <em>about us</em> page. So we create the method <strong>aboutUs</strong> and call the relevant view. What’s the name of view? Just call it <strong>about-us</strong>, which means a path <strong>/resources/views/home/about-us.blade.php</strong>.</li><li>The default controller method has a special name, <em>__invoke</em>, and since I did not want to have a view called <strong>invoke.blade.php</strong> I decided to just use the same name of the controller. So for now we have a folder called <strong>home</strong> with a file called <strong>home.blade.php</strong>. Based on these rules we can immediately assume, with a high degree of certainty, that the view <strong>home.blade.php</strong> is called inside <em>HomeController::__invoke</em>.</li></ol><h3>What about partials?</h3><p>Partials are blocks of code that are reused in more than one page/view, so I needed a set of rules for creating these, so that the location where they exists makes sense and gives an ideia of how it’s used. <strong>These rules assumed you are following the previously laid out rules.</strong></p><ol><li>When the partial is only used among the views of a single controller, create a folder called <strong>partials</strong> inside the controller view folder. Put your partials in these. Ex: <strong>/resources/views/home/partials/example-partial.blade.php</strong>.</li><li>When the partial is used by different controllers, then put them inside a <strong>partials </strong>folder inside the views folder, on the same level as the controller views folder. Ex: <strong>/resources/views/partials/example-partial.blade.php</strong>.</li></ol><h3>Layouts</h3><p>I did not see a reason to change the location of layout files (<strong>/resources/views/layouts/master.blade.php).</strong></p><p>I’m sure there will be edge cases in which these rules cannot be applied, but I hope that these rules minimize those cases, instead of having the mess of view files that makes it hard to pinpoint what are it’s intended uses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=746d9336a6b8" width="1" height="1"><hr><p><a href="https://medium.com/nearsoft-solutions/adventures-in-laravel-5-4-land-view-management-746d9336a6b8">Adventures in Laravel 5.4 land — view management</a> was originally published in <a href="https://medium.com/nearsoft-solutions">Nearsoft Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This happens way too often I’m my experience.]]></title>
            <link>https://medium.com/@elvis.pestana/this-happens-way-too-often-i-m-my-experience-bd0a361a087a?source=rss-27a3aa8cbf1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd0a361a087a</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[teaching]]></category>
            <category><![CDATA[up]]></category>
            <dc:creator><![CDATA[Elvis Pestana]]></dc:creator>
            <pubDate>Sun, 14 Feb 2016 23:25:40 GMT</pubDate>
            <atom:updated>2016-02-14T23:25:40.792Z</atom:updated>
            <content:encoded><![CDATA[<p>This happens way too often I’m my experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd0a361a087a" width="1" height="1">]]></content:encoded>
        </item>
    </channel>
</rss>