<?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 Tom Kruijsen on Medium]]></title>
        <description><![CDATA[Stories by Tom Kruijsen on Medium]]></description>
        <link>https://medium.com/@tomkr?source=rss-9a82ad081be7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uat_g9GDh8vrNj9o.jpeg</url>
            <title>Stories by Tom Kruijsen on Medium</title>
            <link>https://medium.com/@tomkr?source=rss-9a82ad081be7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:13:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomkr/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[Brightin phone home]]></title>
            <link>https://medium.com/@tomkr/brightin-phone-home-2411ca7d40fd?source=rss-9a82ad081be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2411ca7d40fd</guid>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[brightin]]></category>
            <category><![CDATA[slack]]></category>
            <dc:creator><![CDATA[Tom Kruijsen]]></dc:creator>
            <pubDate>Fri, 10 Mar 2017 14:57:11 GMT</pubDate>
            <atom:updated>2017-03-10T14:57:46.049Z</atom:updated>
            <content:encoded><![CDATA[<p>We besteden bij <a href="http://www.brightin.nl/">Brightin</a> het liefst onze tijd aan mensen blij maken. Dus hoe minder lang we bezig zijn met het doorverbinden van onze telefoons, hoe beter. Als klanten ons bellen, dan is het belangrijk dat ze zo snel mogelijk de collega aan de lijn hebben die ze het best kan helpen.</p><p>Gelukkig biedt onze VOIP provider de mogelijkheid om een webhook aan te roepen bij elk binnenkomend telefoontje. Dus elke keer dat de telefoon gaat, komt dat eerst binnen op een webserver. En wij zouden geen programmeurs zijn als we die mogelijkheid niet met beide handen aangrijpen om een technische oplossing voor ons probleem te bouwen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vU-cERpgWztArNNbhroTPg.jpeg" /><figcaption>Foto: <a href="https://www.flickr.com/photos/jamescridland/865759336">James Cridland</a></figcaption></figure><p>De genoemde webhook vertelt onze server welk nummer belt. Dat zoekt onze applicatie op in ons digitale telefoonboek en als het nummer bij ons bekend is, dan schakelt hij door naar de telefoon bij het team dat aan dat project werkt. De klant is blij, omdat hij of zij snel geholpen wordt en onze ontwikkelaars zijn blij, omdat er niet overal telefoons overgaan die niet voor hen zijn.</p><h3>Elixir</h3><p>Een van de leuke dingen van interne projecten is dat we wat kunnen experimenteren. Bij Brightin werken we veel met Ruby on Rails, maar dat framework is intussen al meer dan twaalf jaar oud. Elixir is een vrij jonge programmeertaal en heeft het webframework Phoenix als Rails-tegenhanger. Jong, maar dus ook met de nieuwste inzichten (en wat oude ideeën die best goed bleken) op programmeergebied ingebakken.</p><p>Leuk weetje: Elixir bouwt voort op Erlang, een programmeertaal ontwikkeld door Ericsson voor telefooncentrales. Niet zo gek dus, dat het voor deze usecase toegepast wordt, hoewel Elixir ook prima geschikt is voor webapplicaties waar geen telefoon bij komt kijken.</p><p>Een van de mooie eigenschappen van Elixir is dat het snel is. Dat is precies wat je wilt als de telefoon overgaat: de server moet meteen doorgeven wat er moet gebeuren en de juiste mensen op de hoogte stellen. Zodat de beller niet merkt dat er achter de schermen van alles gebeurt.</p><h3>Slack</h3><p>Dat mensen op de hoogte stellen gaat niet alleen via een ringtone. Onze telefoons zijn nauw geïntegreerd met Slack, onze chat-applicatie. Slack laat ons weten wie er belt (zodat niet alleen de goede persoon opneemt, maar we ook gelijk weten met wie we spreken) en maakt het makkelijk om ons telefoonboek bij te werken.</p><p>Onze chatbot Berend (snap je?) luistert als je zegt: “De laatste beller was Piet” en slaat dat op. Zo hebben we geen aparte interface nodig om het telefoonboek bij te werken. Die interface is er ook wel, want dat is handig voor het opzoeken en bijwerken van telefoonnummers. Maar Slack staat toch aan, dus is het een snelle manier voor kleine bewerkingen.</p><p>Bij Brightin zijn we meer dan ontwikkelaars. We gebruiken graag mooie software. En als we iets kunnen maken waarmee we ons eigen werk makkelijker maken en mensen (ook onszelf) blijer maken, dan doen we dat graag.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2411ca7d40fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing Software]]></title>
            <link>https://medium.com/@tomkr/writing-software-795fb248bbc5?source=rss-9a82ad081be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/795fb248bbc5</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Tom Kruijsen]]></dc:creator>
            <pubDate>Tue, 07 Jun 2016 10:26:45 GMT</pubDate>
            <atom:updated>2016-06-07T10:26:45.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gd718jPhCDmWgs77cTtHZg.jpeg" /><figcaption><a href="https://www.flickr.com/people/46151146@N04">Takashi Hososhima</a> from Tokyo, Japan</figcaption></figure><p>I write software by day and fiction by night (or at least later in the day). People have asked me if there was some kind of overlap there and that got me thinking about some of the lessons I learned about writing prose and if they could be applied to writing code as well. Here’s a short list of things I came up with that I think are applicable to both fields (with a bit of imagination).</p><h3>Writing is performance — <a href="http://brandonsanderson.com/">Brandon Sanderson</a></h3><p>Brandon Sanderson is one of my favourite writers and the only reason I haven’t read all his stuff is that he just writes so damn much. How he has time to teach writing as well, I don’t know (plus he has an <a href="http://www.writingexcuses.com/">awesome podcast</a> about — you guessed it — writing). But I spent some time looking at the videos of his lectures and the first thing I picked up was the above quote (<a href="http://www.tl-dw.com/brandon-sanderson-lecture-1-part-15-intro-to-sci-fifantasy-writing/">video and transcription</a>).</p><p>It’s a weird way of looking at writing. It’s easy to distinguish the art-forms where you’re consuming a performance (a concert, a play) from those where you don’t (an album, a movie). Books would fall into the second category. But just because people don’t have direct access to the performance, doesn’t mean there isn’t one.</p><p>The way Sanderson believes writing is important is that it takes skill and this skill is honed by practice. I think the same is true for writing code. When you’re well versed in it, it becomes easier. And the best way to become well versed is by doing it. The best way to learn to code is not just by reading books, but by getting your hands dirty. Sure, you’ll make mistakes (I’ll get to that), but it takes practice and training to get better.</p><p>I like interpreting the performance of writing in a different way as well. The moment in which you’re writing is important. Your state of mind affects how you write. This in turns affects the quality and finally the end product of what you’re making. In software this trickles down all the way into the joy a user has when using it. A happy developer who’s on top of his game is more likely to write maintainable software, which will lead to faster bug fixes and more easily developed new features for a user to enjoy. Optimising for developer happiness isn’t a luxury if you look at it like this. It means you’re optimising for the best user experience as well.</p><h3>If you don’t have the time to read, you don’t have the time to write — <a href="http://stephenking.com/">Stephen King</a></h3><p>I think there’s a couple of things at play in this <a href="https://www.goodreads.com/quotes/1404-if-you-don-t-have-time-to-read-you-don-t-have">classic quote</a>. The first is that stories are never written in a vacuum. The more you stay in touch with what is current, the more you are able to write something that is relevant and engaging. This goes for stories as well as applications. Software development is a rapidly moving field and cool new things pop up really often. The state of front-end web development has been in flux for the last years for instance, and if you ignore what’s happening in the open source community, you get hopelessly behind in the blink of a WiFi status indicator.</p><p>Secondly observing what’s around you is a great learning tool. One of the best way to learn composing stories is to look at what worked for others. If you translate this to code, you can get started at Github. It is great for allowing you to see what other people are doing in the open source world. Pull request workflows force you to look at other people’s code and allows you to ask why they solve a problem in a certain way or make you think about why you would do it differently. There are tons of videos and slide decks of talks about programming. Give yourself the time to explore all of this and become a better</p><h3>Allow yourself to suck — <a href="https://www.google.com/?q=Allow+yourself+to+suck">Everyone</a></h3><p>If there’s one piece of writing advice that keeps coming back, it’s this one. And that’s only because it makes total sense. If you want to push your boundaries, you have to do things you’ve never done before. You’re going to suck at those things, that’s ok.</p><p>The cool thing about writing (both code and prose) is that you can always go back and improve it. In fact, that’s what you’re supposed to do. Refactoring code that works is a great way to learn and improve. And it ties in with being a good performer. Your first pass is your rehearsal and then you start finetuning it. As soon as you accept that you’ll make mistakes, it makes sense to just dive in and practice. Your first iteration isn’t going to be the final one anyway.</p><p>The result of writing a story might be completely different from committing to a repository, but there are definitely ways of thinking that apply to both fields. Why limit ourselves to what smart programmers have said if we can look at what great writers have to teach? Go out and write better software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=795fb248bbc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Gulp is a better Sprockets than Sprockets]]></title>
            <link>https://medium.com/@tomkr/why-gulp-is-a-better-sprockets-than-sprockets-8d5a99e06b6d?source=rss-9a82ad081be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d5a99e06b6d</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Tom Kruijsen]]></dc:creator>
            <pubDate>Fri, 18 Mar 2016 16:49:42 GMT</pubDate>
            <atom:updated>2017-02-24T08:42:09.210Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbPTS-yzCftdp5tljZyxxw.jpeg" /><figcaption>“TeethCloseUp” by Ian Harvey — Own work. Licensed under Public Domain via Commons — <a href="https://commons.wikimedia.org/wiki/File:TeethCloseUp.jpg#/media/File:TeethCloseUp.jpg">https://commons.wikimedia.org/wiki/File:TeethCloseUp.jpg#/media/File:TeethCloseUp.jpg</a></figcaption></figure><p>One of the awesome things about Rails is that it is a big pile of tools. Whatever you want to do when you are building a web app, it’s there. You want to send mail? No problem. You’re into running stuff in background jobs? Sure thing. Really want to do some websocket magic? You have to wait a little longer, but then you’re set.</p><p>Processing your JavaScript and CSS is another one of the things Rails can do for you. But the frontend community has produced a stack of tools that provide this kind of functionality too. There’s Gulp, Webpack, Grunt and a host of others. The Phoenix webframework allows you to plug into these tools and gives this part of the functionality out of hand. That way everyone does what they’re good at. Is it time for Rails to give up it’s asset pipeline? I’d say it is.</p><h4>Building frontends</h4><p>I first used Sprockets in a world where writing JavaScript meant concatenating a bunch of files together. Or you could load them separately, and pray it worked. Sprockets was a big step in the right direction. It did the concatenating, so all you still had to do yourself was pray. It also introduced things like CoffeeScript and Sass to me and it made the pile of static files much nicer to work with.</p><p>But JavaScript grew up (CSS didn’t really, unfortunately, but we’ve still got Sass) and it now has the tools to stand on its own. And to these tools JavaScript is more than plain text files that are being processed. Why would you want a Ruby tool to poorly emulate something that treats JavaScript as a first-class citizen?</p><h4>Mining NPM</h4><p>JavaScript has its own package manager in NPM (there’s also Bower, but I’m ignoring that for now). And looking forward JavaScript comes with a module system that perhaps even trumps the one Ruby has. So there’s no more need to wrap every bit of JavaScript functionality in a Gem file just so you can port it to another package manager.</p><p>These wrapper-packages are mostly useless and often poorly maintained. And that makes total sense. What is the fun in updating a package where all you do is download another package and push it RubyGems?</p><h4>JavaScript is not scary anymore</h4><p>We’re on the verge of JavaScript becoming something of a decent language with ES6 and then ES7. The tooling is getting better and the language is introducing a lot of modern constructs that make writing JS fun again. Much of what made CoffeeScript friendlier to write is baked into the language now. And as mentioned, the module system that is built into the language replaces a lot of Sprockets’ main functionality.</p><p>I love working with Rails, but as it keeps growing and expanding, perhaps it is time to let something go as well. Asset management is one area in which I think Rails can let other tools take over so that it has more focus going forward on the cool things it does on the backend.</p><h4>Doing more</h4><p>Another advantage of plugging into an JavaScript build system is that it can easily allow you to do other things as well. One thing that jumps to mind is running your JavaScript tests. Feature tests that run your JS are slow and fragile. You should have them if you need them, but it’s probably great to be able to unit-test your front-end code as well. That way your tests are faster and better isolated. For instance if you’re doing React, you’re probably better off testing your components by themselves.</p><p>You might be able to introduce Ruby test-runners for JavaScript, but Grunt can take care of this too. Again, JavaScript is a first-class citizen here and the tools that are available are aimed at the language. So there’s no need to bridge your tools to include JavaScript, just run it as a separate task on your CI.</p><p>A major downside is that there are a lot of tools to choose from on the front-end. I’m doing a lot of work with Gulp and like using it, but it’s hard to pick the one that’s going to win. And maybe that’s ok, it’s good to have options. At the same time, Rails likes providing a clear tool for every part of the stack. They could go the direction of Phoenix and just pick one. But for now, it’s not hard to swap Sprockets out and start using some JavaScript tools. I recommend you give it a try.</p><p><em>Thanks to @avdgaag for some editing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d5a99e06b6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three Things I’m Liking about Phoenix]]></title>
            <link>https://medium.com/@tomkr/three-things-i-m-liking-about-phoenix-a7688f03b6ef?source=rss-9a82ad081be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7688f03b6ef</guid>
            <category><![CDATA[phoenix-framework]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Tom Kruijsen]]></dc:creator>
            <pubDate>Fri, 06 Nov 2015 16:11:19 GMT</pubDate>
            <atom:updated>2015-11-06T16:11:54.106Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sMSphetAQNdhFEVVelsZrg.png" /></figure><p>A colleague recently got me excited about <a href="http://elixir-lang.org/">Elixir</a> and the <a href="http://www.phoenixframework.org/">Phoenix</a> web framework. Now I’m not building telephone networks anytime soon, but I’m always intrigued by a new web framework to see on which fronts they’re pushing the envelope. I’ve worked a lot with Rails over the past few years and did some Django before that. I may even have touched a Java web app a long time ago, but that is best talked about in whispers. Phoenix is a great chance to explore what a web framework is today.</p><h3>1. Changesets</h3><p>How about that, the first thing isn’t even in Phoenix itself, but in Ecto, the default database library. It does a bunch of things different to ActiveRecord (some due to the fact that Elixir is just a different beast than Rails), but by far the coolest in my opinion is changesets. Let’s look at an example:</p><pre>@required_fields ~w(title author release_date isbn)<br>@optional_fields ~w(description)</pre><pre>def create(model, params \\ :empty) do<br> model<br> |&gt; cast(params, @required_fields, @optional_fields)<br> |&gt; slugify_field(:title, :slug)<br>end</pre><p>The create function here returns a changeset. The cool thing is that we do not validate the model, we validate the changeset instead. This allows us to check for required fields and whitelist other fields right where it matters. And something like creating a slug, which we might only want to do on create, can be added to this changeset. The changeset for updating might be completely different.</p><p>The advantage of this is that we’re not modifying the model we have before we have checked the changes. Of course immutability is a big thing in Elixir, so doing that wouldn’t even make sense. But this might be a good idea in other languages as well. You could view the changes you’re making to a model as a completely separate entity and process, before giving it to the database to actually change your data.</p><h3>2. Views</h3><p>You may be thinking: Rails has views. But let’s be honest, Rails has templates which it calls view because then it can be an MVC framework. But now that the pressures of pretending to be MVC for the sake of the acronym have waned, it’s time to call them what they really are.</p><p>Phoenix has separated Views from Templates. Templates are html documents with some code in them. Views are modules which are responsible for rendering the Template. That makes it an awesome place for view-logic. Rails provides helpers for this, which ended up somewhere globally, and that’s a stink if there ever was one.</p><p>Views in Phoenix mean you can write Elixir functions that you can cleanly call from your template. This keeps your template clean from code and other templates don’t need to worry about helpers that magically appear there.</p><h3>3. JavaScript asset pipeline</h3><p>Sprockets is kind of cool. And it was a big thing that attracted me to Rails from Django, where nothing was built into the framework. But there are so many JavaScript build tools now and they are all tied more closely to the npm/bower ecosystems (why there are two ecosystems is a whole other thing). Rather than trying to integrate JavaScript into Elixir, Phoenix ships with Brunch to manage assets, but you can swap it out for your favourite buildtool.</p><p>I have to admit I wasn’t familiar with Brunch to begin with, but it seems to work fine. It builds modern JavaScript out of the box and allows me to use CSS preprocessors. I really like that Phoenix focusses on what it does best: be an Elixir web framework. But I also really like that there are modern tools for static assets available out of the box. Having cake? Eating cake? Both? Count me in!</p><p>The server-side web framework gets little time in the spotlight with all the front-end frameworks flying around these days. But it’s good to see that there’s still innovation happening. Not all good ideas have already been found and there’s improvement happening every day. And I haven’t even touched on all of the other cool things Phoenix is doing. It’s still an awesome time to work on the server side of things.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7688f03b6ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>