<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title></title>
    <description>My thoughts on software development</description>
    <link>http://przedwojski.comhttps://przedwojski.com/</link>
    <atom:link href="http://przedwojski.comhttps://przedwojski.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 07 Aug 2019 06:41:13 +0000</pubDate>
    <lastBuildDate>Wed, 07 Aug 2019 06:41:13 +0000</lastBuildDate>
    <generator>Jekyll v3.8.5</generator>
    
      <item>
        <title>JS Academy #1: Scope 101</title>
        <description>&lt;p&gt;Welcome traveller! The journey to JS-Land begins here. In this episode we will try to make sense of what scope is. You know, the word you hear thrown around here and there, but that you never actually wrapped your head around.&lt;/p&gt;

&lt;div class=&quot;js-academy-box&quot;&gt;
    &lt;div&gt;This post is part of a JS Academy series:&lt;/div&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;a href=&quot;/2018/05/05/js-academy-introduction/&quot;&gt;#0: Introduction&lt;/a&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;a href=&quot;/2018/05/16/js-academy-scope/&quot;&gt;#1: Scope 101&lt;/a&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;

&lt;h3 id=&quot;compiled-me&quot;&gt;Compiled? Me?&lt;/h3&gt;

&lt;p&gt;Okay, let’s get into it. There is a high probability that you think JavaScript is an interpreted language. WRONG! It’s actually compiled! 
&lt;!-- But don't beat yourself too hard if you didn't know that, I just learned it recently too.  --&gt;&lt;/p&gt;

&lt;p&gt;The reason we often think it’s interpreted is because its compilation takes place just before execution. So it’s actually very different from the “traditional” compiled languages, such as C, C++, Java or C#, where compilation and running of the code are separate processes and can happen at different times.&lt;/p&gt;

&lt;p&gt;I don’t want to get into details as they are not that important for understanding scope, but if you want to dig deeper I found &lt;a href=&quot;https://softwareengineering.stackexchange.com/questions/138521/is-javascript-interpreted-by-design&quot; target=&quot;_blank&quot;&gt;this interesting thread on StackExchange that you can check out&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;why-are-you-telling-me-this&quot;&gt;Why are you telling me this?&lt;/h3&gt;

&lt;p&gt;The reason I’m mentioning compilation is because scope is involved in this process, which consists of 3 steps:
&lt;!-- when JavaScript is processed, it typically undergoes three steps characteristic for compilation: --&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tokenizing / lexing: dividing a string of words into meaningful chunks (tokens)&lt;/li&gt;
  &lt;li&gt;Parsing: transforming a stream of tokens into an Abstract Syntax Tree (AST), which is the grammatical representation of the program’s structure&lt;/li&gt;
  &lt;li&gt;Code generation: spitting out executable code on the basis of the AST&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s say we have the following simple program:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;niceRoundNumber&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In order to be able to run it, a JavaScript “engine” will first compile it, which will result in executable code. 
&lt;!-- (depending on the engine it can be some bytecode or pure machine code). &lt;--- REFERENCE NEEDED --&gt;&lt;/p&gt;

&lt;h3 id=&quot;i-came-here-to-learn-about-the-scope&quot;&gt;I came here to learn about the scope…&lt;/h3&gt;

&lt;p&gt;I know, I know! Bear with me, I’m getting there.&lt;/p&gt;

&lt;p&gt;So far I mentioned &lt;em&gt;engine&lt;/em&gt;, which is the Big Boss that handles the whole execution of our JS program.
Next up we have the &lt;em&gt;compiler&lt;/em&gt;, which handles all the dirty compiling work.
And finally there is the star of the show, the &lt;em&gt;scope&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So what does it do exactly?&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Scope has a look-up list of all the declared variables and a set of rules on how they are accessible to the executing code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;two-statements&quot;&gt;Two statements&lt;/h3&gt;

&lt;p&gt;Let’s analyze what happens with our program step by step.
First of all we need to realize that &lt;code class=&quot;highlighter-rouge&quot;&gt;var niceRoundNumber = 64;&lt;/code&gt; are, in fact, two distinct statements.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;compiler&lt;/em&gt; first looks at &lt;code class=&quot;highlighter-rouge&quot;&gt;var niceRoundNumber&lt;/code&gt; and knows it has to determine the location of this variable. 
It asks &lt;em&gt;scope&lt;/em&gt; if variable &lt;code class=&quot;highlighter-rouge&quot;&gt;niceRoundNumber&lt;/code&gt; already exists for that scope collection. 
If yes, then this statement is ignored.
Otherwise the &lt;em&gt;compiler&lt;/em&gt; declares new variable &lt;code class=&quot;highlighter-rouge&quot;&gt;niceRoundNumber&lt;/code&gt; fot that scope collection.&lt;/p&gt;

&lt;p&gt;Next the &lt;em&gt;compiler&lt;/em&gt; looks at &lt;code class=&quot;highlighter-rouge&quot;&gt;niceRoundNumber = 64&lt;/code&gt; and generates code for this assignment.
When &lt;em&gt;engine&lt;/em&gt; later executes this code, it will look the variable up in &lt;em&gt;scope&lt;/em&gt; and assign the value to it, if found.&lt;/p&gt;

&lt;h3 id=&quot;lhs--rhs-lookup&quot;&gt;LHS / RHS lookup&lt;/h3&gt;

&lt;p&gt;In fact there are 2 kinds of scope lookups: left-hand side (LHS) and right-hand side (RHS).
With a dose of simplification we can say that LHS happens when the variable appears on the left side of an assignment, and RHS when… you guessed it, when it’s on the right side.&lt;/p&gt;

&lt;p&gt;In LHS the idea is: &lt;em&gt;we need to find the container of the variable, to assign it a new value.&lt;/em&gt;
It cares about &lt;strong&gt;who is the target of the assignment&lt;/strong&gt;.
Example of LHS: &lt;code class=&quot;highlighter-rouge&quot;&gt;myVar = 2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In RHS we are trying to &lt;em&gt;lookup the value of a variable&lt;/em&gt;.
We care about &lt;strong&gt;who is the source of the assignment&lt;/strong&gt;.
Example of RHS: &lt;code class=&quot;highlighter-rouge&quot;&gt;console.log(myVar)&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;nested-scopes&quot;&gt;Nested scopes&lt;/h3&gt;

&lt;p&gt;The thing about scopes is they can be nested. Just like birds. Well, maybe not, but still…
Nested scopes are scopes inside scopes. Like in that movie “Inception”, you know? 
Okay, enough with the comparisons…&lt;/p&gt;

&lt;p&gt;Anyway, what you need to know is that if a value cannot be found in the immediate scope, the &lt;em&gt;engine&lt;/em&gt; will continue searching in the outer scope and so on and so forth, until it reaches the global (outermost) scope.&lt;/p&gt;

&lt;p&gt;And this brings us to…&lt;/p&gt;

&lt;h3 id=&quot;not-everyone-can-handle-an-undeclared-variable&quot;&gt;Not everyone can handle an undeclared variable&lt;/h3&gt;

&lt;p&gt;If a variable has not yet been declared, i.e. is not found in any scope, the LHS and RHS lookups behave differently:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;RHS - a &lt;code class=&quot;highlighter-rouge&quot;&gt;ReferenceError&lt;/code&gt; is thrown:
    &lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;ReferenceError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;LHS - if not in strict mode the global scope will create a new variable in that global scope and hand it back to &lt;em&gt;engine&lt;/em&gt;:
    &lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One caveat is that if we are in &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode&quot; target=&quot;_blank&quot;&gt;“strict mode”&lt;/a&gt; (more on that in future articles) a &lt;code class=&quot;highlighter-rouge&quot;&gt;ReferenceError&lt;/code&gt; will similarly be thrown in the case of LHS:&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;use strict&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nl&quot;&gt;ReferenceError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;in-the-next-episode&quot;&gt;In the next episode&lt;/h3&gt;

&lt;p&gt;Thanks for reading and come back next week! We’ll talk about lexical scope ;)&lt;/p&gt;

&lt;div class=&quot;js-academy-box&quot;&gt;
    &lt;div&gt;&lt;i&gt;Disclaimer:&lt;/i&gt;&lt;/div&gt;
    &lt;div&gt;This article is based on a series of great books by Kyle Simpson available for free 
        on &lt;a href=&quot;https://github.com/getify/You-Dont-Know-JS&quot; target=&quot;_blank&quot;&gt;Github&lt;/a&gt;.&lt;/div&gt;
    &lt;div&gt;I present the same concepts in a simplified manner using my own words with the occassional 
        addition of (un)funny comments.&lt;/div&gt;
    &lt;div&gt;If you want to dive deeper I encourage you to read the original books.&lt;/div&gt;
&lt;/div&gt;
</description>
        <pubDate>Wed, 16 May 2018 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2018/05/16/js-academy-scope/</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2018/05/16/js-academy-scope/</guid>
        
        <category>javascript</category>
        
        
        <category>javascript</category>
        
      </item>
    
      <item>
        <title>JS Academy #0: Introduction</title>
        <description>&lt;p&gt;Hi there, folks! I’ve recently decided to dive deeper into the intricacies of how JavaScript actually works. 
I had been using it for many years, learning “as I went”, without really understanding what was going on under the hood.&lt;/p&gt;

&lt;div class=&quot;js-academy-box&quot;&gt;
    &lt;div&gt;This post is part of a JS Academy series:&lt;/div&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;a href=&quot;/2018/05/05/js-academy-introduction/&quot;&gt;#0: Introduction&lt;/a&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;a href=&quot;/2018/05/16/js-academy-scope/&quot;&gt;#1: Scope 101&lt;/a&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;It worked fine, sure, but sometimes there were strange bugs in my code, &lt;code class=&quot;highlighter-rouge&quot;&gt;this&lt;/code&gt; binding was always a “Russian roulette”,
magic terms like “closure”, “hoisting”, “callback queue” or “event loop” didn’t ring a bell, and so on and so forth.
I mostly managed to copy-paste from StackOverflow and get it working, but the cause of the problem, and usually the 
nature of the fix, were beyond my understanding.&lt;/p&gt;

&lt;h3 id=&quot;ending-the-misery&quot;&gt;Ending the misery&lt;/h3&gt;
&lt;p&gt;Because the influence of JavaScript on the industry keeps on growing, both on the frontend and in the backend, and because
of the growing frustration of my mediocre knowledge of the language, I decided
to sit down and finally get to the bottom of how JS works.&lt;/p&gt;

&lt;p&gt;I was recommended a series of free e-books titled “You Don’t Know JS”, available for free on &lt;a href=&quot;https://github.com/getify/You-Dont-Know-JS&quot; target=&quot;_blank&quot;&gt;Github&lt;/a&gt;, which are really well-written and informative.&lt;/p&gt;

&lt;p&gt;I will release a series of articles that will roughly correspond to the books, where I will be explaining
these topics in my own words. Should you, however, find the need to dive deeper, I strongly encourage you to read the
original books.&lt;/p&gt;

&lt;h3 id=&quot;how-when-where&quot;&gt;How? When? Where?&lt;/h3&gt;
&lt;p&gt;I plan on releasing a new post every week on a Sunday.&lt;/p&gt;

&lt;p&gt;If you don’t want to miss it, make sure to subscribe to my &lt;a href=&quot;/feed.xml&quot; target=&quot;_blank&quot;&gt;feed&lt;/a&gt; using your favourite RSS reader. 
(Psst! I use &lt;a href=&quot;https://feedly.com&quot; target=&quot;_blank&quot;&gt;Feedly&lt;/a&gt;, by the way)&lt;/p&gt;

&lt;h3 id=&quot;ps&quot;&gt;P.S.&lt;/h3&gt;
&lt;p&gt;I wrote this post on a Macbook Pro, sipping coffee from an orange mug, just like in the picture. How crazy is that?!&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;*&lt;em&gt;Photo by &lt;a href=&quot;https://unsplash.com/photos/ZMraoOybTLQ?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Artem Sapegin&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/search/photos/javascript?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
        <pubDate>Sat, 05 May 2018 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2018/05/05/js-academy-introduction/</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2018/05/05/js-academy-introduction/</guid>
        
        <category>javascript</category>
        
        
        <category>javascript</category>
        
      </item>
    
      <item>
        <title>IntelliJ IDEA: multiple configurations at once</title>
        <description>&lt;p&gt;I’ve just recently come across a problem where I wanted to run 2 configurations in IntelliJ IDEA with a single keystroke.&lt;/p&gt;

&lt;p&gt;The matter at hand was that I had a Spring Boot application with a React frontend, created using &lt;code class=&quot;highlighter-rouge&quot;&gt;create-react-app&lt;/code&gt;.
The Spring Boot was handled by Gradle and React with Webpack and Node.&lt;/p&gt;

&lt;p&gt;Both the backend and the frontend were able to reload themselves upon changes in code and I didn’t want to forgo that during development by building the frontend and then serving it from the backend controller. Therefore I wanted to run them independently.&lt;/p&gt;

&lt;p&gt;Both were in the same project so I created a configuration in IDEA for each of them. The problem was: I had to manually run each configuration to get the application app and running!&lt;/p&gt;

&lt;p&gt;That being extremely inefficient I started searching for a way to run them “together”.&lt;/p&gt;

&lt;p&gt;Unfortunately a quick Google search revealed that IDEA does not support such behaviour out-of-the-box. You &lt;em&gt;can&lt;/em&gt; define a “Before launch” action, but that would not work here, as neither of the configuration terminates! They both &lt;strong&gt;run&lt;/strong&gt; for as long as you want the application to run.&lt;/p&gt;

&lt;p&gt;Fortunately, I found &lt;a href=&quot;https://stackoverflow.com/a/20857719/1972469&quot;&gt;this StackOverflow answer&lt;/a&gt; mentioning an IDEA plugin called &lt;a href=&quot;http://plugins.jetbrains.com/plugin/7248-multirun&quot;&gt;Multirun&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Sure enough, the plugin works perfectly! You can set the order of configurations and even introduce delays between them. &lt;br /&gt;
Now a single Shift + F10 does the trick ;)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/multirun.png&quot; alt=&quot;Multirun configuration&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 12 Mar 2018 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2018/03/12/intellij-idea-multiple-configurations-at-once/</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2018/03/12/intellij-idea-multiple-configurations-at-once/</guid>
        
        
      </item>
    
      <item>
        <title>Presentation tips for developers</title>
        <description>&lt;p&gt;Recently I’ve had the chance to watch many technical presentations as well as give a few of them myself. These experiences have led me to some conclusions regarding giving tech talks and I wanted to share my observations.&lt;/p&gt;

&lt;p&gt;I will not discuss the general rules of presenting. Instead, I will focus on aspects that are key to programming or technical presentations.&lt;/p&gt;

&lt;h3 id=&quot;keep-the-terminal-up&quot;&gt;Keep the terminal up&lt;/h3&gt;
&lt;p&gt;Very often when several commands have already been executed, the terminal prompt ends up at the bottom of the screen, which makes it difficult for the audience to see. Either you as the presenter are blocking its view, or it simply is too low for people in the farther rows to see.&lt;/p&gt;

&lt;p&gt;Therefore make sure to press that “Enter” a few times after each command to push it up. Or simply configure your terminal not to take up the whole height of the screen, but, for example, the upper half only.&lt;/p&gt;

&lt;h3 id=&quot;make-the-code-big-and-visible&quot;&gt;Make the code big and visible&lt;/h3&gt;
&lt;p&gt;The code in your IDE or text editor open with your normal, everyday configuration will likely be too small for the audience. The same applies to the terminal window.&lt;/p&gt;

&lt;p&gt;Make sure to increase your font size or even enter a “presentation mode”, which some IDE’s natively have (e.g. IntelliJ IDEA).&lt;/p&gt;

&lt;p&gt;You can also ask your audience if the code is big enough to be seen comfortably from the last rows. Make sure you know the shortcut keys for increasing and decreasing font size in your editor to be able to quickly adjust it.&lt;/p&gt;

&lt;p&gt;If you present code in slides, just make sure the font is big enough, as it would be inconvenient to change it during the talk.&lt;/p&gt;

&lt;p&gt;The color scheme of your editor is also important. If you are in a dark room, a dark color scheme will do, but it will be less readable if there is sunlight coming through windows or when the lights are on. Therefore it is usually safer to go will light color schemes.&lt;/p&gt;

&lt;h3 id=&quot;let-the-code-unfold&quot;&gt;Let the code unfold&lt;/h3&gt;
&lt;p&gt;It is common to simply copy-paste the code from the editor to your slides. However, such a block of code can be difficult for the audience to grasp all at once and can leave them overwhelmed. They will usually either read the code and not follow you, or they will not have understood the code.&lt;/p&gt;

&lt;p&gt;I learned that it is much better to show code in small increments and let it “unfold”, as if you were writing it on the go. It is much easier to understand code this way.&lt;/p&gt;

&lt;p&gt;You can present it in consequent slides, adding new lines of code to each of them. Alternatively, if you are showing it from an IDE, you can set up git aliases to move between commits (as described &lt;a href=&quot;https://blog.jayway.com/2015/03/30/using-git-commits-to-drive-a-live-coding-session/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Of course the best way is usually to…&lt;/p&gt;

&lt;h3 id=&quot;prefer-live-coding-to-already-prepared-code&quot;&gt;Prefer live coding to already prepared code&lt;/h3&gt;
&lt;p&gt;If you feel confident in your skills I recommend doing a live coding session rather than presenting already prepared code.&lt;/p&gt;

&lt;p&gt;This way it is much more engaging for the audience, as they can see the code as it is being created. It is also the easiest for them to follow and understand.&lt;/p&gt;

&lt;p&gt;Of course for it to be effective you need to practice a lot beforehand, be able to type quickly and know your editor / IDE well (e.g. shortcuts). It would be very boring to watch you search for some option in the menu with a mouse ;)&lt;/p&gt;

&lt;p&gt;To minimize any potential risks (i.e. code is not compiling due to a silly mistake which you are now unable to trace because of the stress of being in front of 200 people… you get my point) make sure to combine this method with setting up git aliaseses and having your code ready just in case.
This way if something goes wrong you can just skip to the nearest commit and continue from there.&lt;/p&gt;

&lt;h3 id=&quot;prepare-and-test&quot;&gt;Prepare and test&lt;/h3&gt;
&lt;p&gt;If you are showing the code, always make sure it compiles and produces the desired output. Don’t make the changes directly in the slides - always copy and paste from an IDE. It would look very unprofessional if someone spotted a compile-time error in your code during the talk.&lt;/p&gt;

&lt;p&gt;If you are doing live coding, prepare yourself well. Write all the code from scratch at least twice, ideally more. Try to hardwire it into your “muscle memory” - there will be a lot of stress during the presentation so being able to code “without thinking” is very helpful.&lt;/p&gt;

&lt;p&gt;Make sure to test your prepared commits - does switching between them work as expected? Is their order correct? Does every commit produce a working example?&lt;/p&gt;

&lt;h3 id=&quot;do-not-assume-your-audience-knows-what-youre-talking-about&quot;&gt;Do not assume your audience knows what you’re talking about&lt;/h3&gt;
&lt;p&gt;In every presentation on any topic your audience will certainly contain people who have no knowledge in that field. It is always a good idea to sacrifice a small part of the presentation to present the basics of the topic, even if you are going to talk about advanced concepts.&lt;/p&gt;

&lt;p&gt;For example, if I were to speak about advanced features of React, Redux etc., I would always begin with a slide or two about what React is, what are its basic principles and why people use it.
It will take 2 minutes but this way you make sure everybody in the room can follow your talk (even if they don’t uderstand everything that comes next).&lt;/p&gt;

&lt;h3 id=&quot;conclusions&quot;&gt;Conclusions&lt;/h3&gt;
&lt;p&gt;Tech talks are usually all about the code - so make it a centerpiece! Make it big, let it unfold and seduce your audience :)&lt;/p&gt;

&lt;p&gt;And don’t let any pesky errors ruin your talk - so prepare yourself and your code beforehand.&lt;/p&gt;

&lt;p&gt;I hope my small tips will help you deliver even more awesome presentations!&lt;/p&gt;
</description>
        <pubDate>Sat, 04 Nov 2017 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2017/11/04/presentation-tips-for-developers/</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2017/11/04/presentation-tips-for-developers/</guid>
        
        
      </item>
    
      <item>
        <title>Introduction to React - video [PL]</title>
        <description>&lt;p&gt;I recently had the pleasure to give an internal talk at my company about React. Unfortunately the talk is in Polish (even though the slides are in English - just in case…) and there are no English subtitles yet.&lt;/p&gt;

&lt;p&gt;It was an introduction to the JavaScript UI library created by Facebook, along with a live coding example where me and my coworker we built a “tic-tac-toe” game.&lt;/p&gt;

&lt;p&gt;If you are interested in this topic I strongly encourage you to watch the video. All feedback appreciated! :)&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/SFSUTKlyW88&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

</description>
        <pubDate>Wed, 23 Aug 2017 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2017/08/23/intro-to-react/</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2017/08/23/intro-to-react/</guid>
        
        
      </item>
    
      <item>
        <title>Pair programming - to do or not to do?</title>
        <description>&lt;p&gt;Pair programming is the activity of two developers cooperating to write code using a single computer. In this post I will share my thoughts about the pros and cons of this approach.&lt;/p&gt;

&lt;p&gt;The technique originates from the practices of Extreme Programming (XP) defined by Kent Beck in his book &lt;a href=&quot;https://www.amazon.com/Extreme-Programming-Explained-Embrace-Change/dp/0321278658/ref=dp_ob_title_bk&quot; target=&quot;_blank&quot;&gt;Extreme Programming Explained&lt;/a&gt; over 15 years ago.&lt;/p&gt;

&lt;h3 id=&quot;the-rules&quot;&gt;The rules&lt;/h3&gt;

&lt;p&gt;Usually one developer assumes the role of “driver” and uses the keyboard to write code, just as in solo programming. The other becomes the “navigator” - observing the process and making sure the driver doesn’t “drift off” and sticks to the gist of the task at hand.&lt;/p&gt;

&lt;p&gt;If you’re developers you must know this feeling when you’ve spent an hour implementing a certain solution, only to find out five minutes later that it should have been done completely differently. When we’re in the “flow” state it’s easy to get lost on the technical details forgetting about the business context. The navigator is there to look at the “bigger picture”, making sure the driver doesn’t get lost on particularities of a certain implementation when they shouldn’t be doing it that way at all.&lt;/p&gt;

&lt;p&gt;These roles should be changed every now and then - some propose fixed time intervals, i.e. every 10 minutes, others, such as TDD advocates, suggest that switching should happen according to the “red-green-refactor” cycle (e.g. one person writes a failing test and the other one fixes it by writing the appropriate code).&lt;/p&gt;

&lt;p&gt;Changing roles is important for staying focused on the task. Our attention span is quite short and a person being “hands-off” as the navigator for too long could lose their focus. On the other hand it is also beneficial for the driver who gets to rest.&lt;/p&gt;

&lt;h3 id=&quot;the-setup&quot;&gt;The setup&lt;/h3&gt;
&lt;p&gt;The ideal hardware setup for pair programming is as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;a big desk - so that two people can comfortably sit at it,&lt;/li&gt;
  &lt;li&gt;one computer,&lt;/li&gt;
  &lt;li&gt;two keyboards and mice - it’s impractical to pass them to each other when switching roles - it’s better to have two sets,&lt;/li&gt;
  &lt;li&gt;two monitors with mirrored screens - it’s much easier to look right in front of you than to look to the side on a single, common monitor.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;pros&quot;&gt;Pros&lt;/h3&gt;
&lt;p&gt;Pair programming brings several improvements to solo programming:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Less time wasted - nowadays there are so many distractions that it’s easy to waste your time at work. All the social media, news sites, notifications from various apps - these are time-eaters. When pair programming, though, you cannot make a pause and check Facebook in the middle of a task, because your partner is right next to you! This gives you a great shield against time-wasters.&lt;/li&gt;
  &lt;li&gt;Working in a pair is more motivating - you want to ‘impress’ the other person, or at least not look dumb, so you try hard to be sharp and focused.&lt;/li&gt;
  &lt;li&gt;Constant progress - when one person gets tired, the other one can pick up the pace, allowing them to rest - all while making progress in the task!&lt;/li&gt;
  &lt;li&gt;Instant code review - you can catch a lot of potential bugs or eliminate mistakes because the code is being constantly reviewed by the navigator. It also reduces the need for back-and-forth code reviews afterwards.&lt;/li&gt;
  &lt;li&gt;Learning skills - especially if the pair consists of a junior and a senior developer, this is one of the best ways for the junior to learn. They have an experienced programmer at their side, whom they can observe, ask questions and get instant feedback from.&lt;/li&gt;
  &lt;li&gt;Knowledge sharing - if features are developed in a pair, the knowledge of the system is better “spread out” within the team, meaning it is less likely there will be “silos” of knowledge, where a lot of information is in the hands of one person only (&lt;a href=&quot;https://en.wikipedia.org/wiki/Bus_factor&quot; target=&quot;_blank&quot;&gt;bus factor&lt;/a&gt; = 1). It is also a great way to introduce a new team member to the project.&lt;/li&gt;
  &lt;li&gt;The task gets done better, and sometimes even quicker - because of the lack of time-wasters and constant focus on the task.&lt;/li&gt;
  &lt;li&gt;Raises team spirit - you get the feeling of ‘we solved it TOGETHER’ :)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;cons&quot;&gt;Cons&lt;/h3&gt;
&lt;p&gt;Wow, all this sounds great, but… where’s the catch?&lt;br /&gt;
Below are the downsides of pair programming:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Very, very tiring - constant focus and the need to communicate are exhausting, making pair programming suitable only for rather short periods of time. As a rule of thumb I would say 3-4 hours maximum, and not every day.&lt;/li&gt;
  &lt;li&gt;Requires patience - your colleague may type or think slower, sometimes you may need to explain them something - it puts your patience to a test.&lt;/li&gt;
  &lt;li&gt;Seems to be a waste of resources (especially to some managers) - but it isn’t! Because of that it might be hard to get acceptance for pair programming from the management - but you can always use the ‘pros’ arguments to convince them ;)&lt;/li&gt;
  &lt;li&gt;Is less comfortable (depends on the setting) - unless you have a very large desk, two big monitors, two keyboards and two mice - but still you’re using one PC, so eg. holding back with some action while your colleague is working is still a slight discomfort.&lt;/li&gt;
  &lt;li&gt;Requires communication - some developers prefer to work on their own and are inherently reluctant to cooperate. It might be hard to convince them to ‘open up’.&lt;/li&gt;
  &lt;li&gt;Requires discipline - it is best done regularly and in a scheduled manner, eg. 1 day a week, 1 day every 2 weeks - otherwise it is easy to ‘skip it’, because of the aforementioned discomforts that it brings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;overall&quot;&gt;Overall&lt;/h2&gt;
&lt;p&gt;Despite the disadvantages I strongly recommend you try pair programming at work. From my experience everybody will benefit: the developers will learn more, the tasks will be done better and usually more quickly, knowledge will get spread out among team members, the code will be of a better quality and your team spirit will go up.&lt;/p&gt;

&lt;p&gt;Just remember to practice it with caution: regularly, but not too often and not for too long at a time.&lt;/p&gt;

&lt;p&gt;How about you - do you have any opinions on pair programming? Let me know in the comments!&lt;/p&gt;
</description>
        <pubDate>Thu, 27 Jul 2017 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2017/07/27/pair-programming/</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2017/07/27/pair-programming/</guid>
        
        
      </item>
    
      <item>
        <title>Don't settle in your first job</title>
        <description>&lt;p&gt;Today I wanted to share my thoughts and experiences about why it is important not to work in one place for too long, especially at the beginning of your career as a software developer.&lt;/p&gt;

&lt;p&gt;I have 3 years of commercial work experience and I currently work for my fourth company (including one internship).
Even though I might get pigeonholed as a “job hopper” by some, I will tell you why this worked out well for me.&lt;/p&gt;

&lt;p&gt;Below are several advantages of changing your job every now and then:&lt;/p&gt;

&lt;h3 id=&quot;1-work-with-different-technologies&quot;&gt;1. Work with different technologies&lt;/h3&gt;

&lt;p&gt;It is easy to get stuck working with a particular software stack encountered when joining the company.
While it might be advantageous to become an expert in a specific language or framework, 
it might also set you up for failure if the technology happens to be on its way to extinction.&lt;/p&gt;

&lt;p&gt;In my view at the beginning of the career it is good to be able to “touch” different areas: frontend, backend, SQL, maybe even some DevOps etc. 
It helps you understand how software works on all levels.&lt;br /&gt;
Also, it allows you to learn which type of programming you like best and what you can possibly later specialize in.&lt;br /&gt;
This way you also get out of your comfort zone by being exposed to new challenges, which makes you grow faster as a programmer.&lt;/p&gt;

&lt;p&gt;If you can do all that in your job, it’s fine.
But in many companies, especially the big ones, there are very clearly defined roles, i.e. “SQL Developer”&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;the guy who deals with the database code only. 
If that is your case I recommend you switch teams or even change jobs to try your hand at other areas of the software stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2-experience-diverse-company-cultures&quot;&gt;2. Experience diverse company cultures&lt;/h3&gt;

&lt;p&gt;If you switch jobs you will learn how different organizations operate and what suits you best.&lt;/p&gt;

&lt;p&gt;For instance, I worked in a software corporation, in a big public financial institution, at a small software house and at a startup.&lt;br /&gt;
I’ve experienced cubicles, open spaces and small team rooms.&lt;br /&gt;
I’ve reported to different types of managers, both technical and not.&lt;br /&gt;
I’ve seen a formal chain of command of a corporation and a much flatter structure of a small firm.&lt;br /&gt;
I’ve felt the difference between working on a software for a customer and developing your own product.&lt;br /&gt;
I’ve worked with contractors hired for a specific project and with employees devoted to their company.&lt;/p&gt;

&lt;p&gt;In summary, by deliberately “trying out” different types of companies at the beginning of my career, 
I’ve been able to quickly define what works for me and what doesn’t. 
As a result I can now spend the rest of my career working in optimal conditions instead of wondering what it would be like someplace else.&lt;/p&gt;

&lt;h3 id=&quot;3-see-different-attitudes-to-software-development&quot;&gt;3. See different attitudes to software development&lt;/h3&gt;

&lt;p&gt;I’ve seen different approaches to programming in general: the tools, the practices (code reviews, pair programming, CI) - or their lack, the methodologies (waterfall, scrum, kanban), the languages, the frameworks.&lt;/p&gt;

&lt;p&gt;At my first internship we did not use version control, let alone any continuous integration or other fancy stuff.&lt;br /&gt;
When I collaborated on a project with a colleague, we would sit down at the end of the day for 10-15 minutes, sometimes even half an hour, and manually merge changes made by one person to the other person’s code. How did we copy the code? Well, with the mighty USB stick, of course!&lt;/p&gt;

&lt;p&gt;Can you imagine what kind of software developer I would have been had I stayed there as an employee? I would probably have learned about Git at some point, but when? And what about other good practices that were not used there?&lt;/p&gt;

&lt;p&gt;Thanks to the other jobs I had I’ve been able to learn about various good and bad practices and their effects on the teams and the software they produced.&lt;br /&gt;
With that experience I am able to help the teams I work in now by convincing them to adopt the good practices and eradicate the bad ones.&lt;/p&gt;

&lt;h3 id=&quot;4-get-a-big-raise&quot;&gt;4. Get a big raise&lt;/h3&gt;

&lt;p&gt;When you negotiate with your current employer your raise will usually be determined in terms of a percentage of your current salary. This makes it very hard to make a big “leap” in compensation, say a 50% raise.&lt;/p&gt;

&lt;p&gt;However if you apply for a new job, the company knows nothing about your previous salary. Therefore you start with a sort of a “clean sheet” and the numbers depend only on your experience and performance during the recruitment process. At least that’s the way it works in Europe - I know that in the US the potential employer may ask for your previous salary, which makes it similar to negotiating with your current company.&lt;br /&gt;
If you can successfully “sell yourself” and navigate the recruitment process correctly, your future salary usually comes down to your negotiation skills.&lt;/p&gt;

&lt;p&gt;I know of people who quit company A for company B and then returned to company A several years later earning 100% more, which would have been impossible had they stayed in company A the whole time.&lt;br /&gt;
This is not to say that you should hop jobs just for the sake of earning more, but to show you that staying in one company for a long time can usually be financially disadvantageous.&lt;/p&gt;

&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;/h3&gt;

&lt;p&gt;These are just some of the benefits to switching jobs often at the beginning of your career. Obvoiusly, there are also downsides, such as having to actually search jobs and going to interviews, but in my opinion the merits outweight them.&lt;/p&gt;

&lt;p&gt;Also, at the end of the day it does not matter if some recruiters qualify you as a job hopper. There is strong demand for programmers, IT is a candidate’s market and they will be recruiting you anyway. What matters is all the other gains for you as a result of having experience working in several different places.&lt;/p&gt;

&lt;p&gt;Do you agree with my arguments? What are your experiences?&lt;br /&gt;
Make sure to let me know in the comments.&lt;/p&gt;
</description>
        <pubDate>Sat, 18 Mar 2017 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2017/03/18/dont-settle-in-your-first-job.html</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2017/03/18/dont-settle-in-your-first-job.html</guid>
        
        
      </item>
    
      <item>
        <title>I created a programming joke that went viral... and found out about it 4 years later</title>
        <description>&lt;p&gt;Around 4 years ago I came up with a programming joke.&lt;/p&gt;

&lt;p&gt;It was the spring of 2013 and I was at the University, 
listening to a lecture on Object Oriented Programming in Python when an idea sprung to my mind.&lt;br /&gt;
I presented it in the form of a comic strip that was very popular at the time.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/joke/joke.jpg&quot; alt=&quot;The joke&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It was a quick, spur-of-the-moment Paint job, but I got my message across. Satisfied with the
result, I showed it to a friend sitting next to me. He laughed and said it was quite funny.&lt;/p&gt;

&lt;p&gt;Encouraged by his approval I decided to share my cartoon with the world by posting it
on the only big worldwide image-sharing site I knew at the time - &lt;a href=&quot;http://9gag.com/u/szym1000/posts&quot; target=&quot;_blank&quot;&gt;9GAG&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/joke/9gag_points.png&quot; alt=&quot;Upvotes on 9GAG&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Within a day or two the joke got over 90 upvotes. I thought “Okay, there are some nerds on 9GAG”. 
After all the cartoon was extremely narrowly targeted.&lt;br /&gt;
I was quite happy about the upvotes and
a bit dissapointed that there were no comments, but hey, it’s the XXI century and it’s really hard
to break into the entertainment business! After that brief adventure I forgot about it completely.&lt;/p&gt;

&lt;p&gt;Fast-forward to 2017.&lt;/p&gt;

&lt;p&gt;About a month ago I started using Reddit which quickly became one of my most visited websites.
Imagine the surprise when one morning I’m browsing my favourite subreddit, &lt;code class=&quot;highlighter-rouge&quot;&gt;/r/ProgrammerHumor/&lt;/code&gt;, and I see 
&lt;a href=&quot;https://www.reddit.com/r/ProgrammerHumor/comments/5oq9qa/object_oriented/&quot; target=&quot;_blank&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/joke/reddit_jan_2017.png&quot; alt=&quot;Reddit: January 2017&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Whoa! My joke is still alive and kickin’! But what surprised me most were some of the comments:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/joke/reddit_jan_2017_c1.png&quot; alt=&quot;Reddit: January 2017 comment (1)&quot; /&gt;
&lt;img src=&quot;/assets/images/joke/reddit_jan_2017_c2.png&quot; alt=&quot;Reddit: January 2017 comment (1)&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This meant that my joke must have gained some popularity after I originally posted it on 9GAG.
A quick Google search later I found at least 3 posts on Reddit with my joke which had 
&lt;a href=&quot;https://www.reddit.com/r/ProgrammerHumor/comments/1fhti3/the_sexism_problem/&quot; target=&quot;_blank&quot;&gt;hundreds&lt;/a&gt;, 
&lt;a href=&quot;https://www.reddit.com/r/ProgrammerHumor/comments/1rap3q/oops/&quot; target=&quot;_blank&quot;&gt;over 1k&lt;/a&gt; and even
&lt;a href=&quot;https://www.reddit.com/r/ProgrammerHumor/comments/5l2d4v/how_to_make_women_more_interested_in_us/&quot; target=&quot;_blank&quot;&gt;almost 3k&lt;/a&gt;
upvotes!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/joke/reddit_hundreds.png&quot; alt=&quot;Reddit: post with hundreds of upvotes&quot; /&gt;
&lt;img src=&quot;/assets/images/joke/reddit_1k.png&quot; alt=&quot;Reddit: post with over 1k upvotes&quot; /&gt;
&lt;img src=&quot;/assets/images/joke/reddit_3k.png&quot; alt=&quot;Reddit: post with almost 3k upvotes&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Okay, I was shocked… This is the first time that I had posted anything on the Internet that became so popular.
And without me knowing about it for 4 years!&lt;/p&gt;

&lt;p&gt;And look at this: somebody even printed the cartoon out and put it on their magnetic board!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/joke/reddit_magnetic.jpg&quot; alt=&quot;Reddit: magnetic board&quot; /&gt;&lt;/p&gt;

&lt;p&gt;But wait, there’s more. I also found a reference to the joke on 
&lt;a href=&quot;https://colorblindprogramming.com/geek-joke&quot; target=&quot;_blank&quot;&gt;a blog&lt;/a&gt;, with the description:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’m usually posting these on Twitter, but this one is too good :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and it got number 9 in an article titled 
&lt;a href=&quot;http://www.javaassignmenthelp.net/best-java-jokes-on-the-internet/&quot; target=&quot;_blank&quot;&gt;Best Java Jokes on the Internet&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;How cool is that? :)&lt;/p&gt;

&lt;p&gt;Okay, enough basking in the glory of a small success of my younger self’s sense of humour
crossed with some programming knowledge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The point is: if you have something to say, share it with the world.&lt;br /&gt;
You never know who might dig it out and start upvoting.&lt;/strong&gt;&lt;/p&gt;
</description>
        <pubDate>Sat, 28 Jan 2017 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2017/01/28/programming-joke.html</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2017/01/28/programming-joke.html</guid>
        
        
      </item>
    
      <item>
        <title>How we held a company hackathon that was awesome</title>
        <description>&lt;p&gt;Recently we organized a company hackathon at my workplace. Being one of the organizers and a participant I wanted to share my experiences.&lt;/p&gt;

&lt;h3 id=&quot;our-goals&quot;&gt;Our Goals&lt;/h3&gt;

&lt;p&gt;We had been tinkering with the idea of an internal coding event for quite some time. The main goals that we wanted to achieve were the following:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Have fun&lt;/li&gt;
  &lt;li&gt;Learn new technologies&lt;/li&gt;
  &lt;li&gt;Build team spirit and collaboration&lt;/li&gt;
  &lt;li&gt;Create something durable and useful&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;1-have-fun&quot;&gt;1. Have fun&lt;/h4&gt;

&lt;p&gt;This point is quite obvious. As the hackathon was organized in the employees’ free time, we wanted to make sure that the activity would be fun and rewarding. Nobody wants to sacrifice their personal time to do some tedious and boring coding tasks.&lt;/p&gt;

&lt;h4 id=&quot;2-learn-new-technologies&quot;&gt;2. Learn new technologies&lt;/h4&gt;

&lt;p&gt;In our day jobs we tend to work with the same tech over and over - tech which can also be quite dated. Some of us are more fortunate and get to experiment, but most are not that lucky. With the hackathon we wanted to provide the participants with the opportunity to play with the most cutting-edge technologies to sharpen up their skills.&lt;/p&gt;

&lt;p&gt;Although it is possible to experiment with new tools on your own, it certainly is more entertaining to do so with others.&lt;/p&gt;

&lt;h4 id=&quot;3-build-team-spirit-and-collaboration&quot;&gt;3. Build team spirit and collaboration&lt;/h4&gt;

&lt;p&gt;Given that in our day jobs we tend to work with the same people all the time, we wanted to group participants randomly so they have a chance to work in other configurations. The benefits included learning to cooperate with other people as well as tightening bonds between employees who do not collaborate regularly.&lt;/p&gt;

&lt;p&gt;Additionally, contrary to a typical hackathon where teams compete for the best solution, we wanted to enforce collaboration by making each team build a diffrent component of the final solution. Only all the parts working together would guarantee the success of the hackathon’s creation.&lt;/p&gt;

&lt;h4 id=&quot;4-create-something-durable-and-useful&quot;&gt;4. Create something durable and useful&lt;/h4&gt;

&lt;p&gt;We wanted to avoid a situation where the projects created during the hackathon would be dumped right after it’s finished. Therefore we decided to build a tool that would benefit us in our daily lives at the company.&lt;/p&gt;

&lt;p&gt;We struggled with the topic for a bit, but at some point during a conversation over coffee an idea was born. Our company is situated in a big house and there is one toilet on each of the four floors. It often happens that one has to run up and down the stairs to find a toilet that is available.&lt;/p&gt;

&lt;p&gt;As engineers we approached the problem pragmatically: let’s build a tool to monitor the availability of toilets! We would do that by placing a light sensor in each of the toilets (most of them don’t have windows). As ridiculous as it sounds the idea quickly gained traction and suddenly everybody was on board with it.&lt;/p&gt;

&lt;h3 id=&quot;execution&quot;&gt;Execution&lt;/h3&gt;

&lt;p&gt;We had some fundamental ideas about the hackathon’s organization:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Make it during the day - too many hackathons are held at nights or as 24h events, thus disturbing our natural daily rhythm.&lt;/li&gt;
  &lt;li&gt;Make it short - we wanted to limit the time to 6 hours to incentivize simple solutions and prevent over-engineering.&lt;/li&gt;
  &lt;li&gt;Group everybody together - to avoid sitting at our regular desks and feeling like it was just another day at work we hung out in the chillout room instead with everybody sitting in sofas or poufs with laptops in their laps coding in a casual atmosphere.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is the diagram of the solution we set out to build:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/hackathon_scheme.png&quot; alt=&quot;Hackathon project diagram&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There were 3 tasks:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Connect a light sensor to a Raspberry Pi, detect light level in a toilet and post the availability status to a server.&lt;/li&gt;
  &lt;li&gt;Create a server application that will collect data from Raspberries, expose a web gui and a REST endpoint.&lt;/li&gt;
  &lt;li&gt;Create a Slack bot that will respond with toilet statuses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will not get into technical details, but the Raspberry Pi was programmed in Python, the web server app was made with Java 8 in Spring Boot and the Slack bot uses JavaScript running in Node.js.&lt;/p&gt;

&lt;p&gt;Moreover, to expose the participants to the cloud, the server app and the bot were deployed in Heroku using an automated build from GitHub.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;All in all the hackathon was a great success - we achieved the desired functionality, had lots of fun and gained at least a glimpse into some of the most current technologies on the market. In fact our GitHub repositories are still being committed to even after the event with further upgrades to the components of the system. Even people who did not attend the hackathon are participating!&lt;/p&gt;

&lt;p&gt;If you’ve never organized such an event in your company I totally recommend it. It will bring your developers together and help them remember that programming is fun!&lt;/p&gt;

</description>
        <pubDate>Sun, 25 Dec 2016 00:00:00 +0000</pubDate>
        <link>http://przedwojski.comhttps://przedwojski.com/2016/12/25/company-hackathon.html</link>
        <guid isPermaLink="true">http://przedwojski.comhttps://przedwojski.com/2016/12/25/company-hackathon.html</guid>
        
        
      </item>
    
  </channel>
</rss>
