<?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 Jason Lowenthal on Medium]]></title>
        <description><![CDATA[Stories by Jason Lowenthal on Medium]]></description>
        <link>https://medium.com/@lowenthal_jason?source=rss-c8c2da768183------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EvDq3JFJxTTtjJVVv-tzEg.jpeg</url>
            <title>Stories by Jason Lowenthal on Medium</title>
            <link>https://medium.com/@lowenthal_jason?source=rss-c8c2da768183------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:12:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lowenthal_jason/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[Brain Olympics]]></title>
            <link>https://medium.com/@lowenthal_jason/brain-olympics-352b452fb5a4?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/352b452fb5a4</guid>
            <category><![CDATA[competition]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[olympics]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Wed, 14 Feb 2018 01:01:01 GMT</pubDate>
            <atom:updated>2018-02-14T01:01:01.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*zsAaK15YmC8a7JfPaWdPnQ.jpeg" /></figure><p>Competition is an interesting thing. In athletic events like the ones many of us watch during the Winter Olympic broadcasts, it’s all about humans exhibiting years of hard training and peak physical performances.</p><p>And it’s all <em>extremely</em> judgmental (at least in US broadcasts). The language used by the Olympic commentators in the US when Olympians make mistakes certainly isn’t the language of positive feedback and reinforcement culture.</p><p>It’s no wonder that athletes going to the Olympics can often be heard using self-deprecating language and talking about themselves as if they’re not good enough yet. If everyone around you constantly uses language that tells you that you don’t measure up — it’s going to stick in your brain.</p><p>Don’t get me wrong, I think to some degree that’s what it takes to be an Olympian — an uncommon drive to always get better, be better, and break the physical boundaries of the human existence.</p><p>But I wonder if the mental health of the Olympians needs to be part of the discussion too. Competition can be healthy. And it can also be destructive.</p><p>Imagine for a minute if you went to a High School swim meet and in one lane you saw Michael Phelps. I imagine most of the swimmers wouldn’t even get into the pool at that point (though, admittedly, I don’t know how competitive swimmers think). At some point, the competition goes from constructive to destructive when you push people too hard for too long.</p><p>This got me to thinking about how I handle my own brain and my own work. It’s important as developers not to compare ourselves to “rock star” developers in our field, whoever we think those rock stars are.</p><p>What’s more important is that we compare ourselves to… ourselves. I think it’s extremely important to strive for continuous improvement in all things.</p><p>But if you’re a college student starting a computer science curriculum for the first time, or a coding boot-camp initiate, it’s going to be pretty demoralizing if you compare your work to that of someone who’s been working in the industry for 20 years. It could even be demoralizing to compare your work to someone else starting out with you.</p><p>Everyone works differently, everyone learns differently, and everyone has a different way of contributing to software than the other people around them.</p><p>I think it’s important to remember that software development as a career is not, in any stretch of the imagination, a competition. It’s not a race.</p><p>I’m learning something new right now at work, and it’s taking me a pretty significant amount of time to actually feel like I’m becoming a capable “production code” contributor on the team.</p><p>But I’m still contributing to the team while I’m learning, and my company has always heavily invested in ensuring that people learning to do what needs to be done are given the time to learn to do it well. It’s not about being as good as someone else right away. It’s about the journey into learning to do the job with high quality and with positive outcomes.</p><p>I think it’s important to remember this for myself, and for other people too. Right now if I were to compete in an event against the people I’m learning from (if such a competition existed) they would absolutely destroy me in terms of literal productive code output right now.</p><p>But software (and really, life) is about so much more than the hard outputs that we are capable of producing. It’s about learning, it’s about shared experiences, and it’s about making sure we’re doing the right things at the right time.</p><p>And that has nothing to do with hard skills — which we can all learn given the right amount of time.</p><p>Don’t get me wrong, a little bit of healthy friendly competition can spurn us into wanting to learn a little more, or dig a little deeper to figure out the hard problems.</p><p>Let’s just make sure that if we do compete with each other as developers, it’s always healthy and it’s always encouraging.</p><p>After all, if we’re going to promote the developer lifestyle as something we all love and can’t wait to share with everyone around us, it’s important the relationships we have with other people aren’t toxic and destructive.</p><p>And if you ever run into someone who makes you feel like you’re not good enough, or learning enough, or can’t hack it as a developer — turn around and run the other way. Because that’s toxic and something you don’t need in your life.</p><p>And it’s something we need to stop promoting as a good way to behave in the development industry.</p><p>“But, he’s a fantastic coder” should not be an excuse for “He’s a major jackass and always telling me I’m not doing good enough work” (I worked with a guy like this once, it was awful — even though it wasn’t me he was targeting with his malice).</p><p>If we stop putting up with bullying in software, we can all start writing better software.</p><p>That’s where our Gold Medals are. So let’s go!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=352b452fb5a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Winter Blues]]></title>
            <link>https://medium.com/@lowenthal_jason/the-winter-blues-66cecec75e6?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/66cecec75e6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[winter]]></category>
            <category><![CDATA[mental-health]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Wed, 07 Feb 2018 01:01:01 GMT</pubDate>
            <atom:updated>2018-02-07T01:01:01.011Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*M5gLURxWTwO6M_Fls9zrSg.jpeg" /><figcaption>The Winter Blues (B.B. King as Drawn by Jason Lowenthal)</figcaption></figure><p>As I sit here staring out my window at the snow blanketing the ground, I’m thinking about how beautiful winter can be when framed properly. Fresh white snow makes everything so serene and peaceful, it’s hard to imagine something more pristine.</p><p>Then we have to drive to work. The roads turn to slush. The beautiful snow becomes quickly tarnished and torn by snowplows and people in a hurry to get here or there and live their daily lives.</p><p>For people like me that have a mental health concern, winter is more like the salt-covered and hard to drive roads than it is the beautiful and pristine scene that happens after snow first falls.</p><p>Winter-time brings with it more clouds, less working daylight hours, and altogether makes it way easier to just feel yucky.</p><p>There’s a reason for this, it’s directly related to direct exposure to sunlight. It’s not just a matter of Vitamin D either. For those of us prone to depression, winter time throws off our circadian rhythms and also makes it so that the happy chemicals in our brains don’t get produced as much.</p><p>I’ve got an idea in mind for the code my brain likes to execute during the winter time, and it’s also not giving me much of an opportunity to throw an interrupt in there and execute something other than “I’m tired”. You’ll have to forgive the pseudocode, I don’t imagine this would compile in any real language — but hopefully you get the idea.</p><pre>while(DateTime.Now() &gt;= WINTER_SOLSTICE &amp;&amp; DateTime.Now() &lt; VERNAL_EQUINOX)){ <br>    Thread.Sleep();<br>}</pre><p>Obviously, it’s not at all practical to sleep from December until March, unless you’re a grizzly bear. And I’m not. But sometimes my family tells me my attitude makes them think I am when the winter months are around.</p><p>Because it’s hard to be motivated, focused, and altogether generally happy and productive in the winter time it can lead me to being a bit grumpy.</p><p>In order to combat this, I do the best I can to go outside several times a day (even when it’s excessively cold) and get on my treadmill as often as my schedule allows for it. Physical exercise helps my brain counter-act the lack of natural sunlight I get every day. Endorphins help make up for the lower brain-chemical production of other kinds we get.</p><p>January is particularly tough for me most of the time. The bright lights and happy times surrounding the holidays have passed. And, most of the time winter illnesses kick in starting in January.</p><p>So, I have to find other ways to keep January from kicking my ass. This year, I got the awesome blessing of being invited to participate in the Developer on Fire remote panel.</p><p>Other years I’ve used journaling and blogging to keep my brain engaged.</p><p>And sometimes I’ve just had the winter blues. And that’s OK too — as long as I’m aware of what’s going on and take steps to mitigate it as much as possible.</p><p>It’s OK to give yourself permission to just feel “blah” sometimes.</p><p>Then, get up, dust off, and tackle the next day. When you’re ready.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66cecec75e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mental Health for Developers]]></title>
            <link>https://medium.com/@lowenthal_jason/mental-health-for-developers-6ca70594bc17?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ca70594bc17</guid>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Wed, 31 Jan 2018 02:44:11 GMT</pubDate>
            <atom:updated>2018-01-31T03:43:44.086Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently had the fantastic opportunity to talk with Heather Downing and Arthur Doler in a remote panel about mental health as it relates to how we develop software.</p><p>That conversation got me to thinking about the fact that I don’t see a whole bunch of blog articles or links in the software development community specifically related to mental health. I think there’s all kinds of interesting materials out there for technical research, but I don’t see a ton of stuff come across my radar that’s about the most advanced (and buggy) computer of them all — our brains!</p><p>I’m thinking I’m going to start writing about debugging my own brain more. It’s definitely been an interesting (and often scary) challenge to get my brain to do the things that I want it to do every day. Even writing this blog article has probably been long overdue, because I took a long hiatus from blogging to figure out what it is I want to do going forward with the limited moments of free time that I get here and there.</p><p>Talking on the panel with Heather and Art helped me realize I have something kind of different to offer to the community. A perspective, of sorts, that not many people share in public for all kinds of good reasons. When you’re dealing with a mental health challenge of any kind, often the last thing that comes to mind is blurting out to the world what it is my brain does differently than other people.</p><p>So, long story short — I think I’m going to focus on different things I’ve been doing over the last several years related to my mental health. Some worked for a while and stopped. Some continue to work. And some failed miserably. I think that’s probably a more important topic for me personally than anything technical I can come up with to write about.</p><p>And, every once in a while I promise to try to weave in a cheesy, terribly pseudo-coded pun about the things my brain does (or did) when I attempted to make a change.</p><p>I’m thinking I’ll call all of this writing “Hacking Mental Health”. Hopefully I won’t bore anyone too terribly along this ride, but even if the only consumer of this is the person writing it, I want to get it out there. Because my mental health journey as a software developer (and human being) is one I hope to keep sharing for a long, long time.</p><p>Thanks for reading. It means a lot to me that you’re willing to share my journey with me, even as I’m only starting to share my journey with everyone now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ca70594bc17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Moved (Copied) Some Content]]></title>
            <link>https://medium.com/@lowenthal_jason/i-moved-copied-some-content-c6c54cc0d553?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6c54cc0d553</guid>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Fri, 30 Sep 2016 01:51:02 GMT</pubDate>
            <atom:updated>2016-09-30T01:51:02.588Z</atom:updated>
            <content:encoded><![CDATA[<p>I had a branded website I hosted on blogger.com for a year. It got a little bit of traffic, but it was hardly anything to speak of in terms of the kinds of volume and connections I’m seeing now that I’m a regular contributer at <a href="http://www.simpleprogrammer.com/">http://www.simpleprogrammer.com</a></p><p>I chose to do this to centralize my content so that it’s easier for me to get people to find it. Instead of jumping all over the internet to find me, I’d like to make it obvious where to look.</p><p>I’ve come to really enjoy the collaborative sharing environment Medium provides, as well as the no-nonsense look and feel of the writing platform. So that’s why I chose to stick with it instead of a custom-spun place, for now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6c54cc0d553" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Programming Languages For President]]></title>
            <link>https://medium.com/@lowenthal_jason/programming-languages-for-president-847279f03f70?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/847279f03f70</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[2016-election]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Sat, 24 Sep 2016 02:38:35 GMT</pubDate>
            <atom:updated>2016-09-26T04:38:12.773Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>There are only two kinds of languages: the ones people complain about and the ones nobody uses. — Bjarne Stroustrup</blockquote><p>If programming languages had to come up with slogans for the presidential campaign:</p><h4>Assembly</h4><p>You won’t understand anything I get done. But I’ll get it done faster than anyone else ever did!</p><h4>BASIC</h4><p>Though it won’t be clear how I get there, I’ll GOTO the end with you. Or the beginning. Or maybe even the middle.</p><h4>C</h4><p>Elect me for President of the entire universe! I’m the only one powerful enough to handle it.</p><h4>C++</h4><p>Whether you elect me or my opponents, you still elected one of my clones anyway. I don’t think I have to point that out.</p><h4>C#</h4><p>I’m just like Java, except I’m way better for enterprises!</p><h4>CSS</h4><p>Everyone check out my Jazz Hands™!</p><h4>Fortran</h4><p>I won’t make any mistakes as president. Even if I do, I have no way of recovering from them. So I better not.</p><h4>Groovy</h4><p>I’m Java’s younger brother. And I don’t care what your type is. We can still hang out together any time.</p><h4>Java</h4><p>You’ll elect me an my running mate, politician.electable.vicepresident</p><h4>JavaScript</h4><p>This will be the best presidency ever. Just as soon as I figure out what the definition of “this” is.</p><h4>Lisp</h4><p>I’m the best candidate for the job because I’m the best candidate for the job because I’m the best candidate for the job because I’m the best candidate for the job because I’m the best candidate for the job because I’m the best candidate for the job because …</p><h4>Objective-C</h4><p>I’ll treat this presidincy with objectivity it deserves. Nevermind the fact that my ideas are outdated. I’m Objective!</p><h4>PHP</h4><p>This slogan is entirely unoriginal and comprised entirely of slogans from every other campaign ever.</p><h4>Python</h4><p>Changing America. But I can only do it one instruction at a time. My friend GIL says that’s the best way.</p><h4>Ruby</h4><p>Swift and Groovy are just cheap imitations of the real thing. I’m the most original dynamic one there is!</p><h4>Rust</h4><p>I’m already the <a href="https://stackoverflow.com/research/developer-survey-2016">most popular programming language</a> there is, so why not take it all the way? I’m also the safest vote. What more could you ask for?</p><h4>Scala</h4><p>Numbers and facts don’t lie. If you want a presidency run by data, elect me.</p><h4>Swift</h4><p>I’m Objective-C’s younger brother. And I don’t care what your type is. We can still hang out together any time. And I’m way cooler than Groovy.</p><h4>SQL</h4><p>SELECT me for president. JOIN the revolution.</p><h4>Visual Basic</h4><p>I’m unqualified for the job, but that doesn’t matter. I look <em>fantastic</em> doing it!</p><h4><a href="https://github.com/hostilefork/whitespacers/">Whitespace</a></h4><h4><a href="http://www.dangermouse.net/esoteric/zombie.html">Zombie</a></h4><p>Braiiiinsssssss…..</p><h4>Git</h4><p>I’m not a programming language. That’s going to make me the best president ever. Programmers love me. You can’t imagine how great of a president I’ll be. Elect me because I’m not a programming language.</p><p>Commit to it.</p><ol><li>Thanks to <a href="https://medium.com/u/ec39004dd57f">Anthony Shaw</a> for helping me come up with a good one for Python</li><li>Inspired by something that makes me laugh hard no matter how many times I read it: http<a href="http://www.thealmightyguru.com/Humor/Docs/ShootYourselfInTheFoot.html">://www.thealmightyguru.com/Humor/Docs/ShootYourselfInTheFoot.html</a>.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847279f03f70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Key/ Value Pairs]]></title>
            <link>https://medium.com/@lowenthal_jason/key-value-pairs-bafb734cf33c?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/bafb734cf33c</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Thu, 18 Feb 2016 17:00:25 GMT</pubDate>
            <atom:updated>2016-09-01T02:46:25.007Z</atom:updated>
            <content:encoded><![CDATA[<p>At the root of all JSON you’ll find structures of Key/Value pairs. There’s more than one valid way to represent data this way, but I’m of the quite strong stance that one way is much stronger as an API data set than the other. I want to take a minute to compare two identical data sets, one that I’ll call “Please give me brain bleach” and the other “Phew”</p><h4>Please Give Me Brain Bleach</h4><pre>{<br>    &quot;heres_my_data&quot;: [<br>        {<br>            &quot;1&quot;: {<br>                &quot;has_more_data&quot;: &quot;true&quot;,<br>                &quot;more_data&quot;: [<br>                    10,<br>                    11,<br>                    12,<br>                    13<br>                ]<br>            }<br>        },<br>        {<br>            &quot;2&quot;: {<br>                &quot;has_more_data&quot;: &quot;false&quot;<br>            }<br>        },<br>        {<br>            &quot;3&quot;: {<br>                &quot;has_more_data&quot;: &quot;false&quot;<br>            }<br>        },<br>        {<br>            &quot;4&quot;: {<br>                &quot;has_more_data&quot;: &quot;true&quot;,<br>                &quot;more_data&quot;: [<br>                    20,<br>                    21,<br>                    22,<br>                    23<br>                ]<br>            }<br>        }<br>    ]<br>}</pre><p>Now, if you take this JSON and go over to <a href="http://pro.jsonlint.com/">http://pro.jsonlint.com/</a> it’s not going to have a problem with it. This JSON is completely valid and will work just fine as a response body or as a POST body. But, from my perspective, it’s useless (or darn close to it). Here’s why — the top level “keys” aren’t actually key’s at all. They’re IDs that belong to a field of some kind that’s being obscured away in this JSON object — and that takes away important information for rendering and consumption. Not to mention that numeric ID fields are now rendering as string keys, stripping away even more of the value of what’s presented to the consumer.</p><p>Yes — a good programmer working as a consumer will know what to do with this still. Probably. But the data hides a good part of its story by representing itself this way.</p><h4>Phew</h4><pre>{<br>    &quot;heres_my_data&quot;: [<br>        {<br>            &quot;top_level_instance_id&quot;: 1,<br>            &quot;has_more_data&quot;: &quot;true&quot;,<br>            &quot;more_data&quot;: [<br>                10,<br>                11,<br>                12,<br>                13<br>            ]<br>        },<br>        {<br>            &quot;top_level_instance_id&quot;: 2,<br>            &quot;has_more_data&quot;: &quot;false&quot;<br>        },<br>        {<br>            &quot;top_level_instance_id&quot;: 3,<br>            &quot;has_more_data&quot;: &quot;false&quot;<br>        },<br>        {<br>            &quot;top_level_instance_id&quot;: 4,<br>            &quot;has_more_data&quot;: &quot;true&quot;,<br>            &quot;more_data&quot;: [<br>                20,<br>                21,<br>                22,<br>                23<br>            ]<br>        }<br>    ]<br>}</pre><p>When you actually apply fields to all of the data in the object graph the JSON is building, you end up with a much more human-readable JSON structure. This mechanism also has a much easier time being fitted into the JSON API standard than the other way does.</p><p>This also leads me to another post. Instance data vs. metadata. When you build a JSON document, you’re combining document types and metadata about data with the instances of the data itself.</p><p>There’s nothing in JSON that defines the data contract itself, which makes it a lighter weight solution for passing around data via HTTP. Sure, the API server can run all kinds of server side validations on POSTed JSON — but there’s absolutely nothing preventing HTTP from passing completely malformed JSON to the server to begin with.</p><p>The best APIs I’ve seen make it really easy to get example POST objects and really easy to build an example GET call. <a href="https://developers.facebook.com/tools/explorer/145634995501895/">Facebook even has a tool to experiment with their API calls</a>. (I put a sample of a response from it below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/0*Tn9HM_NGCU8gon4-." /></figure><p>The most important thing to remember about well structured JSON is that the “key” part of the JSON should <em>always </em>be metadata, and the “value” part of the JSON should <em>never</em> be Metadata.</p><p>If you follow that simple rule, your JSON will end up easier to read. And we all want that, I think.</p><p><em>Originally published on my defunct Wordpress site on February 18, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bafb734cf33c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Complex Table Data]]></title>
            <link>https://medium.com/@lowenthal_jason/complex-table-data-c69f26da0119?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/c69f26da0119</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Thu, 11 Feb 2016 17:00:34 GMT</pubDate>
            <atom:updated>2016-09-01T02:45:58.086Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently my team and I have been looking at ways to represent really large object graphs in such a way that the consumers of our services can render parts of the data as data tables. After all, a big part of what our company does is big data analytics — so it only makes sense that we’d report some of this calculated results set as a table of data.</p><p>Here’s the fun part, though. We can’t always assume that our consumer is going to represent and render the data the same way as it’s being represented and rendered right this second. Yes, we’re well aware that our current (and only) client platform is a SPA written in AngularJS, so we need the data to be easily rendered in some kind of formatted HTML.</p><p>But, we’re also well aware that we’re going to be breaking into mobile computing at some point. And the way we represent the same data on a tablet or smartphone will have to look dramatically different than the way we represent it on a computer screen in a browser.</p><p>At a fundamental level, key/value naming is a big part of the problem again. Theoretically, you should be able to just convert the deep object graph into key value pairs to render on the clients consuming the data. The reality is, sometimes the rendering makes the problem more complex than that and causes us to have massive confusion about how the whole thing should work.</p><p>Maybe it’s just a matter of making sure that the objects you’re serializing are properly nesting other objects and collections beneath them. I haven’t actually taken the time yet to look at our object graph to decide if it makes more sense to build up some kind of translation object (or DTO) to represent the data we’re after.</p><p>Right now we’re just turning our data into a key/value representation to send as a response, without actually applying any actual object state into the serializer.</p><p>Regardless, whether you’re just rendering a key/value map directly or creating some kind of container object for the response. Please, please…. PLEASE… do not do this:</p><pre>{<br>    &quot;table&quot;: [<br>        {<br>            &quot;header_row&quot;: [<br>                {<br>                    &quot;header_column&quot;: {}<br>                }<br>            ],<br>            &quot;row&quot;: [<br>                {<br>                    &quot;column&quot;: {}<br>                }<br>            ]<br>        }<br>    ]<br>}</pre><p>We’re not rendering HTML and telling the consumers of our data how to make a table. Even if you are absolutely certain that the team designing the UX is going to plug this into a table representation on an HTML page — it’s not really a good idea to assume that the first consumer of the data will be the only consumer of your data.</p><p>If we had originally started our APIs to follow the pattern of <a href="http://jsonapi.org/">http://jsonapi.org/</a> then this discussion wouldn’t have even really had to happen I don’t think. It clearly outlines the way top level objects and collections within those objects are supposed to be represented in a JSON API heirarchy. I’m not going to spend a significant amount of depth going into how we could have, would have, should have. Instead I’m going to look at what our JSON ended up looking like (more or less). It’s hardly following any kind of JSON API standard, but it’s definitely way better than before. Like you see above. &lt;Cough&gt;.</p><pre>{<br>    &quot;section_name&quot;: &quot;Awesome Report Section&quot;,<br>    &quot;top_level_section_specific_data&quot;: [<br>        {<br>            &quot;top_level_object_id&quot;: 1,<br>            &quot;second_level_section_specific_data&quot;: [<br>                {<br>                    &quot;second_level_object_id&quot;: 1,<br>                    &quot;second_level_object_name&quot;: &quot;Thing 1&quot;,<br>                    &quot;third_level_section_specific_data&quot;: [<br>                        {<br>                            &quot;section_title_text&quot;: &quot;Knock Your Socks Off!&quot;,<br>                            &quot;count&quot;: 200<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;More Socks Are Knocking!&quot;,<br>                            &quot;count&quot;: 190,<br>                            &quot;percent&quot;: 95<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Look! They&#39;re Sockless&quot;,<br>                            &quot;count&quot;: 180,<br>                            &quot;percent&quot;: 90<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Seriously, No Socks here!&quot;,<br>                            &quot;count&quot;: 160,<br>                            &quot;percent&quot;: 80<br>                        }<br>                    ]<br>                },<br>                {<br>                    &quot;second_level_object_id&quot;: 2,<br>                    &quot;second_level_object_name&quot;: &quot;Thing2&quot;,<br>                    &quot;third_level_section_specific_data&quot;: [<br>                        {<br>                            &quot;section_title_text&quot;: &quot;Knock Your Socks Off!&quot;,<br>                            &quot;count&quot;: 200<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;More Socks Are Knocking!&quot;,<br>                            &quot;count&quot;: 190,<br>                            &quot;percent&quot;: 95<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Look! They&#39;re mSockless&quot;,<br>                            &quot;count&quot;: 180,<br>                            &quot;percent&quot;: 90<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Seriously, No Socks here!&quot;,<br>                            &quot;count&quot;: 160,<br>                            &quot;percent&quot;: 80<br>                        }<br>                    ]<br>                }<br>            ]<br>        },<br>        {<br>            &quot;top_level_object_id&quot;: 2,<br>            &quot;second_level_section_specific_data&quot;: [<br>                {<br>                    &quot;second_level_object_id&quot;: 1,<br>                    &quot;second_level_object_name&quot;: &quot;Thing 1&quot;,<br>                    &quot;third_level_section_specific_data&quot;: [<br>                        {<br>                            &quot;section_title_text&quot;: &quot;Knock Your Socks Off!&quot;,<br>                            &quot;count&quot;: 200<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;More Socks Are Knocking!&quot;,<br>                            &quot;count&quot;: 190,<br>                            &quot;percent&quot;: 95<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Look! They&#39;re Sockless&quot;,<br>                            &quot;count&quot;: 180,<br>                            &quot;percent&quot;: 90<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Seriously, No Socks here!&quot;,<br>                            &quot;count&quot;: 160,<br>                            &quot;percent&quot;: 80<br>                        }<br>                    ]<br>                },<br>                {<br>                    &quot;second_level_object_id&quot;: 2,<br>                    &quot;second_level_object_name&quot;: &quot;Thing2&quot;,<br>                    &quot;third_level_section_specific_data&quot;: [<br>                        {<br>                            &quot;section_title_text&quot;: &quot;Knock Your Socks Off!&quot;,<br>                            &quot;count&quot;: 200<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;More Socks Are Knocking!&quot;,<br>                            &quot;count&quot;: 190,<br>                            &quot;percent&quot;: 95<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Look! They&#39;re Sockless&quot;,<br>                            &quot;count&quot;: 180,<br>                            &quot;percent&quot;: 90<br>                        },<br>                        {<br>                            &quot;title_text&quot;: &quot;Seriously, No Socks here!&quot;,<br>                            &quot;count&quot;: 160,<br>                            &quot;percent&quot;: 80<br>                        }<br>                    ]<br>                }<br>            ]<br>        }<br>    ]<br>}</pre><p>The team and I probably spent a good hour figuring out the naming scheme we wanted to follow to make sure that our nested JSON told an accurate story about the data it’s representing. While it’s not really in a spectacular JSON API format, it’s going to be much more straightforward to refactor this down the road than its initial starting point. One of our properties was even called “columns”. &lt;Shudder&gt;</p><p>As you’re working on data structures for APIs, make sure that the structure itself isn’t built to present data for the purpose of a specific end result. It’s very easy to get caught in the trap of writing API responses that are explicitly catering to the UX that they’re communicating with. After all, it’s the UX that informs the design of the API in the first place.</p><p>Trying to make API responses fit into specific UX paradigms makes them extremely inflexible, and really reduces or eliminates their re-usability later. Admittedly, the data that I’ve presented here is part of a much larger JSON structure, and I can’t imagine any other part of the application needing to call this besides the very specific use case that it’s originally being designed for.</p><p>But, at least now we’ve positioned ourselves so that we can start breaking down the data into smaller chunks. Making it easier, later, to convert this into a reusable API pattern.</p><p><em>Originally published on my defunct Wordpress site on February 11, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c69f26da0119" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serial(ization) Killer]]></title>
            <link>https://medium.com/@lowenthal_jason/serial-ization-killer-371480cac330?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/371480cac330</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Thu, 21 Jan 2016 17:00:00 GMT</pubDate>
            <atom:updated>2016-09-01T03:01:44.780Z</atom:updated>
            <content:encoded><![CDATA[<p>It seems one of the things I find myself in regular need of is the ability to transform a JSON document into an object graph, or to reverse that and to transform an object graph into a JSON document.</p><p>The generalized term to describe this is serialization and deserialization. And it’s one of the things that takes a good bit of heat because it’s one of the biggest performance bottlenecks you’ll find in a web-enabled API. Almost all of the libraries used to perform serialization or deserialization use some kind of reflection to determine the expected object state of whatever it is you’re converting back and forth into JSON.</p><p>There’s all kinds of annotation libraries and CoC tools available that make it super easy to get a JSON document out of an object graph. Grails even makes it super easy by providing the casting of a return value as JSON. Most of Java’s CoC libraries allow you to return an object, and then using either aspect orientation or other behind the scenes binding, convert that object into a HTTP response of some kind that the JVM server can send back as a JSON payload.</p><p>So, regardless of what tools you use — one of the things we have to consider when we build object graphs to transmit back and forth is optimization of the payload and of the serialization process itself. There’s all kinds of thoughts that go into the optimum solution for passing around JSON and object graphs, here’s a few to consider. These are questions, not answers:</p><h3>Generic or Specific?</h3><p>Assume you have a class that inherits from another class. Abstract or not, the parent class has less properties in it than its more specific instance. So, do you use a collection/array of generic objects — or do you tell the collection to expect a specific object type for the serialization process?</p><p>That depends entirely on the use of the list you’re serializing. As a small example, let’s say your generic class is “Animal”, and you have two classes that inherit it: “Dog”, and “Cat”. There’s two ways you can implement the “getNoise()” method for the subclasses. You can either override the constructor of the “Dog” class and set the “noise” property of the parent class to the appropriate value, or you can make it so that “getNoise()” isn’t part of the parent class, instead depending on the child classes to implement the “getNoise()” method.</p><h4>Using collections of generics:</h4><p>You’re going to have a problem where you may have undefined noises — let’s say the default constructor for “Animal” is something like “Squeak”. If some animals don’t have a noise defined in their child classes, then the serialized JSON will say that the animal has the “Squeak” for a noise (or some other default value). This gives you some potentially wasted bytes — if animals have noises we don’t care about, forcing the child classes to override a parent property in the parent class means you’ll end up with the property set no matter what you really wanted.</p><h4>Using collections of specifics:</h4><p>One problem you’ll have with the generic solution for collections is that if you need to find the noise property of each animal in the list — if someone forgets to implement “getNoise()” for one of the subclasses, then you’re going to have a “null” noise in your JSON. Actually, the noise property won’t even show up in your JSON document at all — it will just be downright missing. While this gains you some byte-level efficiency in cases where you really don’t care about noise (Fish, for example … do we really care what noise they make?) it also gains you some abstraction complexity that might be difficult to follow depending on how well your classes explain themselves through well written code.</p><h3>Shallow or Deep?</h3><p>Collections. Our code has it everywhere. I can’t imagine any codebase that doesn’t make use of collections in many places. No matter which framework and language set you’re using, at some point you’re going to deal with a collection of some kind or another. Retail has collections of items on a sales slip or in an inventory. Services have collections of people. If you store data, you store collections. I don’t care if you’re using a directory with flat XML files (OK, please don’t use a directory of flat XML files) or the most advanced NoSQL engine that nobody has even invented yet. We collect data. Big Data. Small Data. It’s collections. Our collections have collections.</p><p>That’s one of the biggest problems that we’re still really not very good at solving when it comes to crossing boundaries with data. Converting a database query into an object graph has overhead. Converting an object graph into a JSON string (properly formatted) has overhead. Whether or not you have a shallow or deep object graph depends entirely on the optimization strategies most important to what you’re working on.</p><h4>Shallow Serialization:</h4><p>You’re probably going to have to default to this option if you have tens of thousands of records coming back from a request. Here’s why — you can’t have tens of thousands of fully hydrated objects passed around from your server to your client and back. That actually makes it so your biggest optimization bottleneck may actually become network throughput. You’re ignoring JIT (Just-in-time) data transmission, instead favoring the assumption that if the data is available, the other end is going to use it. The data set could become quite enormous.</p><h4>Deep Serialization:</h4><p>This only makes sense if your object graph doesn’t contain collections anywhere in the tree. I think it’s fine if you have a deeply serialized object that’s ten layers deep if… no, wait… I don’t ever think that’s fine. Lazily load the next layers in once the client needs them. Don’t pass back ten layers into your object graph, because your client isn’t going to have all of the drilling into the bowels on the first request. I promise. I think if you’re going past 3 layers of serialization, then you’re going too deep.The overhead of another server round trip is vastly insignificant compared to the overhead of attempting to dive into the full depths of the object graph every time you retrieve it.</p><h3>Paginated or…</h3><p>No. There’s no other option. Paginate your API calls. Web APIs aren’t intended to pass around thousands and thousands of records at a time, especially ones that have a pretty large property set on them. Break your data chunks into pages, period. APIs should have two modes: Return a single record. Or return 25(ish) records. Anything beyond this is ludicrous and useless because nobody will want to look at more than 25 records at a time on screen anyway. That’s why intelligent search engines have been invented.</p><h3>Serialization Patterns — Good or Bad?</h3><p>I don’t really have rules of thumb for the way APIs need to be responding to user request. There’s no one-size-fits-all rule that governs everything. I really like <a href="http://jsonapi.org/">this specification</a> for the general concepts of APIs, but there’s always exceptions for things like this. Every general contract only covers “most” cases, and will usually have to have adjustments made to fit into the pattern of your current project. I’d love to say that there’s an iron clad standard for the way to write a perfect API using JSON, but that’s like saying there’s a perfect standard for writing code. Code is an art. We can create guidelines, but in general, we have to be ready to throw them away and start over at any time. What do you think? Is there a best practice you’d recommend?</p><p><em>Originally published on my defunct Wordpress site on January 21, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=371480cac330" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s In a Name?]]></title>
            <link>https://medium.com/@lowenthal_jason/what-s-in-a-name-cdcbcdb942bf?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdcbcdb942bf</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Thu, 14 Jan 2016 17:00:08 GMT</pubDate>
            <atom:updated>2016-01-17T23:13:34.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/180/0*XVAe6MRsMHiquSGx.jpg" /><figcaption>William Shakespeare, via <a href="https://en.wikipedia.org/wiki/William_Shakespeare#/media/File:Shakespeare.jpg">Wikipedia</a></figcaption></figure><p>If you follow API development conventions, regardless of the patterns you follow — coming up with meaningful and useful API routes always proves an interesting challenge. Let me see if I can explain what I mean.</p><p>In general you’ll interact with two kinds of APIs doing web application development. RESTful APIs and RPC APIs. And let me tell you, if you have to interact with both kinds of APIs in the same repository, figuring out what is what can get awfully confusing.</p><p>Forcing something that’s an RPC call into a RESTful pattern has been cause for much consternation for me over the years. In fact, I still haven’t really figured out the best way to deal with situations where an RPC method seems to be the only way to handle something.</p><p>Usually speaking RPC methods exist because we have some kind of cron job that needs to run on some routine basis to do some kind of regular bulk data update. Honestly, more often than not I’m not a big fan of building RPC calls into a web API. These are the kinds of things better relegated to crontab style jobs — but there are times and places where these make sense. I don’t really want to talk about RPC jobs right now, but they can also complicate naming if we’re not careful with how we design API routes.</p><p>The most important thing for a web API is the name of the API route that we’re providing. There’s all kinds of recommendations about best practices and standards for how this could work, but the one I’ve found myself most in tune with works as follows:</p><p>Base route identification such as</p><pre>/api/v1</pre><ul><li>Top level object that is a filterable collection. The keyword here is filterable. The names of the filters are important too.</li><li>This would give you a list of all people. Keep data size in mind — pagination may be something you always have to think about. If people number in the thousands or millions, this record set might be too big to use:</li></ul><pre>/people</pre><ul><li>This would give you the same list of people, but their first name and last name attributes would match the filter passed in:</li><li>By sending a POST body with the right JSON format to the API below the API would create a new “people” object</li></ul><pre> /api/v1/people </pre><ul><li>And this would give you the ability to manage the state of a given person:</li></ul><pre>/people/1</pre><ul><li>GET — returns the person that has ID 1</li><li>PUT — Updates the state of the person with ID 1, or returns an error if ID 1 doesn’t exist</li><li>DELETE — Removes ID 1 from the database</li></ul><p>Here’s a neat little hint: If you’re wanting to make up some JSON on the spot, and wanting to make sure it’s a valid JSON document — <a href="http://pro.jsonlint.com/">this handy little tool does a great job</a>. I plan on using it pretty frequently as I blog here, in fact.</p><p>Getting API naming right depends heavily on consistency. If you can’t come up with a consistent naming convention for where you’re going to find API methods for the state of your database, you’re likely to end up with repeated code and redundancy. Modularity starts to break down, and if one of the methods that’s in two places has an error in it, you have to remember to fix it in both places.</p><p>As you write RESTful APIs, take the time to consider the name of the routes you’re going to use. I really prefer the <a href="http://jsonapi.org/">JSON API</a> specification, but this certainly isn’t the only pattern that you can follow to build JSON contracts.</p><p>The biggest takeaway is convention and consistency. As long as you build your API with both of these in mind, using it becomes much easier down the road.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdcbcdb942bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deadlines]]></title>
            <link>https://medium.com/@lowenthal_jason/deadlines-1e5327d3ba01?source=rss-c8c2da768183------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e5327d3ba01</guid>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[Jason Lowenthal]]></dc:creator>
            <pubDate>Thu, 17 Sep 2015 11:00:00 GMT</pubDate>
            <atom:updated>2016-09-24T20:12:27.680Z</atom:updated>
            <content:encoded><![CDATA[<p>My normal time for content to go live is 11:00 AM CST every Thursday. It’s Wednesday night right now. My family have been sick and my job has been intense. But, one thing I know about blogging from my audience so far is that consistency is key. So I’ve imposed a deadline for myself to get content out at least once a week. This is what I call a well reasoned and natural deadline. The other kind of deadline is an arbitrary artificial deadline created by project managers who have to prove that the company that hired them isn’t “wasting” their money. Avoid these deadlines like they are a three headed venomous snake. Trust me. They bite.</p><h3>What’s a “Good” Deadline?</h3><p>I’m not opposed to deadline management if they come in the form of the end of a sprint or time box. The amount of work that goes into a sprint before the sprint expires might change depending on the size of the stories in the sprint. But if you do traditional sprinting, the end date of the sprint should always remain fixed. And if you use that during a continuous delivery cycle, the end of a sprint also means a production deployment. Then you have a few things going for you that are “hard dates” — specifically the sprint retrospective at the end of your sprint and your sprint planning day at the beginning of the next sprint. Or, in my case — motivation to get my writing done for my lovely loyal readers. Thanks for being loyal — hopefully I will continue to not let you down.<br> <br> One other kind of deadline we can’t avoid, no matter how badly we want to, come from forces external to our project itself. I currently work in the higher education industry. If FERPA laws suddenly change and we have to change our system to not violate them by a certain timestamp, then that’s a hard deadline. And we can’t miss it. In a healthy organization what this means is that we bump out other feature scope in favor of the new regulations. In a not-so-healthy organization this means massive amounts of overtime and lots of energy drinks.</p><h3>What’s a “Bad” Deadline?</h3><p>Here’s how to spot a bad deadline in the wild. Be warned, they can sneak up fast and bite you from out of nowhere. They come camouflaged as “just give me your best estimate” or “we have a target date of…” In general, you can tell a deadline is arbitrary or non-realistic if it’s based on something that:</p><ol><li>You or your closest team representative didn’t come up with or help come up with as a critical, non-movable deliverable because of the ramifications it has legally or on the bottom line</li><li>You did come up with it as a best guess estimate and your project manager puts it in big red letters on the calendar as the “Go Live” date</li><li>You’re on a waterfall project. Yes, those still happen. Yes, the deadlines inside of them still bite.</li></ol><h3>Managing Up</h3><p>Even if you’ve got the three headed snake of bad deadlines looming in your sights, you can still manage up to make the deadlines approaching more realistic within your own circle of influence. There are several ways you can still have an affective release date that matches the timeline, but you have to do a really good job communicating expectations and clearly defining what scope you will hit on time. Project Managers love to do scope management, it’s yet another reason they get paid. So, if you tell them that you need to adjust scope to meet their arbitrarily decided upon release cycle, make sure you can clearly articulate your reasoning. And make sure you’re ready to deal with someone who wants a very good reason why your estimate wasn’t handed to you from a higher power and created with magic all-knowing dust. If you can clearly articulate, in a quantitative way, why your initial scope cannot possibly take place in time for the deadline — it’s up to the project manager and product owner (hopefully there is one) to decide which scope needs to go into phase 2, or 3, or whatever. In all reality, what you’re doing is your best to “bend” the project management SDLC into something a bit more sprint-like — but you still have to do so in a charismatic way so that you’re still “meeting your deadline”</p><h3>Closing Thoughts</h3><p>Deadlines can add emphasis to important things that really need to be finished on time. They can also add stress to things that really shouldn’t be stressful. I’d love to hear more about your own deadline demons and successes, feel free to comment!</p><p><em>Originally published at </em><a href="https://jsonjason.blogspot.com/2015/09/deadlines.html"><em>jsonjason.blogspot.com</em></a><em> on September 17, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e5327d3ba01" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>