<?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 Norman Schultz on Medium]]></title>
        <description><![CDATA[Stories by Norman Schultz on Medium]]></description>
        <link>https://medium.com/@normanrs?source=rss-1a55f77c1996------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*s3wQoFt7JyD5vbcltZzEzA.jpeg</url>
            <title>Stories by Norman Schultz on Medium</title>
            <link>https://medium.com/@normanrs?source=rss-1a55f77c1996------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 13:58:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@normanrs/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[I’m a Software Testing Noob]]></title>
            <link>https://medium.com/@normanrs/im-a-software-testing-noob-f36ada579aef?source=rss-1a55f77c1996------2</link>
            <guid isPermaLink="false">https://medium.com/p/f36ada579aef</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[qa-testing]]></category>
            <category><![CDATA[agile-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[minitest]]></category>
            <dc:creator><![CDATA[Norman Schultz]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 06:01:01 GMT</pubDate>
            <atom:updated>2020-10-06T23:04:38.689Z</atom:updated>
            <content:encoded><![CDATA[<p>Three months into my developer job. Here’s what I’ve learned about real-world testing so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*UeHHEp8x-AeMJMB1oOpXfQ.jpeg" /><figcaption>Being a QA dev is a lot like being a detective. I love it!</figcaption></figure><p>I got my first developer job in May of this year after completing the back end development program at the <a href="https://turing.io/">Turing School of Software and Design</a>. I’ve learned a <strong>ton</strong> since then.</p><p>I actually learned a lot from just the coding challenge for my new job and the subsequent interview. It involved working with a movie database API, verifying results returned from a title search. I tested whether the results matched the search made and if the entries returned were legit movies. During the interview we discussed my testing approach and expanded testing beyond the original ask. They liked the tests I wrote and more importantly how I thought. On top of that I got along well with people interviewing me and was very open about being genuinely interested in what the company was up to. I got the job.</p><p>Once I got past the onboarding phase I started working closely with the developer who interviewed me. He is not only a sharp programmer, he is a good mentor. Early on he regularly gave me challenges to overcome and asked about my thinking/ideas. My learning skyrocketed.</p><p>Here are some highlights of important things I’ve learned so far about real-world development testing:</p><ol><li><strong>You might not have control over your test data.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*ck46FK2STYOcftDvvE8Nnw.gif" /><figcaption>This is not the data we actually work with lol — but the complexity isn’t far off!</figcaption></figure><p>When you’re learning coding you end up working on small projects. You might be working alone or with a few other people. Maybe you’re given data to work with in the form of a existing CSV or JSON files used in database seeding. Maybe the data set you work with is pretty large, even.</p><p>None of this compares to the data “situation” you find at a large organization.</p><p>We have an entire team dedicated only to data. That team is located in a different city. They have their own SCRUM master and devs, stories and tickets. I’ve seen just a few of their database schemas — they are massive. I have access to our actual database using a client app (I use <a href="https://electronjs.org/apps/postbird">Postbird</a>) — it’s about 70 tables. This is just for the part of the business my team is involved in.</p><p>Some of the data we work with represents publicly available information. So for the related programming instead of using fake data (first_name: joe, last_name: schmo) we use real data. Using real data ensures that realistic data cases are covered. Because of this the data team creates and populates all versions of our database — production, development, and QA (our pre-deploy environment). While we are able to requests data cases, Developer access to the database is read-only.</p><p>The data changes over time because it reflects the real data of our business. An entry you see one month might not be the the same the next — or might not be there at all. As you can probably imagine, this presents some interesting challenges. Are you not getting anything returned because your query isn’t written properly, or is there just nothing there to be returned? Is that test failing because the function is broken or did it just not find anything?</p><p>I have actually come to like using real data. I’ve always thought that there’s something fishy about a process in which you create your own test data. There’s a time/place for it, but it often ends up just being an echo chamber. “I’ll put this thing here and what’s this! Lo’ and behold, I can get it back! Yay for me!” The concept of a double-blind experiment comes to mind. If you know what you want to get out of something in advance you’re (consciously or not) probably going to set things up to get that. So if you really want to trust your results and implications, you have to make sure the people doing the experiments don’t know what you’re going for (or better: they don’t even know what the experiment is about). For us in software, the database represents an unbiased entity where few if any assumptions are made about what we’re going to do with it or how things will get done. You might have to work harder both in testing and development, and deal with some frustration when you get surprising data returned to you, but at least when you DO get the data you’re looking for you know it’s not just an empty exercise.</p><p>2. <strong>You have to constantly advocate for quality.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n-Oic6sYI77_V0Wv0yPmxg.jpeg" /><figcaption>If you don’t bring up quality issues there’s a good chance no one will.</figcaption></figure><p>No one at the company wants endpoint downtime, erroneous data, performance delays, or bugs. Such problems can mean losing real dollars. (In our business there can be compliance/legal issues raised by faulty software.) But if you care, you really have to make sure quality is considered at every step and with enough rigor. Other people on your team have plenty on their hands. You have the quality football and are expected to run with it!</p><p>With this in mind, I think being a dev requires being fairly outspoken. The pressure to get defects fixed and get new features shipped is often very real. Ensuring quality represents slowing things down because it’s essentially saying “Ok, wait a second. I can see that this works in this circumstance — but how can we be sure it’s going to work across the platform for every kind of user in every location?”</p><p>Waiting until all the development work is done to be the one to break the bad news that it doesn’t work as expected is an antipattern. It will result in stories not being completed on time, and require developers to shift their context from new work they took up back to what they thought they already finished. Quality really must be included at the earliest moment in the software development cycle.</p><p>Something to think about: Let’s say you run a site that ranks baseball players using a multi-factor algorithm. Making an API call to obtain the latest rankings will give a list of players with some details, but will probably not return the data by which the players were ranked in the first place. So from an integration standpoint, how would you test that you’re getting the right results? The data you need to prove or disprove that the ranking function works isn’t there. At the very least your test is more difficult to write, but it might even be impossible to automate. It would have been better that quality was thought of from the very beginning, at the time when the decisions about what data the endpoint returns were made in the first place. A good developer would point this out get everyone on the same page from the start.</p><p>3. <strong>Newsflash: Things really do break!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*5RwCf2dLI0dY44bNW35-aQ.png" /></figure><p>We’ve had outages and high-priority defects break in and take over a sprint. It’s pretty stressful! We had one of our critical services down for several hours. These things happen to the best of organizations. If the software has a defect or straight up fails in production, and it was your job to write the integraion tests, <strong>there’s a good chance the bug is on you!</strong></p><p>Let me step back a bit and ask a question: in software <em>what is the purpose of a test</em>? The most common answer people will give you is “It’s to see if code does what it’s supposed to do.” But this is actually (and perhaps surprisingly) a poor answer. A much better purpose is <strong>to find problems in the code</strong>. Code might do what it’s supposed to do, but in so doing break something else. Perhaps the concept of “what it’s supposed to do” wasn’t very clear to begin with, or didn’t reflect long-term thinking. Especially for integration and end-to-end testing — it’s not just about does the thing do the thing, it’s also about whether that’s a thing that should be done at all and whether the system works as a whole with this new thing added.</p><p>If developers are doing their job, bugs or potential break points are known in advance. We’re not usually responsible for fixing them — but they shouldn’t be a surprise. And while it’s possible that an organization might play fast and lose with known issues, it’s not likely. People publish code to production because they think it works properly.</p><p>It’s not practical (or perhaps even possible) to detect all code problems in advance. But the organization is relying on developers to catch problems before customers do. So our testing has to be wide enough to catch issues before code goes live.</p><p>Test stability is also critical. Tests have to be stable enough so that when you do see a failure you know it’s really a problem with the code not merely a problem with the test. Tests that “cry wolf” will soon be ignored and as such they are no longer doing their job of protecting the software.</p><p>All this requires that you advocate not only for testing being considered in developer decisions but also for the time and resources needed to have a complete and well-organized testing suite.</p><p>4. <strong>Testing has in image problem</strong></p><p>At some organizations, integration testing is associated with QA work. Toward the end of the Turing program the curriculum pivoted somewhat away from strictly learning programming toward coaching students on getting our first developer jobs. As such we learned there are many paths a developer can take. You can focus strictly on back-end work or swing the other way to the front-end, or be “full stack” and do both. Or you could deviate from the pure developer title and do work in product or QA. I distinctly remember that, unlike the other path options, QA was portrayed with a bit of disdain. While not stated explicitly it seemed implied that being a developer was more creative and intellectually stimulating than being in QA. (I’ve talked with students since then and they confirmed that this is still the prevailing thinking.)</p><p>At the time I didn’t think much of it, but it came up again when I got on the job market and noticed some QA positions. In those early coffee meetings (SOOO many coffee meetings) I learned that some junior developers to enter the field via QA only to use it as a stepping stone. Some wouldn’t even consider applying for a QA position.</p><p>I actually told one of the QA people I had coffee with about the way QA was portrayed to me and he was well aware of it. He told me that it is a fairly common image, but I didn’t understand why it existed. From my standpoint testing code seems every bit as critical as writing it (in some respects, it might be more critical — bad code can do harm!). I was, though, able to figure out the reasons for the QA image problem.</p><p>QA as a field is in a period of transition. In the past most QA testing was done manually. People sat at a computer (or an iPad or phone!) and used the software from the user interface, trying to see if they could “break it” by producing errors or bugs. No one questioned the value of doing this. But in such a world QA people were not programmers. They didn’t know how to code and it wasn’t part of their job.</p><p>Things are (very) different now.</p><p>While there is still some manual testing going on (and some cases where there just is no substitute) most testing is automated. A QA automation developer codes tests that perform many iterations at a time. Tests don’t have to be in the same language as the programs they are testing — but in order to be automated they have to be coded. So as such many modern QA people are coders. But the image of a QA dev not having the coding chops of a “true” developer still exists.</p><p>At the same time, more and more developers are writing their own tests at every level. Strict QA roles are, it would seem, gradually going the way of the dodo by being squeezed on all sides. I don’t know for sure this is a good thing. Having someone who 100% specializes in breaking things can have a lot of value. But development work is expensive, and it’s hard enough to find developers as it is. Dividing up the roles seems too costly in both time and money, especially in an industry that thrives on a fast-moving SDLC.</p><p>Regardless of who is doing the work, the programming done in integration testing might not be as diverse or complicated as straight development, but it shouldn’t be underestimated. Our integration testing suite was written over several years. So it’s a brownfield project of its own, but is actually pretty slick. It uses numerous object types and helper modules, reads/writes JSON and YML, creates Docker containers and Rake tasks, connects tests results to external analysis tools. It is its own (sizeable) repo for which is employed a nearly-identical Git workflow as the dev team. It employs while loops, error/failure handling, regex, and just about every assertion type in the book. There have been several test-oriented Ruby gems created for integration testing that are used by the entire organization. This isn’t “Programming Lite”. Sometimes it’s much harder to test a new feature or fix than it is to write the functional code! So I’m not convinced the coding work in integration testing is simpler than any other development work. But the stigma remains.</p><p>But there’s a second reason for the testing image problem. A developer writes or revises code for a new feature or fix. Having the testing hat on means one’s mindset is not the same as the developer’s. The developer’s motivation is “Let’s get this done” or “I have to figure out how to fix this.” The testing mindset is more skeptical. It’s more like “OK — code has been written proposing to do X and thought to not break Y or Z. Prove it!” These two perspectives are rather at odds. Yes everyone is on the same team and ultimately want the same things, but the dynamics are that of opposing forces.</p><p>This opposition gets real when you write a test that really does show that something doesn’t work or that it broke something else. The deadlines for getting a story done are ticking. You can be seen as giving other devs more work. If a dev had a bad week or made a mistake, you’re the bearer of bad news.</p><p>There’s a reason why even in a Agile environment developers might not test their own code. It’s called <strong>confirmation bias</strong>: the tendency to notice and accept what we already believe (or want to believe) and discount or ignore that which contradicts us. Every human being has this tendency. Developers will naturally want to believe their code is good, especially after it passes unit testing. I’ve seen developers “fix” or even skip tests that were failing without taking the time to think about why the test failed and what we can learn from it. You really need someone else to take a fresh and independent look at the code, one without a motivation for it to pass tests and be promoted to production.</p><p>But all this means developers might think of integration testing, over which they may have less control than unit testing, as an annoyance or even a “necessary evil.”</p><p>If you do find yourself writing integration tests for code you haven’t written, you walk a fine line in this regard. Being a well-liked part of the culture while simultaneously (and frequently) sending other developers back to the drawing board is.., well, problematic! There are significant “soft” skills involved. Too aggressive? Others might naturally start avoiding having you write tests. Too easy-going? You’re tests will probably not be rigorous enough or you’ll cave to pressure. Neither is good for the software or process. Finding a balance is an art in itself.</p><p><strong>Closing Thoughts</strong></p><p>I love the testing part of development work and think integration testing is fascinating. If you have a questioning personality, and see things with a critical viewpoint with an eye for detail, you probably feel the same way. There’s a very real industry need for developers for whom testing is a strength, and a subsequent ton of potential for a feeling of reward at a job well done. Get testing right and you‘ll make everyone’s life easier and have a seriously positive impact on your users and the company’s image. For me a career doesn’t need much more than that!</p><p>References &amp; Further Reading</p><ul><li><a href="https://www.ministryoftesting.com/dojo/lessons/30-things-every-new-software-tester-should-learn">30 Things Every New Software Tester Should Learn</a></li><li><a href="https://www.psychologytoday.com/us/blog/science-choice/201504/what-is-confirmation-bias">What Is Confirmation Bias?</a></li><li><a href="https://www.testbytes.net/blog/software-testing-future-software-development/">9 Reasons Why Software Testing Has a Brighter Future Than Development</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f36ada579aef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adventures in Rails Fast JSON Serialization]]></title>
            <link>https://medium.com/@normanrs/adventures-in-rails-fast-json-serialization-90aa096f5e4a?source=rss-1a55f77c1996------2</link>
            <guid isPermaLink="false">https://medium.com/p/90aa096f5e4a</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[turing-school]]></category>
            <dc:creator><![CDATA[Norman Schultz]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 00:43:46 GMT</pubDate>
            <atom:updated>2018-12-03T00:43:46.559Z</atom:updated>
            <content:encoded><![CDATA[<p>In an ongoing series I like to call “Doing stuff as a Turing student” I’d like to discuss creating JSON output from an API. Wait, let me start from the beginning….</p><p>To begin let’s define some terms: an API is an Application Programming Interface. An API is essentially a database interface that operates over the Internet. Another way to look at it is a website for other computer programs. Computers don’t care about how things “look”. What color the screen is or that data is aligned in neat clickable boxes on the screen doesn’t matter at all. Computers just want the data they are looking for so they can do, well, whatever their user has told them to do. APIs exist all over the Internet allowing developers to access an enormous and ever-growing amount of data ready for manipulation. The term API is superbly Google-able — you can learn all you want and more from a simple search.</p><p>Now, I said that computers don’t care about how things look — that’s true technically, but there’s a corresponding problem. Data that’s accessible over the Internet is available for use, but how that data is <em>formatted </em>for the use of other computer programs is just as big a deal as how it looks is to us humans. Should matching data be presented as key: =&gt; :value, “key” — “value”, or any other numerous ways to represent it? Databases use IDs to uniquely identify records — should those be transmitted with the data or not, if so should they be transmitted first or last? All these are decisions that must be made by the API developer.</p><p>This leads to the “bikeshedding” problem. “Bikeshedding” is a developer term that means “the act of wasting time on trivial details while important matters are inadequately attended.” What format API data is presented in is not as important as the data itself. It is important, though. As of 2017 there are over 17,000 public APIs(1). Imagine if all of them presented data in a unique format! There would be thousands upon thousands of wasted person-hours — preventable by there being a solid standard for presenting API data.</p><p>Attempts to standardize APIs have been slow to roll out. In fact, before 2000 there were no real standards for how to either design or use an API at all(2). Since there there have been various efforts, including the implementation of JSON being the standard format for API-transmitted data. Only as resent as 2015 has there been a coherent attempt to standardize the JSON data APIs transmit(3). From my perspective as a new programmer the conclusion is: this is a very good time to start getting into API programming both on the “producer” and “consumer” side.</p><p>Before we get too far, let’s define another term: serialization. Serialization in Rails programming is a reference to formatting the JSON output of an API so that each record is unique and carries with it the desired data. There have been a few attempts at standardizing Rails JSON output, with corresponding Ruby gems to do the job. The most common were called “Active Model” serializers. But interestingly, most of them have fallen out of favor (and subsequently have seen their development dry up). The main reason was speed. The speed toll they took transforming the raw data into formatted JSON was too costly. So, in came Netflix…</p><p>The Netflix JSON serializer is simply called “Fast JSON API.” It presents data in accordance with the new JSON 1.0 standard. But it’s also, well, FAST. According to its own GitHub post “serialization time is at least 25 times faster than Active Model serializers on up to current benchmarks of 1000 records.”(4) We’re not sure if that’s entirely true (I personally suspect it to be somewhat Pyrrhic in a victory — their tests were probably setup to see them succeed brilliantly) but it’s probably faster than anything else out there. Turing has decided to start using it, probably because they can see the “writing on the wall” that it’s going to take over.</p><p>Using the serializer isn’t hard at all. It really involves just three things: installing/including the gem, creating a serializer, then calling that serializer in the appropriate controller action. You even get access to automatic generation of serializers via “rails generate” commands. It’s all pretty solid, actually! To get going just go to <a href="https://github.com/Netflix/fast_jsonapi">https://github.com/Netflix/fast_jsonapi</a> and follow the very simple instructions.</p><p>A world of caution: the Netflix serializer is opinionated. It requires an :id to work, under the assumption that you are in the business of transmitting records and records have associated IDs. This can get in the way a bit if you end up trying to present raw data, for example simply a date or dollar amount. One of our tasks in fact was to sum a total amount of money made on a given day which would not have any particular ID associated with it — the data was aggregated from a series of transactions and the costs of numerous items. The “normal” route to get this data into the serializer would be to create a plain old Ruby object (PORO) and tack on the new data, requiring creating a new model class and associated tests. All that seemed like a lot of hassle every time you just want to spit out some data. In trying to avoid all that I discovered a cool trick: the use of Ruby OpenStruct (5).</p><p>In Ruby, an OpenStruct is essentially an object created on-the-fly with whatever attributes you want. Use “OpenStruct.new” and assign it attributes almost the same way you would a hash and viola — you have an object with those attributes. This comes in REALLY handy when using the Netflix serializer since it requires an ID. The strategy is this: if you want to present custom data that the relevant object doesn’t have, or data that doesn’t really associate with a database object to begin with, use an OpenStruct to create a temporary object to present to the Netflix serializer. You can use it to pass any data you want, and it will be automatically formatted to the JSON 1.0 standard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1p-ZPd19zYfFbwv-B9gPg.png" /><figcaption>OpenStruct example in an API</figcaption></figure><p>In this case I’m using a new data point (revenue) so I needed to create a custom serializer, but in other instances you can just use a serializer you already have. Overall I’ve found use of the OpenStruct function really flexible and useful. I may learn other (perhaps better) ways of presenting object data to the serializer, but I’m glad to have this option available. And besides all that, it’s oddly fun to create a fake object! (I might have been coding for too long tonight.)</p><p>I’m looking forward to seeing what else I can do with APIs, so expect more posts soon….</p><p>(1) <a href="https://www.programmableweb.com/news/programmableweb-api-directory-eclipses-17000-api-economy-continues-surge/research/2017/03/13">https://www.programmableweb.com/news/programmableweb-api-directory-eclipses-17000-api-economy-continues-surge/research/2017/03/13</a></p><p>(2) <a href="https://www.mobapi.com/history-of-rest-apis/">https://www.mobapi.com/history-of-rest-apis/</a></p><p>(3) <a href="https://jsonapi.org/about/">https://jsonapi.org/about/</a></p><p>(4) <a href="https://github.com/Netflix/fast_jsonapi">https://github.com/Netflix/fast_jsonapi</a></p><p>(5) <a href="https://ruby-doc.org/stdlib-2.4.1/libdoc/ostruct/rdoc/OpenStruct.html">https://ruby-doc.org/stdlib-2.4.1/libdoc/ostruct/rdoc/OpenStruct.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90aa096f5e4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Observations on Atom Customization]]></title>
            <link>https://medium.com/@normanrs/observations-on-atom-customization-e033826d2c67?source=rss-1a55f77c1996------2</link>
            <guid isPermaLink="false">https://medium.com/p/e033826d2c67</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[atom]]></category>
            <category><![CDATA[shortcuts]]></category>
            <category><![CDATA[snippet]]></category>
            <dc:creator><![CDATA[Norman Schultz]]></dc:creator>
            <pubDate>Wed, 07 Nov 2018 22:21:46 GMT</pubDate>
            <atom:updated>2018-11-07T22:21:46.283Z</atom:updated>
            <content:encoded><![CDATA[<p>Preface: So this is my first article here on Medium! I’m going to have a lot to say at some point. Learning programming at this point in my life, with so many experiences under my belts — well, let’s just say it gives me a perspective. Thanks in advance for reading!</p><p>This article is about customizing the Atom environment. I’ll discuss the specifics of how to do it as well as reasons for doing it in the first place — the how and why.</p><p><strong>On Customizing a Software Environment</strong></p><p>Some undisclosed number of years ago I was a drafter/designer. Though later in my career I used 3D modeling software like SolidWorks and Pro-Engineer, the main tool I used was AutoCAD. I was pretty good at my job, I think. I was able to work on some amazing projects at good companies, and was often a go-to guy helping new drafters and engineers who weren’t familiar with the software.</p><p>I certainly wasn’t perfect, but my managers would often commend me on the speed at which I could draw, create objects, and place dimensions in AutoCAD. I was proud of the fact that when looking over my shoulder people would have to catch up to figure out what I was doing. I’d sometimes get comments like “How did you do that so fast?” and “Wait…. you can do that?”. I remember one of my bosses seeing me create an array of objects that were already spaced by a needed dimension, using them as essentially construction lines to make new markers, then deleting them, all in a matter of a few seconds — his reaction was “Ahhh man, that’s cheating!” (said with a pleased grin).</p><p>The main reason I was fast was because I made extensive use of Autocad’s ability to create customizable shortcuts through what they call “lisp routines” after their scripting language Lisp. These are very simple lines of intuitive code that make shortcuts — type in the identifying letters and the rest happens. Here’s an example of what they look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*1bvV36OD95itQq-Uu_kulQ.png" /><figcaption>A few basic examples of AutCAD Lisp routines</figcaption></figure><p>As you can imagine, you use the mouse constantly when using a drawing program. So (unlike these examples) I wrote 15 or so shortcuts that took advantage of my left hand staying on the keyboard. Point-and-click with my right hand on the mouse and quickly enter related commands with my left.</p><p>Setting up my work environment provided several benefits. Raw speed is a good thing (especially if you have to rush to get something changed — I remember last-minute changes that people were waiting on, in a few cases literally holding up someone in the machine shop or a welder in the field!). But another underrated benefit is fluidity. You can get into a real rhythm while working when the software starts to “get out of your way” and just do what you want it to do. You find it’s much easier to get “in the zone” and are spending more of your time thinking about what you’re trying to accomplish than how to get the software to do what you’re thinking of. And, for me at least, it made work more fun! I just got a kick out of sitting down and being able to crank out lines and objects and quickly build stuff.</p><p><strong>The Atom Environment: Snippets and Keybindings</strong></p><p>So now I’m learning software development at Turing and am using Atom daily (for many many hours a day, in fact!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*g_MUQtz83GGDC1Q2dKSwTA.png" /></figure><p>When I first started I noticed some similarities between AutoCAD and Atom. Atom provides quite a few handy built-in shortcuts, and numerous other speed-enhancing measures (such as smart bulk copying and moving of code, a quick finder that almost entirely eliminates hunting for files, and many more). It also give you access to user-created packages that further increase speed and accuracy, such as ones that give instant feedback on missing ends or other syntax issues and adding easily-recognizable icons giving filetype feedback.</p><p>But Atom is also highly customizable and encourages users to make the environment their own. The main way this is done is by two means of shortcut-making: snippets and keybindings.</p><p><strong>Atom Snippets</strong></p><p>Snippets are short blocks of code that will perform commands when you select them. If you have autocomplete set to tab only (HIGHLY recommended!) you select a snippet by typing in a few letters (or one) and hitting tab for what comes up. The best way to do this is to type until the snippet you want has been isolated to the top of the list, allowing you to select it without using the down arrow. Here’s what the snippet popup looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBcOY03tip6QUx4aPuDQnA.png" /><figcaption>Example Snippet options trigged on typing an “r’</figcaption></figure><p>Atom comes with a decent number of built-in snippets. You can find these by getting into the command palette (cmd + shift + p) and entering “snippets: available”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCMSdT5zS-U2_EdF64PYNA.png" /><figcaption>The command palette</figcaption></figure><p>Getting to know these built-in snippets is obviously handy. But in my view the real boost comes from creating your own snippets. And doing so is really quite easy. (I invite you to open Atom and try it. Just do it!)</p><p><strong>Create Your First Snippet</strong></p><p>In the Atom pull-down menu select “snippets”. This will open a CoffeeScript file where you can enter snippet code. Odds are good that you’ve already done some coding (why else would you be reading this article?) so what you see shouldn’t overwhelm you. The coding demands are minimal. You don’t have to actually know how to code in CoffeeScript to create snippets for two reasons. The first: the file gives you essentially a “quick start” guide in the comments, pointing you to Atom’s online manual for greater details. The second: Atom comes with a snippet-making-snippet triggered by typing “snip”….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*s2OhiFiy0cK9Cvl4WJSdDw.png" /><figcaption>The Snippet template snippet “snip” — say that 10 times fast….</figcaption></figure><p>The four parts of a snippet from top to bottom are: <em>the language identifier, the snippet name, prefix, and body.</em></p><p>The <em>language identifier</em> is meant to be a heading for a group of snippets that work for a specific programming language. The example above from the “snip” snippet is for JavaScript — meaning that the snippets in this grouping will only be available when you’re working on a JavaScript file.</p><p>The snippet <em>name</em> is just for us silly humans. The prefix and body are where the actual work is done.</p><p>The <em>prefix</em> is the combination of keys that will trigger the popup that allows you to select the snippet. Choose this carefully. You’re going to want to using a unique but short letter combination. If you choose one that already exists yours will come up in its place — fine if the one you essentially overwrote is not useful but there might come a time when you want it. If your prefix is unique but very similar to an existing snippet it might not come up at the top of the popup menu. Hitting tab won’t get you what you want, and nothing can ruin your workflow more than spitting out a block of code that makes you mentally and “physically” backtrack to delete it.</p><p>The <em>body</em> of the snippet is the output of the shortcut — what will appear in your code. Obviously this should be tested for accuracy and syntax. But more than just spitting out a handy block of code, CoffeeScript gives you access to a few clever tricks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAY0EKklVjipIy-BdIos3g.png" /><figcaption>My Ruby Snippets</figcaption></figure><p>From my code above the ‘pry’ snippet is very simple but extremely handy. I never have to remember to require pry — whenever I need it it’s four keystrokes away.</p><p>In my ‘en’, ‘dfi’, and ‘arr’ snippets you’ll see \t and \n. These are escape codes that result in tabs or new lines being output.</p><p>In my ‘en’ snippet you find a $1. This moves the cursor back to this location on completion of the snippet. (This is one of my favorite snippets because it means I can quickly add an end and will end up with the cursor exactly where I need it — all in three keystrokes.)</p><p><strong>There’s a Snippet For That</strong></p><p>I recommend creating a snippet when you find you’re typing something fairly long over and over again, or when you have to repeatedly enter something that’s counter-intuitive or has very persnickety syntax. But fun is also a totally respectable reason! I think you’ll just get a kick out of writing these and using them (especially when someone is watching you code).</p><p>Trick out your system. You’ll get out of your own way and enjoy coding just a little bit more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e033826d2c67" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>