{"@attributes":{"version":"2.0"},"channel":{"title":"Programming on Adam's Writing Thing","link":"https:\/\/kalverra.github.io\/programming\/","description":"Adam's Writing Thing (Programming)","generator":"Hugo -- gohugo.io","language":"en-us","lastBuildDate":"Fri, 15 Apr 2022 00:00:00 +0000","item":[{"title":"Use Longer Fucking Variable Names","link":"https:\/\/kalverra.github.io\/programming\/use-longer-fucking-variable-names\/","pubDate":"Fri, 15 Apr 2022 00:00:00 +0000","guid":"https:\/\/kalverra.github.io\/programming\/use-longer-fucking-variable-names\/","description":"<p>Really, please just do it. I see this crap in so many different repos, written by otherwise amazingly good developers. A recent <a href=\"https:\/\/go.dev\/\">Go<\/a> example:<\/p>\n<hr>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">p<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>What the hell am I supposed to do with this? You know that computers have multiple terabytes of storage now right? What&rsquo;s the bullshit excuse for just using <code>e<\/code>?<\/p>\n<hr>\n<p><em>I&rsquo;m saving storage space<\/em><\/p>\n<hr>\n<p>You aren&rsquo;t programming the goddamn space shuttle, it&rsquo;s a bot that posts cat pictures on Instagram. You can spare a couple megabytes on your source code files.<\/p>\n<hr>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">pic<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>Okay better, but what&rsquo;s the pic?<\/p>\n<hr>\n<p><em>The pic from the function<\/em><\/p>\n<hr>\n<p>Just pretend I don&rsquo;t know what you&rsquo;re talking about, and imagine me asking you &ldquo;what the hell are you talking about?&rdquo;.<\/p>\n<hr>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">thePicFromThePicFunc<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>&hellip;<\/p>\n<hr>\n<p><em>I don&rsquo;t understand what you want from me<\/em><\/p>\n<hr>\n<p>Try to consider some descriptions of the object that the variable is pointing to. Imagine I&rsquo;m constantly asking you what the variable is for, how it can be used, and why you need it.<\/p>\n<hr>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">thePicFromThePicFuncThatHoldsAPicToUseForLater<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>Okay, let&rsquo;s maybe just concentrate on <strong>what<\/strong> a <code>pic<\/code> is. A <code>picture<\/code>? What kind of one?<\/p>\n<hr>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">catPicture<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>Great! What&rsquo;s the context around the cat picture? What info would help me figure out what I can do with the cat picture?<\/p>\n<hr>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#a6e22e\">latestCatPicture<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><hr>\n<p>I&rsquo;m so proud.<\/p>\n<hr>\n<p><em>What about <code>err<\/code>?<\/em><\/p>\n<hr>\n<p>You name that anything else and I think the Go gopher will manifest itself from your screen and slap you across the face.<\/p>\n<h2 id=\"and-write-more-comments-while-youre-at-it\" >And Write More Comments While You&rsquo;re At It\n<span>\n<a href=\"#and-write-more-comments-while-youre-at-it\">\n<svg viewBox=\"0 0 28 23\" height=\"100%\" width=\"19\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" fill=\"none\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"2\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" fill=\"none\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"2\"\/><\/svg>\n<\/a>\n<\/span>\n<\/h2><p>They&rsquo;re easy, I promise. Write an algorithm that looks weird? Just tell me why it has 19 nested for loops. Don&rsquo;t assume I&rsquo;ll figure it out or read the docs or some other ridiculous assumptions.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-go\" data-lang=\"go\"><span style=\"display:flex;\"><span><span style=\"color:#75715e\">\/\/ Assigns a variable and and error from calling picFunc()\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#75715e\"><\/span><span style=\"color:#a6e22e\">p<\/span>, <span style=\"color:#a6e22e\">err<\/span> <span style=\"color:#f92672\">:=<\/span> <span style=\"color:#a6e22e\">picFunc<\/span>()\n<\/span><\/span><\/code><\/pre><\/div><p>Go fuck yourself.<\/p>"},{"title":"Being a Great SDET","link":"https:\/\/kalverra.github.io\/programming\/good-testers-are-good-devs\/","pubDate":"Sat, 05 Mar 2022 00:00:00 +0000","guid":"https:\/\/kalverra.github.io\/programming\/good-testers-are-good-devs\/","description":"<h2 id=\"what-an-sdet-does\" >What an SDET Does\n<span>\n<a href=\"#what-an-sdet-does\">\n<svg viewBox=\"0 0 28 23\" height=\"100%\" width=\"19\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" fill=\"none\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"2\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" fill=\"none\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"2\"\/><\/svg>\n<\/a>\n<\/span>\n<\/h2><p>An SDET is a bit of a niche position in the tech world that focuses on testing software. You don&rsquo;t have the time or resources to wait for a team of manual testers figure out what you broke every time you refactor a method. So instead, you get a couple SDETs like myself to write a program to test your system with blazing speed. So every time you move a button to the left a bit, you can be sure that you didn&rsquo;t somehow also break half of your site. Most of SDETS work with developers and manual testers, figuring out how the system SHOULD work, and then finding a way to programmatically ensure that.<\/p>\n<h2 id=\"what-an-sdet-needs-to-be-good-at\" >What an SDET Needs to Be Good At\n<span>\n<a href=\"#what-an-sdet-needs-to-be-good-at\">\n<svg viewBox=\"0 0 28 23\" height=\"100%\" width=\"19\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" fill=\"none\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"2\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" fill=\"none\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"2\"\/><\/svg>\n<\/a>\n<\/span>\n<\/h2><p>Development.<\/p>\n<p>That&rsquo;s number 1, without a doubt. An SDET&rsquo;s goal is to test a system quickly and thoroughly, and to do that you need to design a program that can do all the following:<\/p>\n<ul>\n<li>Run as quickly as possible<\/li>\n<li>Concisely report what went wrong and why<\/li>\n<li>Easily understood by other developers and testers who want to test it<\/li>\n<li>Is easily expandable to account for new features and test cases<\/li>\n<\/ul>\n<p>All these traits require you to develop good software. The only big difference between an SDET and a typical developer is the goal and customers. Your goal is to find all the ways the system can break, and your customers are the developers who need to know what&rsquo;s breaking so they can fix it.<\/p>\n<p>The second most important skill is where the testing mindset comes into play. You need to be good at spotting edge cases, covering scenarios where things might fall apart, and prioritizing the tests that will bring the team the greatest amount of value. This all means gaining a deep understanding of how the system you&rsquo;re testing works.<\/p>\n<p>It&rsquo;s not for everyone, you&rsquo;re rarely the star of the show. I often describe it as playing the support or healing character in a role-playing game. You&rsquo;re rarely at the front of everyone&rsquo;s mind, but when you&rsquo;re not around, it&rsquo;s immediately evident.<\/p>"}]}}