<?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 Tomasz Wróbel on Medium]]></title>
        <description><![CDATA[Stories by Tomasz Wróbel on Medium]]></description>
        <link>https://medium.com/@tmvvr?source=rss-a6d79dec7a56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BA7Xdq73dAEd0gcniPi7xw.jpeg</url>
            <title>Stories by Tomasz Wróbel on Medium</title>
            <link>https://medium.com/@tmvvr?source=rss-a6d79dec7a56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 20:02:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tmvvr/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[Offline Sandwich]]></title>
            <link>https://medium.com/planet-arkency/offline-sandwich-30830ae5f16d?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/30830ae5f16d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[lifestyle]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Mon, 23 Apr 2018 16:56:31 GMT</pubDate>
            <atom:updated>2018-04-23T16:56:31.873Z</atom:updated>
            <content:encoded><![CDATA[<p>Distractions are bad. Distractions make you dumber. Eliminating distractions is impossible. We can try to <em>contain</em> them instead of eliminating them.</p><p>Offline sandwich is a way to structure your workday in a way that you put distractions into their boxes, thus giving yourself a good piece of quality time.</p><ol><li>Offline</li><li>Online</li><li>Offtopic</li></ol><h3>Offline phase</h3><ul><li>focus</li><li>coding</li><li>investigation</li></ul><h3>Online phase</h3><ul><li>pull, push, watch the build</li><li>review commits — force yourself to do it</li><li>review PT — force yourself to do it</li><li>overcommunicate</li></ul><h3>Offtopic phase</h3><ul><li>offtopic slack channels</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30830ae5f16d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/planet-arkency/offline-sandwich-30830ae5f16d">Offline Sandwich</a> was originally published in <a href="https://medium.com/planet-arkency">Planet Arkency</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Snapchat for project-related communication]]></title>
            <link>https://medium.com/planet-arkency/using-snapchat-for-project-related-communication-6c472a521ba8?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c472a521ba8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[snapchat]]></category>
            <category><![CDATA[communication]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Fri, 22 Dec 2017 14:34:33 GMT</pubDate>
            <atom:updated>2018-04-20T10:58:20.821Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*Vu9aaGWtpXFj1hy1bcIhng.png" /></figure><p>Does it sound serious? It’s that <strong>super silly</strong> messenger app used mostly by teens, isn’t it? Doesn’t the pic say it all?</p><p>We like experimenting, so we tried to use Snapchat for a part of project related communication for a couple weeks now. What I can tell so far is that it <strong>facilitates an interesting kind of communication </strong>that plays very well with strategies described in <a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=snapchat_for_project_communication_blogpost">Async &amp; Remote</a>.</p><p>Of course it’s not a good fit for every kind of project-related communication, but there’s one thing where Snapchat shines: <strong>overcommunication</strong>. You might not appreciate it without understanding of what overcommunication is and why it’s beneficial (or even crucial — especially in work environments which are async &amp; remote).</p><h4>Overcommunication</h4><p>It doesn’t mean superfluous communication or —-verbose mode. It’s an <strong>ongoing process of broadcasting your status</strong> to your teammates so that they may know where you’re at and let them provide feedback if they like. You don’t expect anybody to react. You just give them the opportunity to do it if they like. It’s <strong>crucial if you’re remote</strong> because you won’t have your colleague walk behind your back and see your screen when you’re stuck.</p><ul><li>It gives an opportunity to have others validate your current approach and let you know if you’re <strong>deluded</strong> :)</li><li>It lets others <strong>get familiar</strong> with your work so that it’s easier for them to jump into it later.</li><li>All this <strong>without interrupting</strong> anyone (and getting them out of their zone), without blocking, without forcing to respond.</li></ul><p>You may think of overcommunication as <em>Push-Style Communication</em>, <em>Tell-Don’t-Ask Communication</em>, or even <em>Async Pairing</em>. More on that in <a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=snapchat_for_project_communication_blogpost">Async Remote</a>.</p><h4>What Snapchat allows (among others)</h4><ul><li>it’s <strong>super handy</strong> to post <strong>short videos</strong> (recording is literally one click away if the app is open).</li><li>it’s <strong>super handy</strong> to consume these videos</li><li>and they <strong>disappear</strong> automatically (this is something that positively affects attention given by consumer)</li></ul><h4>What are the benefits?</h4><ul><li>Broadcasting your status can be <strong>less cumbersome</strong>. Instead of writing it on slack, just post a video with your head talking. Remote teammates will have a chance to see you :)</li><li>You can also easily <strong>record your current screen</strong>, show the piece of code you’re talking about, point out a line with your finger. This is all doable with other tools like screenshots, but what I’m arguing is that it’s <strong>less “friction”</strong> this way.</li><li>You can <strong>record a piece of paper</strong> where you’ve drawn a diagram as you were trying to understand a particular concept.</li><li>You can do it <strong>without pinging</strong> anybody. Pinging means someone needs your attention — with overcommunication that mostly isn’t the case.</li><li>It’s easier to just share a thought, a finding, an insight — without even switching to a different window. Just grab your phone, post it, put it away.</li><li>When it comes to watching the videos — it’s also easier. The videos are <strong>automatically concatenated</strong> and played one after another even when someone was posting them throughout the whole day. You don’t have to click to open the next one.</li><li>You can <strong>quickly skip</strong> watching a snap (ie. the 10 seconds piece of video) and go to the next one — just one tap. Works really well if you’re not interested in this particular part of the “utterance” and see if there’s something interesting later on.</li><li>It can possibly replace sync video calls in some of the situations where we’d like to have one.</li><li>You can post your updates without consuming new unread ones. Can be nice when you just wanna leave some status from your side, but you don’t wanna get distracted by your teammates’ updates at the moment.</li><li>It’s easy to <strong>have some fun</strong> sometimes. Try some crazy augmented reality filters. Fun is important too :)</li></ul><p>For me it’s <strong>maximum communication </strong>and <strong>minimum friction </strong>without <strong>violating asynchronicity</strong>. Eliminating friction here is very important because overcommunication ideally <strong>shouldn’t make you lose focus</strong> — which can happen if the process is not effortless enough.</p><h4>Cons</h4><ul><li>I have a feeling that Snapchat is a battery intensive app.</li><li>For a lot of people Snapchat sounds super weird in a professional context.</li><li>Not searchable. I’d intend this for stuff that you don’t plan to be searching for and that you don’t mind disappearing.</li><li>Snapchat’s growth has slowed down and it might not be the top platform in some time, but the style of communication it promoted made it to some other platforms: Messenger, WhatsApp, Instagram. Maybe some of them can be used in similar fashion as well. For me Snapchat still has a special vibe to it. UX details can make the whole difference, especially when handiness is so important (see Slack vs competitors).</li></ul><h4>Protips</h4><ul><li>There are <strong>group chats</strong> &amp; <strong>group stories</strong>. In case of group stories you can only post a video or a pic. In case of group chats you can additionally text or send a voice message.</li><li>Group stories disappear after 24 hours. Group chats have a different policy (some of them disappear right away or give you a chance to replay).</li><li>Group chats will <strong>notify</strong> you when there’s something new, group stories won’t — whatever you like.</li><li>Group stories can be easily <strong>dumped to a concatenated video</strong> — in case some conversation was so valuable that you’d wanna save it for later or share it with others.</li><li>It might be a sensible approach to <strong>setup both</strong> a group story and a group chat and post snaps to both of them (easily doable) — if you wanna have the benefits of both.</li><li>In case of group stories you need’ll need to rely on “Recent Updates” section to be able to check out newly published content.</li><li>You can easily <strong>add a piece of text</strong> to a series of videos. It can be a short description of what you’re currently talking about. It might help others quickly decide if they wanna focus on this part or rather skip it.</li></ul><p>If you’re not <strong>sold on an async workflow</strong> (especially when you’re doing remote) I really recommend you to have a look at our <a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=snapchat_for_project_communication_blogpost">Async Remote book</a> (ping us for a discount code if you like).</p><p>BTW, in case you didn’t know, it’s been some time since we tried to make sense of Snapchat as developers — not for project communication, though — just like Twitter — who’d think at the beginning that professionals will pick it up? A part of this initiative was the <a href="https://devsnap.herokuapp.com/">Devsnap Project</a> where developers active on Snapchat can start following each other. There are still a lot of developers</p><p>Here are the Snapchat usernames of some Arkency Folks if you wanna get in touch: <a href="https://www.snapchat.com/add/andrzejkrzywda">andrzejkrzywda</a>, <a href="https://www.snapchat.com/add/pankowecki">pankowecki</a>, <a href="https://www.snapchat.com/add/mambo_dzambo">mambo_dzambo</a>,<a href="https://www.snapchat.com/add/szymon.fiedler">szymon.fiedler</a>, <a href="https://www.snapchat.com/add/mpraglowski">mpraglowski</a>, <a href="https://www.snapchat.com/add/tomdzordzo">tomdzordzo</a> (me).</p><p>Your thoughts?</p><p>[Update] <a href="http://www.mediamath.com/blog/how-to-turn-snapchat-into-a-serious-communications-tool-without-all-the-seriousness/">Here’s a story</a> of another company employing Snapchat in a workplace. Interesting perspective.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c472a521ba8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/planet-arkency/using-snapchat-for-project-related-communication-6c472a521ba8">Using Snapchat for project-related communication</a> was originally published in <a href="https://medium.com/planet-arkency">Planet Arkency</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Single Threaded Development]]></title>
            <link>https://medium.com/planet-arkency/single-threaded-development-1a00bb27923a?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a00bb27923a</guid>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[process]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Fri, 24 Nov 2017 09:54:24 GMT</pubDate>
            <atom:updated>2017-11-24T19:45:50.455Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pGb4tc9eQL-Y9zu6liEQwA.png" /><figcaption>Photo by <a href="https://unsplash.com/photos/8ydJPhJVvto?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jake Sloop</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I’m currently trying to evaluate an idea — let’s call it <em>Single Threaded Development</em>, where a <strong>single team would always work only on one ticket at most</strong> at any given moment. Perhaps someone already does it and has a nice name for it — but hey — reinventing the wheel can be cool sometimes!</p><p>You could have already read in “<a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=single_threaded_development_blogpost">Async Remote</a>” that at Arkency we try to follow these rules:</p><ul><li>have a single backlog</li><li>you always take the first ticket from the top</li><li>each developer works only on one ticket</li><li>stories should be as small as possible while still delivering business value</li></ul><p>Why do we do it? Some of the reasons are:</p><ul><li>It helps us <strong>spread the knowledge</strong> among the whole team. When a developer is not allowed to pick his ticket of choice, he’s less likely to gravitate to his own areas which he’s most familiar with.</li><li>Small stories can also give you a sense of accomplishment at the end of the day and make it less likely that <strong>some important stuff is blocked</strong> by you — or, to put it differently, that your <strong>sudden absence</strong> will be a problem for the rest of the team.</li><li>If you’re interested, you can read more about that in “<a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=single_threaded_development_blogpost">Async Remote</a>”.</li></ul><p>Ok, but there still might be a couple tickets being worked on at a single moment. How about going one step further? But <strong>why</strong> would we do it? The problems we still have are:</p><ul><li>We still happen to have areas where some developer becomes particularly bound to a certain area of the codebase — i.e. the “<strong>knowledge spread</strong>” is not ideal.</li><li>Unless you manage to finish a small story before the end of the day you still might happen to <strong>block</strong> the rest of the team.</li><li>It might happen that stories are heavily related to each other — and when two developers are working on them simultaneously there might be some <strong>conflicts.</strong> This is even more likely to happen if we try to extract small stories.</li></ul><p>We started talking about this idea when we recently tried a <strong>mob programming</strong> session (you can have a look at some video footage on <a href="https://youtu.be/aFXPpcW_hpI">Andrzej’s vlog</a>). Mob programming might not be the most fortunate name, but it’s basically pair programming where the “pair” is more than 2 people.</p><p>Pair programming has many benefits. One of them is the aforementioned spreading of knowledge to the whole team. Mob programming takes it even further. Of course it has its obvious disadvantages. With mob programming it would be quite easy to practice this “Single Threaded Development” — you just mob-program all the time.</p><p>Let’s try to imagine how this could work in case of the team I’m currently working in: we’re a group of 3 developers working on 1 project in 2 timezones with 6 hours difference. Because we’re async, some of us might work quite unusual hours, like 4 am. We cannot assume that a particular developer will be there at a particular moment.</p><ul><li>Let’s say that you’re the first developer &amp; you’re about to start your working session. You take the first ticket from the top of the backlog &amp; start working on it.</li><li>Before you’re finished, another developer starts his working session and finds that you’re already working on a ticket. So he joins you and you start pair programming on that ticket.</li><li>If one of you finishes earlier, the other one continues.</li><li>Now let’s suppose the other developer needs to finish his working session, but he has not finished the story yet. Because he’s been making frequent, well-described commits and over-communicated his findings to his teammates (e.g. on a slack channel) he might just unassign himself from the ticket and let others later start off from the place where he stopped. Over-communication is one of the other techniques described in “<a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=single_threaded_development_blogpost">Async Remote</a>”.</li><li>If the other developer happens to have some code that cannot be committed because the tests are not passing, the code might as well be just discarded. It shouldn’t be a huge deal if you make frequent commits. Perhaps the other developer has a better idea later. Or you could just post your current diff to the slack channel — this way you’ll be able to pick it up later if the next developer happens to be yourself.</li><li>Then, when another developer is about to start his session again, he’ll find that the ticket is not yet finished. He’ll go through the commit messages &amp; other messages that were over-communicated and just continue where you left off.</li><li>If at some moment, while pair programming, you’d happen to be willing to take a step back and go for a walk — why not — it won’t disrupt the process.</li></ul><p>Of course it depends on your team size &amp; timezone configuration. Smaller teams have a lot of advantages anyway.</p><p>In case of our team we’d still quite often have just one developer working. Sometimes pair programming would happen, mob-programming only occasionally. Depending on time, we’d reap the benefits of any of these approaches.</p><p>Maybe it’s not something to be applied as a rule to follow at all times — perhaps just to some <strong>certain phases of the development</strong>, like:</p><ul><li>working on a particularly difficult area which is quite crucial</li><li>you’re not super familiar with the domain yet and there might be a lot of misunderstandings</li><li>you happen to have a lot of tickets related to one area of the code &amp; conflicts are likely</li></ul><p>Does it sound <strong>viable</strong>? Could even more “async” (in the sense of being able to detach yourself at anytime without affecting the team). <strong>What do you think</strong>? Do you see any holes in this process? Would you give it a try?</p><p>PS!</p><p>It is that time of year — <strong>Black Friday</strong> is around the corner. Why not use this opportunity to make a treat for your career?</p><p>For a limited time you can<strong> save 40% on all Arkency books</strong> — not only “<a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=single_threaded_development_blogpost">Async remote</a>”! On checkout use coupon code: THAT_TIME_OF_YEAR</p><ul><li>level up you Rails and React skills</li><li>become a recognized blogger</li><li><strong>transform your workplace</strong></li></ul><p>The choice is all yours! Hurry up — the offer is valid <strong>now</strong> until December 1.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a00bb27923a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/planet-arkency/single-threaded-development-1a00bb27923a">Single Threaded Development</a> was originally published in <a href="https://medium.com/planet-arkency">Planet Arkency</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote work and divorces]]></title>
            <link>https://medium.com/planet-arkency/remote-work-and-divorces-aa9461bd4bbf?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa9461bd4bbf</guid>
            <category><![CDATA[divorce]]></category>
            <category><![CDATA[remote-working]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Sat, 18 Feb 2017 11:20:40 GMT</pubDate>
            <atom:updated>2017-09-05T11:28:29.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wl1-Bl0A7TL-N5i3p3aEVA.jpeg" /></figure><p>Recently I stumbled upon an interesting article titled “<a href="http://jagiellonski24.pl/2017/02/14/dobre-malzenstwo-musi-sie-rozpasc/">Good marriage has to fall apart</a>” (unfortunately only available in polish). The author tries to analyse <strong>what’s the cause behind the increasing rate of divorces</strong> in Poland.</p><p>After a closer look at the divorce statistics and what they really mean, the author notices that divorce rates calculated separately for urban &amp; rural areas stayed more or less the same over the years. It’s the fact that more and more people moved from rural areas to cities, ie. <strong>the urbanisation, that caused the overall increase of the divorce rate</strong>.</p><p>Going further, the author claims, that it’s the <strong>urban lifestyle</strong> that inherently doesn’t make the best environment for a long-lasting marriage. The reasons being:</p><ul><li>often the spouses leave the flat at 8am and return after 11 hours (commute, obligatory lunch break etc) — effectively spending <strong>most of their time separately</strong>; actually <strong>most of the life happens during that time</strong>: successes, struggles, emotions, other relationships</li><li>the spouses often get back tired, having some other work-related stuff to do because of the competitive work environment; or they focus on their children rather than the spouse, not to lose touch with them</li><li><strong>rural life</strong>, in contrast, often included <strong>a sort of “common business”</strong> (which happened close to home) like a farm or a workshop; this resulted in spouses spending more time together, <strong>sharing common worries and goals</strong>; there were less spheres of life, where the other spouse had little or no connection with</li></ul><p>Of course it’s probably one of the many aspects of contemporary lifestyle that makes it harder for marriages, but still it’s an interesting one.</p><p>Obviously we can’t all run away from cities and establish homesteads. The author proposes <strong>interesting remedies</strong>, though:</p><ul><li>working in a smaller company, where you can often have more flexibility regarding your availability, thus being able to participate in family life more often</li><li>establishing a family business</li><li><strong>working remotely</strong> from home, <a href="https://www.google.pl/search?sourceid=chrome-psyapi2&amp;ion=1&amp;espv=2&amp;ie=UTF-8&amp;q=garden%20office&amp;oq=garden%20office&amp;aqs=chrome..69i57j0l5.1819j0j7">garden</a>, or some other nearby place</li></ul><p>Especially the last point resonates a lot with the values we have at Arkency. We even have a book about it, called “<a href="http://blog.arkency.com/async-remote/?utm_source=medium&amp;utm_medium=blogpost&amp;utm_campaign=remote_work_divorces">Async remote</a>”, which describes the way we cope with remote work. It’s safe to say that: if remote work fosters family life, then <strong>async work multiplies the effect</strong>. In our minds it’s the async part that makes the remote work actually fun and beneficial. The book describes a lot of nice ideas how to implement it in your environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa9461bd4bbf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/planet-arkency/remote-work-and-divorces-aa9461bd4bbf">Remote work and divorces</a> was originally published in <a href="https://medium.com/planet-arkency">Planet Arkency</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perfectionism and decision making]]></title>
            <link>https://medium.com/@tmvvr/perfectionism-and-decision-making-9920dc838ab?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/9920dc838ab</guid>
            <category><![CDATA[perfectionism]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Tue, 13 Sep 2016 12:41:35 GMT</pubDate>
            <atom:updated>2016-09-16T15:48:50.958Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR:</strong> perfect solution often does not exist, don’t waste time looking for one.</p><p>I’m a perfectionist. Sounds good, but the fact is it <strong>doesn’t help</strong> at all in getting stuff done. Actually, it seems to me that today it’s more likely to stumble upon this term in negative context. You’ve probably heard that “better is the enemy of good”. Completely true.</p><p>Of course perfectionism is a <strong>good trait as well</strong>, particularly in engineering, and I’m happy to be one. I also like to work with this kind of people, but we need to learn how to deal with the negative aspect.</p><p>One area, where this kind of perfectionism yields its bitter fruit is decision making. There’s a decision to make, and I’m looking for a perfect solution. When there’s no perfect solution on the horizon, <strong>the decision gets delayed</strong>. And the delayed again, and again. You know it. Eventually someone else makes the decision, or the decision “makes itself”, because the alternatives go away with time. Precious time is wasted.</p><p>One thing that can help here is to realize that very often <strong>there’s just no perfect solution</strong>, at least when given specific constraints. And you’re just looking for something that might not exist.</p><p>Now let’s define “<strong>appealing solution</strong>” as one that’s not perfect, but is significantly better than other options and is clearly the best choice. This kind of solution might not exist as well! It often happens that none of the solutions is satisfying enough and you still need to pick one.</p><p>Math exercises in school often were supposed to result in a nice “round” number. When you ended up with a bizarre number, you knew you probably messed it up. But these were all <strong>contrived problems</strong> and the reality is totally different.</p><p>There’s yet another case which deserves special attention. There may be two solutions, both not perfect, both with certain tradeoffs, but in the same time both are <strong>just fine</strong>. And if you’re like me, you might be tempted to deliberate endlessly which one to pick, while both of them solve the problem satisfiably enough. What a waste of time!</p><p><em>TODOs: how this works in programming</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9920dc838ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple async queue and code enmity]]></title>
            <link>https://medium.com/@tmvvr/simple-async-queue-and-code-enmity-bc3ffd91fbdc?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc3ffd91fbdc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Fri, 26 Aug 2016 13:12:28 GMT</pubDate>
            <atom:updated>2016-08-30T09:32:00.280Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m recently coding some node.js for fun and at some point I happened to need a simple command queue to process some requests without interrupting each other. Nothing extraordinary. Probably there’s tons of libraries that help you achieve that, especially in such a jungle that npm is.</p><p>I thought, dead simple, let’s code. Coding well-defined, isolated problems can actually be quite enjoyable, right? Actually a lot more enjoyable than trying to find the right library, checking if it behaves as promised, and how it achieves it’s purpose. Maybe it does some magic, maybe some quantum processing, maybe some redundant computation as it was once brought to widespread attention with <a href="http://accidentallyquadratic.tumblr.com/post/142387131042/nodejs-left-pad">infamous leftpad</a>.</p><p>Anyway, I started coding, probably like lot of other people would… “let’s have an array called <em>queue</em>, we will push tasks to it &amp; shift them…”. But here’s what I ended up with:</p><pre>class SimpleCommandQueue {</pre><pre>  constructor(nextProcessor) {<br>    this.nextProcessor = nextProcessor<br>    this.lastPromise = Promise.resolve({})<br>  }</pre><pre>  process(command) {<br>    let executedPromise = new Promise((resolve, reject) =&gt; {<br>      let processAndResolve = () =&gt; {<br>        this.nextProcessor.process(command).then(<br>          result =&gt; resolve(result),<br>          error  =&gt; reject(error)<br>        )<br>      }<br>      this.lastPromise.then(<br>        processAndResolve,<br>        processAndResolve<br>      )<br>    })</pre><pre>    this.lastPromise = executedPromise<br>    return executedPromise<br>  }<br>}</pre><p>(you can find the code <a href="https://github.com/fmwr/reponote/blob/master/packages/simple-command-queue/SimpleCommandQueue.js">here</a>)</p><p>It basically just stacks promises on top of each other, starting from one, that is initially resolved.</p><p>I liked it. Simple, short &amp; elegant. <a href="http://monterail.com/blog/2016/how-to-become-better-programmer/">No if/else</a>, no loops. Works on top of a built-in feature (ES6). You may have heard that <a href="https://blog.codinghorror.com/the-best-code-is-no-code-at-all/">code is your enemy</a>. I totally agree. The less code, the weaker the enemy. And you probably all know and I don’t mean Perl golf contests here.</p><p>I’d actually say that <strong>code is a minefield</strong>. The less code, the less place for bugs to come up, the less maintenance required, the less to explain to your colleagues. Our sanity and well-being as programmers depends on (among others) having less code to deal with and on the code being simple enough.</p><p>Less code is good for all of us. But my <strong>question is: did I achieve this goal</strong> when I wrote my own chunk of code to solve a well-known problem. It was short and simple indeed, but I could pull a library from npm and have even less code to deal with. Would I?</p><p>I think we all agree that less code is better. But which way to go: try to write stuff yourself and keep it as simple as possible, or try to find a library for everything? I know it’s probably a balancing act, but it would be interesting to hear what your thoughts are.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc3ffd91fbdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git for longtime Mercurial users]]></title>
            <link>https://medium.com/@tmvvr/git-for-longtime-mercurial-users-c41f37352fca?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/c41f37352fca</guid>
            <category><![CDATA[mercurial]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Wed, 24 Aug 2016 15:16:53 GMT</pubDate>
            <atom:updated>2016-08-30T14:29:55.431Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR:</strong> Git’s and Mercurial’s vocabularies have a lot of <a href="https://en.wikipedia.org/wiki/False_friend">false friends</a>.</p><p>When learning Git <strong>I wish I could forget everything I know about Mercurial</strong>, even though they’re so similar (especially in comparison to other VCS’es). Really. Learning Git would be much easier then. That’s because most of the resources on the web are targeted at people with no previous exposure to distrubuted VCS’es. They try to patiently transition you from SVN to a distributed VCS like Git, which is good &amp; understandable, because it’s indeed a huge step for a lot of readers. But to someone familiar to an other DVCS like Mercurial, going through one of <strong>these tutorials often feels like a waste of time</strong>. That’s why I often resorted to a succint resource, adequately named <a href="https://github.com/sympy/sympy/wiki/Git-hg-rosetta-stone">Git Hg Rosetta Stone</a>. Nice, but obviously at some point it’s not enough.</p><p>Moreover, most Git learning resources on the web not only feel like a waste of time for a Mercurial user, <strong>they might even be confusing</strong>, if you happen to be one! And you often end up with your questions unanswered. I think it would be really great for these tutorials to mind where the reader is comming from, be it SVN, Hg or some who’s been just emailing tarballs and patches. A side box titled “For an Hg user” would often help a lot.</p><p><em>A digression</em>: Maybe <a href="https://en.wikipedia.org/wiki/Separation_of_concerns">separation of concerns</a> could help both producers &amp; consumers of technical prose. Then users with different backgrounds would know better where to jump in. After all, a newcomer to Git is learning at least 3 deeply related, but separable ideas: basic version control, secondly distributed version control and finally Git’s specific vocabulary and quirks.</p><h3>Disclaimer and a polite request to you</h3><p>So here’s my little attempt to make it easier for you, as I go through the process myself. Please note I’m learning Git myself at the moment, so I might be wrong on some things, or just not entirely right. <strong>I’d be more than happy if you correct me</strong>. I’d like to refine this article over time.</p><h3>DVCS vocabulary’s <a href="https://en.wikipedia.org/wiki/False_friend">false friends</a></h3><p>First you have to learn that some concepts mean a totally different thing! With these differences in mind it should be a lot easier to digest other resources on the web.</p><ul><li><strong>Branches</strong>. Fortunately, these concepts are used to accomplish a similar goal. But if you assume they’re the same, soon you’ll end up in trouble. <br><strong>In Git</strong>, branch is just a <strong>pointer to a single commit</strong>. That’s it. This pointer just happens to move forward as you create subsequent commits while being on this branch (“being on this branch” is also a different concept in these systems, more on that below).<br><strong>In Mercurial</strong>, a branch (specifically a “named branch”) is a <strong>whole line of commits</strong>, starting from the one where you diverged from the original one. Moreover, in Hg a branch might be divergent itself. All these divergent lines are called “unnamed (implicit) branches”. While being on any of them you’re still rightfully on your named branch. This state is often temporary, as it’s often a result of people collaborating at the same time on one branch. You just do “hg merge” (without params) and the branch is straight again.<br>Moreover, in Mercurial <strong>branches are global &amp; forever</strong>. If your branch has a certain name in your repo, it cannot have a different one somewhere else — something which doesn’t work that way in Git. In Mercurial you have bookmarks, which are local. I won’t elaborate on that right now, maybe later.</li><li><strong>Being on a branch</strong>. As I wrote above, these concepts also differ.<br><strong>In Git</strong>, it means you’re on the single commit pointed by that branch. Not only that, you have to explicitly checkout this branch, to be on that branch. If you checkout a single commit that happens to be pointed by that branch, you won’t actually be on that branch.<br><strong>In Mercurial</strong>, if your working directory is based on any of the commits (doesn’t have to be the newest one) of in the branch history, you “are on this branch”, no matter if you checked out via “hg up” to a certain branch name, or a specific commit id.</li><li><strong>Head</strong>. This means a totally different thing here and there.<br><strong>In Git</strong>, HEAD is where you’re currently at. In Hg you’d call that “working directory parent”. HEAD can point to a commit or a branch.<br><strong>In Mercurial</strong>, in turn, head is any commit without children. That’s it.</li><li><strong>Merging</strong>.<br><strong>In Hg</strong> merge is always getting two lines of development (two commits) together.<br><strong>In Git</strong> as well, but the process of “fast-forwarding” is also called a merge, whereas in Hg you don’t have to to this kind of thing.</li></ul><h3>Scary expressions</h3><p>Some <strong>scary expressions</strong> demystified, to calm you down when you see them on your terminal:</p><ul><li>Git’s “<strong>detached head</strong>”. Don’t worry, it just means you’re not on a branch. Either you’re not on the newest commit, or you are on the newest one, but you haven’t checked it out via not checked out explictly mentioning branch name. Nothing broke, you didn’t break anything.</li><li>Hg’s “<strong>multiple heads”</strong>. Again, don’t worry, your working dir didn’t split in two. Somebody’s just been working alongside, just “hg merge”, and it’s all fine again.</li></ul><h3>Rosetta stone additions</h3><p>Here’s just a list of my additions to the aforementioned <a href="https://github.com/sympy/sympy/wiki/Git-hg-rosetta-stone">Git Hg Rosetta Stone</a>:</p><ul><li>get current commit id</li></ul><pre># hg<br><strong>hg parent</strong><br># note: hg will return two ids if you’re doing a merge)<br># if you need literally the same (no additional data)<br>hg --template &quot;{node}\n&quot;</pre><pre># git<br><strong>git rev-parse HEAD</strong></pre><ul><li>show the diff introduced by a certain commit</li></ul><pre># hg<br><strong>hg diff -c abcdef</strong></pre><pre># git<br><strong>git diff abcdef^!</strong><br># alternatively (comes with additional commit data)<br>git show abcdef</pre><h3>Disclaimer again, ICYMI :)</h3><p>That’s just scratching the surface, hopefully there’s more to come. As I said before, I’m going through the learning process myself at the moment, so this might be not entirely correct. I actually published this with the intention of letting someone <strong>verify my understanding</strong>. Please don’t hesitate to do it! :) Thank you for reading.</p><h4>This blog post’s TODOs:</h4><ul><li>git pull vs hg pull</li><li>git push vs hg push</li><li>tracking branches</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c41f37352fca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do you braindump?]]></title>
            <link>https://medium.com/@tmvvr/do-you-braindump-bcb0c6db257f?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcb0c6db257f</guid>
            <category><![CDATA[gtd]]></category>
            <category><![CDATA[todo]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[brain-dumping]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Wed, 24 Aug 2016 13:53:31 GMT</pubDate>
            <atom:updated>2017-11-27T10:16:55.576Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR:</strong> Braindumping is as essential as breathing, but I haven’t figured it out yet.</p><p>When I’m working on a project, I often have a simple text file called “todos” around. I put there stuff that should be revisited later or some ideas worth exploring, et al. Understandable enough. Probably a lot of people do.</p><p>Recently I decided to change the file name to “<strong>braindump</strong>”. Not only it’s fancier and “less worn”. It’s better because it <strong>reflects its purpose more adequately</strong>. Not all todos in my todo file where actual todos. I weren’t going to do all of them and I probably couldn’t even do it, especially considering the fact, that the number of todos is a function of the <a href="https://en.wikipedia.org/wiki/Source_lines_of_code">LOC</a> of my code, but, noticeably, <strong>not a linear one.</strong> At least in my case.</p><p><em>Digression</em>. We also live in interesting times. We’re being constantly bombarded with information. I once heard that one newspaper contains more information than a ordinary person in middle ages consumed in their lifetime. And we’re already leaving the era of newspapers &amp; TV sets. Now information floods to you all the time from the little device in your pocket. It’s also more and more personalizable, thus more appealing to your mind. And nobody thinks we’ve reached the end of technological progress. <strong>We’re constantly being distracted</strong>, and we have to cope with it. But it has a lot more positive sides — we get educated, inspired etc. We probably have to learn how to manage it.</p><h3>Purpose of braindumping</h3><p>I do braindumping not because I’m actually going to do all this stuff, but because I want to get it off my head at the moment. I often have a lot of interesting ideas on the topic which I’d like to explore, but <strong>context switching is costly</strong> (that’s also why threads don’t come for free and evented IO has its benefits — a little digression :). But mental context switching is reportedly way costlier than what most people think. Some have even argued multitasking makes you <a href="https://www.google.com/search?sourceid=chrome-psyapi2&amp;ion=1&amp;espv=2&amp;ie=UTF-8&amp;q=multitasking%20worse%20than%20getting%20stoned&amp;oq=multitasking%20worse%20than%20getting%20stoned&amp;aqs=chrome..69i57.7206j0j7">worse that getting stoned</a>. My mind has a limited capacity, and for me, brainduping is keeping my brain as light as possible to maintain the ability to freely think on the thing at hand.</p><p>My <strong>braindump file’s primary purpose is to keep a free mind</strong>. I really don’t like this feeling of trying to keep something in my head because either I really shouldn’t forget it, or I don’t even know if it has any real value, but I just don’t want it to go into the abyss of oblivion. In my case, not only I don’t wanna forget it, but I often just cannot! Is that <a href="https://en.wikipedia.org/wiki/Obsessive%E2%80%93compulsive_disorder">OCD</a> or not yet? :)</p><p>So I regularly dump my thoughts to a file, trying not to leave my current context. That’s why the file should be <strong>as handy as possible</strong>! I don’t think any external service would do. Another reason to master your text editor’s keyboard shortcuts, if there weren’t enough already! Also, never underestimate the potential of paper &amp; pencil :)</p><h3>How to get the most of braindumping</h3><p>Ok, great, so I have a braindump file. Now it grows even faster than before, because now I have no reason not to put there something. After all, it’s a braindump file. Not only it grows faster, it has no structure at all! Even my former todo files sometimes got so big that <strong>I was literally scared to go and review</strong> <strong>them</strong>! After all, there were some real todos there as well, what if I missed something important? I probably no longer want to know it if it’s post factum (I agree it’s totally stupid &amp; unprofessional). If the braindump file works this way I’m just changing the aforementioned <em>abyss of oblivion</em> to the <em>abyss of a braindump file</em>. Yes, I get a free mind, but nothing else. So here we come to question I’m currently pondering: <strong>how to make the most of the braindump file</strong>. And honestly I’m eager to hear other people’s opinions, because I know I’m not there yet :) What is your workflow, or your thoughts on the topic?</p><h4>Simple categorizing</h4><p>Here’s my little idea. It’s obvious that the “braindump entries” need to be categorized. But when I do it sometime later, it often takes a lot of time, and chances are I might no longer remember the context, the importance or I might even not remember what I meant in the first place at all! I’m considering the following idea: when appending something to my braindump file <strong>I should categorize it right away</strong>.<strong> </strong>If I settle on the idea I will need to discipline myself &amp; develop a habit, as it’s not easy. BUT the question is: won’t this take away the benefits of not leaving my current context? It should probably be<strong> as mindless &amp; quick as possible</strong>. How about assigning the entry one of a couple simple tags, which will reflect its importance:</p><ul><li><strong>“critical”</strong>:<strong> </strong>you’ll get in trouble if you don’t do it</li><li><strong>“maybe-high”</strong>:<strong> </strong>it’s not critical, but has considerable potential value; could be a missed opportunity if you don’t get back to it</li><li><strong>“maybe-low”</strong>: as above, but the potential value is either small or unknown</li><li><strong>“sci-fi”</strong>:<strong> </strong>value is either high or low, but the required resources are unaffordable; but still, a great idea :)</li></ul><p>Did I miss something? Also, both the names &amp; the definitions are subject to discussion. Actually it’s important that definitions be well-thought-out as well. A good, <strong>simple definition will help</strong> making the process of categorization as mindless as possible. Otherwise you’ll lose time &amp; attention thinking not only what’s the importance of the entry, but also what’s the importance of the category.</p><p><em>Side note</em>: <a href="https://medium.com/">medium</a>, which is currently hosting our conversation, has a nice feature: type “T K” (without the space), and you get a nice reminder to finish marked piece of text. It won’t let you publish until you get rid of all of them. Nice implementation of the “critical” tag, mentioned above. I’m thinking of including a <em>grep “T K”</em> in my precommit hooks :) Name is somewhat mysterious, but at least it’s short. Probably soon will become idiomatic (just as “OK” — there are controversies about its origins).</p><h4>Another problem of braindumping</h4><p>When I write something down really quickly (which I wanna do not to lose my context) I often end up with notes that are too vague to understand what did I mean. This is multiplied by the factor of passing time. Solution? Develop a discipline of reviewing &amp; evaluating the notes regularly?</p><h3>Invitation to contribute</h3><p>And this is where I am now :) <strong>Thanks</strong> for getting this far! As I mentioned before I’d be more than happy to hear your opinions on the topic!</p><p><em>PS. </em>I <strong>embolden</strong> some words primarily to make quick reading easier in case you don’t have time to read it cover-to-cover, which I understand. Please let know how this works for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcb0c6db257f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ES2017 async/await to the rescue!]]></title>
            <link>https://medium.com/@tmvvr/ecmascript-async-await-to-the-rescue-fc379ff89146?source=rss-a6d79dec7a56------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc379ff89146</guid>
            <category><![CDATA[async]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[promises]]></category>
            <category><![CDATA[generator]]></category>
            <dc:creator><![CDATA[Tomasz Wróbel]]></dc:creator>
            <pubDate>Tue, 16 Aug 2016 11:30:59 GMT</pubDate>
            <atom:updated>2016-08-24T19:55:42.579Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR TL;DR:</strong> Do yourself a favor — try using async/await and indent less! Setup is easy enough.</p><p><strong>TL;DR:</strong> ES2017 async/await is THE solution for “<a href="http://callbackhell.com/">callback hell</a>” (ie. async flow control and error handling). Soon you’ll be able to use it without transpilation in modern browsers. In the meantime either transpile or use ES2015 generator functions along with a small lib (eg. <a href="https://github.com/tj/co">co</a>). async/await is basically syntax sugar over ES2015 promises and generators.</p><p><strong>A story of your frustration?</strong> So you’re a JS developer, you’ve probably coded some ajax in your career, maybe you even had a little afair with Node.js and did some async IO. If you went anything past a very simple app, you probably experienced some frustration with omnipresent callbacks marching into your code and destroying the landscape. You thought, yes, it’s JavaScript, it’s async and that’s just the way it is. But it just didn’t feel right. Your code felt cumbersome and brittle. You started looking for some solutions, you probably heard of promises/futures (or deferreds, as some similar construct was once called in jQuery). Maybe you tried a library like <a href="https://github.com/caolan/async">async</a> or one of many others available on npm. It solved the problem to some extent, but not really. After all, the callbacks were still there, the solutions had their own quirks and it didn’t look clean enough. You might even have thought: “JS is hopeless in this area of synchronizing IO operations. It’s time to move out! How can this thing be so inherently difficult in JS, while in other languages it is so easy”.</p><p>You probably heard something of mysterious async/await keywords supposed to be introduced in some future version of JS, but it somehow got lost amidst all the other new shiny JS stuff being introduced all the time at a pace no one can keep up with. You thought, it’s just another guy’s solution to a hopeless problem. So here’s the good news: <strong>async/await is really the best of both worlds</strong> (sync and async IO). Benefits of one without sacrificing the other. Code doesn’t spill right anymore, it almost looks like classical sync IO. Just try it, you’ll never wanna go back. Have a look at a code sample:</p><pre>async function readAndProcess( path ) {</pre><pre>  let content = await fs.readFile( path, &quot;utf8&quot; )<br>  let result  = await processAsync( content )</pre><pre>  return result<br>}</pre><p>This way <strong>you can use all the “traditional” (synchronous) JS flow control and error handling mechanisms</strong> on async operations. Ever heard of if/else? :) Good! How about try/catch? No need to write libraries to make simple logical operations. Error propagation for free, who’d think (something other languages have for ages :)). But hey, don’t forget this is an async world, where you have an event loop for free (in other languages, in turn, you’d need to resort to a library, like <a href="https://github.com/eventmachine/eventmachine">eventmachine</a> in ruby).</p><p>Another good news, <strong>it’s already implemented or being implemented in major browsers</strong>. V8 is almost there, meaning soon you’ll be able to use it in Node without transpilation. For the time being you can either achieve it via babel transpilation — <a href="https://gist.github.com/rauchg/8199de60db48026a6670620a1c33b700">here’s</a> a gist describing how to do it in node without transpiling all the other ES6 stuff (which is already implemented in newest versions of node). You can also try <a href="https://github.com/leebyron/async-to-gen">async-to-gen</a>, <strong>which aims to transpile it with minimal overhead</strong>. In node async/await can be transpiled to ES6 generators, which are already natively available. For browser stuff you’ll probably still want to transpile with babel to plain ES5. Anyway, soon it should be available in all major modern browsers and in node without transpilation!</p><p>Yet another good news is, if transpilation is a no-go for you, <strong>you can still achieve almost the same effect without transpilation</strong> in environments which already have ES6 generators implemented (in particular, node). Generator functions are capable of doing this with some help of a little library, like <a href="https://github.com/tj/co">co</a>, which even humbly describes itself as a stepping stone towards async/await. There are many other libs, and basically it doesn’t matter which one you’ll use, as hopefully it’s only a temporary solution. Resulting code is very similar to target async/await code (one could say it’s “1 to 1”). Maybe it’s a little simplification, but for most cases rewriting to async/await should be more or less converting <em>co </em>function calls to <em>async</em> and <em>yield</em> keywords to <em>await</em>. Have in mind the eventual solution if you decide for this path. Below some sample code with <em>co + </em>generator functions. Just one level of indentation more in comparison with async/await, no disaster!</p><pre>function readAndProcess( path ) {<br>  return co( function * () {</pre><pre>    let content = yield fs.readFile( path, &quot;utf8&quot; )<br>    let result  = yield processAsync( content )</pre><pre>    return result<br>  } )<br>}</pre><p>PS, wonder how fs.readFile can return promises? Just use a module like <a href="https://github.com/normalize/mz">mz</a> or many others.</p><p>The above is possible because <strong>async/await keywords are just a syntactic sugar over ES6 generator functions</strong>. It’s them that provide the real functionality, which basically is to allow a JS function to pause and resume later - in particular, after an async operation is finished (a point easy to overlook, effectivelly leading to dismissing the idea of generator functions as nothing fancy). It’s funny, because to me generators didn’t at all look related to async flow control, when I was first browsing through ES6 features.</p><p>Another important point is that promises are not going anywhere! I’m assuming you’re aware that they made it to ES6 spec and are already natively available in eg. v8. Actually, if you like promises, you’ll be happy to hear that <strong>promises, along with generators, are the foundation of async/await solution</strong>. Basically, in the <em>co</em> solution, you just pass promises with <em>yield</em> keyword back to the caller. I recommend <a href="https://davidwalsh.name/es6-generators">this series of posts</a> to learn more about generator functions. You’ll basically know how to build a library like <em>co</em> yourself.</p><p>Getting back to promises, not only are they the foundation of async/await, but you’ll still need to resort to them when implementing some more complex async IO scenarios (like simply running a couple operations in parallel, achieved eg. with <em>Promise.all). </em>Basically, <em>await</em> keyword expects a promise and doesn’t proceed to the next line of code until it resolves (or fails). The keyword <em>async</em>, in turn, makes the function always return a promise, and allows using <em>await</em> in its body. The bottom line is: <strong>there’s no way around promises, you better get familiar with them</strong>, it’ll help you.</p><p>I’m just wondering whether it will be eventually possible to use <em>await</em> in <strong>top-level</strong> scope. You could then, for example, easily launch some IO operation in the console and get the result. Currently I often end up doing:</p><pre>someTask.then(res =&gt; console.log(res), err =&gt; console.log(err))</pre><p>Ok, that’s it, <strong>thanks</strong> for getting this far, I hope you benefitted from this read. It’s nothing really revealing, I just wanted to contribute to the spreading of the idea and share some enthusiasm :)</p><p>Here are some things I’d like to improve in this blog post:</p><ul><li>more code samples</li><li>error handling with async/await or generators</li><li>generator folding</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc379ff89146" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>