<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matthew Henry</title>
    <description>The latest articles on DEV Community by Matthew Henry (@henrym2).</description>
    <link>https://dev.to/henrym2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F113458%2Fcfb2dd30-2201-476e-b567-693548eeff2f.png</url>
      <title>DEV Community: Matthew Henry</title>
      <link>https://dev.to/henrym2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/henrym2"/>
    <language>en</language>
    <item>
      <title>Creating a Go SDK for Buildable.dev (Part 1)</title>
      <dc:creator>Matthew Henry</dc:creator>
      <pubDate>Tue, 01 Nov 2022 17:00:00 +0000</pubDate>
      <link>https://dev.to/henrym2/creating-a-go-sdk-for-buildabledev-part-1-4j58</link>
      <guid>https://dev.to/henrym2/creating-a-go-sdk-for-buildabledev-part-1-4j58</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Message handling across distributed applications is an often times complex and difficult engineering challenge. The advantage of good messaging is quick integration between lots of disparate services be it for e-commerce, devOps or even for analytics but keeping these different systems in sync is a serious challenge. &lt;/p&gt;

&lt;p&gt;There are &lt;strong&gt;plenty&lt;/strong&gt; of options in this game be they built in house on-top of solutions like Kafka, or more generic open and closed source solutions. &lt;/p&gt;

&lt;p&gt;After coming across a new offering in &lt;a href="https://www.buildable.dev/"&gt;buildable.dev&lt;/a&gt;, and noticing it only supports a &lt;a href="https://github.com/buildable/node-sdk"&gt;NodeJS SDK&lt;/a&gt; I decided to try my hand at building another SDK in Go, a favourite language of mine, and an up-and-coming solution for writing micro-services which perfectly fits the use case of a real-time event stream solution like Buildable. &lt;/p&gt;

&lt;h2&gt;
  
  
  Buildable's Events
&lt;/h2&gt;

&lt;p&gt;Buildable provides a simple interface for creating and listening to events, at it's most basic we can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Emit new events&lt;/li&gt;
&lt;li&gt;Listen for events being emitted (transact)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Event emissions
&lt;/h3&gt;

&lt;p&gt;In the buildable world, each event has a name and an associated JSON payload, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="nl"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"my-first-event"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"payload"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"world"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can emit a basic event through CURL with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
 &lt;span class="nt"&gt;--url&lt;/span&gt; https://events.buildable.dev/emit &lt;span class="se"&gt;\&lt;/span&gt;
 &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
 &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'X-Buildable-Secret: SECRET'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
 &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="s1"&gt;'{
  "event": "my-first-event",
   "payload": {
    "salutation": "Hello World!"
  }
}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which will get nicely picked up on your buildable dashboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transactions
&lt;/h3&gt;

&lt;p&gt;On the other-hand, we can consume these events and action on them. Simply put, we're registering an interest in this event and consuming it's payload in our application in order to react to data changes somewhere else, be it our own microservice or through another connection to an application like stripe. In the Javascript SDK this is done like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;my-first-event&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="na"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;custom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seems simple enough right!&lt;/p&gt;

&lt;h2&gt;
  
  
  The meat and potatoes
&lt;/h2&gt;

&lt;p&gt;So, we have the rough idea of how this SDK should work. In essence, we want to be able to create a client that can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Emit events based on actions&lt;/li&gt;
&lt;li&gt;Register for events&lt;/li&gt;
&lt;li&gt;Action based on the registered events&lt;/li&gt;
&lt;li&gt;Deregister from events if need be&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>go</category>
      <category>opensource</category>
    </item>
    <item>
      <title>When it rains, it pours.</title>
      <dc:creator>Matthew Henry</dc:creator>
      <pubDate>Wed, 13 Feb 2019 15:46:54 +0000</pubDate>
      <link>https://dev.to/henrym2/when-it-rains-it-pours-587m</link>
      <guid>https://dev.to/henrym2/when-it-rains-it-pours-587m</guid>
      <description>&lt;h1&gt;
  
  
  When it rains it &lt;em&gt;POURS&lt;/em&gt;
&lt;/h1&gt;

&lt;p&gt;TLDR: &lt;em&gt;ALWAYS, ALWAYS, PICK THE DATE FURTHEST AWAY FROM TODAY&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The drought
&lt;/h2&gt;

&lt;p&gt;Having started my second year in Computer science in college I realized that I &lt;em&gt;have&lt;/em&gt; to get some form of work experience in the city to keep ahead of the game (and going home for another summer seemed a little un-attractive...). Having worked every summer since I was 17 (20 now) as a QA intern, dev has been something I've been itching to drown in.&lt;/p&gt;

&lt;p&gt;In a desperate attempt to pull this off I polished my linkedIn up to a shine an applied to everything that so much as mentioned the words &lt;em&gt;summer&lt;/em&gt; and &lt;em&gt;intern&lt;/em&gt;. Following this....I waited....and waited....and got denied...and told, most fabulously, to come back in two years when I have an actual college degree on the horizon. This as you might imagine, is just a tad disheartening! But absolutely nothing that every other student doesn't have to compete with over their degree so.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rain
&lt;/h2&gt;

&lt;p&gt;However, months after beginning this crusade. A response. Two in fact! Lets call them company &lt;strong&gt;A&lt;/strong&gt; and company &lt;strong&gt;B&lt;/strong&gt;, the preparations began in ernest. I studied cracking the code interview, I did hackerRank challenges until everything looked like a linkedList and HashMaps became my world. I did however...also happen to schedule the technical interview with company &lt;strong&gt;A&lt;/strong&gt; for the next week, utterly a mistake mind you, but I was excited and prayed that if I looked eager it would work in my advantage. I was....so horribly wrong, as company &lt;strong&gt;B&lt;/strong&gt; had yet to let me know when they wanted to give me a call....&lt;/p&gt;

&lt;h2&gt;
  
  
  The flood
&lt;/h2&gt;

&lt;p&gt;So as the days ticked by and I forgot about the second interview. I worked away until, to my horror, a wonderfully friendly email landed in my inbox. The second interview...was scheduled for exactly one hour following the first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can imagine the panic setting in&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thankfully it was not technical, but behavioral! A light in the darkness! Less prep more...selling oneself? I supposed? Still, panic was at an all time high and that panic I fear absolutely showed to company &lt;strong&gt;A&lt;/strong&gt;, while with company &lt;strong&gt;B&lt;/strong&gt;, I managed to be so burnt out of stress that the whole wonderful thing flowed neatly from one topic to the next. As a first ever technical interview it certainly could have gone better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As I write this I'm coming down from the high related to these interviews. Both thankfully were offsite, and were conducted over either skype or mobile which at least took the time fear out of it. I don't think I'll every be as scared about a wednesday afternoon as I was today, but you have to make do with what you have. For those of you staring down the barrel of a loaded interview, I sincerely hope you escape my bad luck.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S I have to thank &lt;a href="https://dev.to/emmawedekind"&gt;@emmawedekind&lt;/a&gt; for her tutorials and tips, because I wouldnt have survived today otherwise&lt;/em&gt;&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Is E-voting ever a good idea?</title>
      <dc:creator>Matthew Henry</dc:creator>
      <pubDate>Sun, 18 Nov 2018 00:42:19 +0000</pubDate>
      <link>https://dev.to/henrym2/is-e-voting-ever-a-good-idea-3583</link>
      <guid>https://dev.to/henrym2/is-e-voting-ever-a-good-idea-3583</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FsI1Aaz1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://erc.europa.eu/sites/default/files/styles/stories_detail_page/public/stories/images/vote_large_0.jpg%3Fitok%3Dwwoztery" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FsI1Aaz1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://erc.europa.eu/sites/default/files/styles/stories_detail_page/public/stories/images/vote_large_0.jpg%3Fitok%3Dwwoztery" alt="alt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TLDR; PC or Paper?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a student I'm constantly exposed to the political microcosm that is the students union and beyond. Seeing this and the comparisons between the wider world I often wonder as a developing (&lt;em&gt;badum bum ching&lt;/em&gt;) developer what either impact we can have and what impact we should have on the politics around us.&lt;/p&gt;

&lt;p&gt;Now that E-voting is being introduced, and poorly so in many cases, I have to ask, especially to more experiences members of the community. Do you think its a good idea? Do you have any faith in it's implementation? &lt;/p&gt;

&lt;p&gt;Or is it all just a stack of cards waiting to fall down.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>writing</category>
      <category>question</category>
    </item>
    <item>
      <title>What Skills do you wish you learned earlier</title>
      <dc:creator>Matthew Henry</dc:creator>
      <pubDate>Fri, 09 Nov 2018 18:57:18 +0000</pubDate>
      <link>https://dev.to/henrym2/what-skills-do-you-wish-you-learned-earlier-32ii</link>
      <guid>https://dev.to/henrym2/what-skills-do-you-wish-you-learned-earlier-32ii</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vxA8IjN6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0xj9apbdc2j9dhg4xzg2.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vxA8IjN6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0xj9apbdc2j9dhg4xzg2.jpeg" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TLDR; Scribble first code later.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Paddle before you dive
&lt;/h1&gt;

&lt;p&gt;I think that as a novice programmer I, and a lot of others have made the same consistent sets of mistakes. Saying that, the most consistently painful of mine has been an utter lack of planning.&lt;/p&gt;

&lt;p&gt;I wish that I had learned earlier that the simple act of taking out a pen and paper to just &lt;em&gt;roughly&lt;/em&gt; sketch out an implementation or idea would make my life &lt;strong&gt;1000&lt;/strong&gt; times easier.&lt;/p&gt;

&lt;p&gt;It's all too easy to get overexcited about an idea or a quick fix for an assignment and dive headfirst in to suddenly crack hard against a brick wall. Something that would have been fixed so quickly by taking &lt;em&gt;10 minutes&lt;/em&gt; to hash out the idea, maybe even come up with some actual edge cases. It almost goes without saying that more than half of the act of programming is about solving the problem, but its easy to get carried away and try to solve that problem on the fly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Slowing down
&lt;/h2&gt;

&lt;p&gt;The act of simply sketching a couple of ideas or hashing out some abstract attributes forces you to think about the problem in ways that are certain to save hours of time and effort down the road.&lt;/p&gt;

&lt;p&gt;Pushing it a little further and asking for the opinion of a peer, especially if they're of a similar level of proficiency as you only adds to this.&lt;/p&gt;

&lt;p&gt;You're not asking for a solution from them, just an extra pair of eyes to see what you miss.&lt;/p&gt;

&lt;p&gt;The volume of trouble I'd have saved by learning this is immense, but that's all part of the process! So go and get a pencil and some paper, scribble out you're grand plans, and hopefully, avoid the pitfalls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your thoughts
&lt;/h2&gt;

&lt;p&gt;What skills do you wish you learned earlier in your career, either as a programmer, a student or otherwise? What heartache might it have saved you in the long run?&lt;/p&gt;

</description>
      <category>beginners</category>
    </item>
  </channel>
</rss>
