<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Piotr Horzycki</title>
    <description>The latest articles on DEV Community by Piotr Horzycki (@peterdev).</description>
    <link>https://dev.to/peterdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F65265%2F2125e84e-62f5-4b12-a5e3-c27fd84ffce1.jpg</url>
      <title>DEV Community: Piotr Horzycki</title>
      <link>https://dev.to/peterdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peterdev"/>
    <language>en</language>
    <item>
      <title>How to handle money without losing it?</title>
      <dc:creator>Piotr Horzycki</dc:creator>
      <pubDate>Tue, 28 Apr 2020 12:52:25 +0000</pubDate>
      <link>https://dev.to/peterdev/how-to-handle-money-without-losing-it-1e8f</link>
      <guid>https://dev.to/peterdev/how-to-handle-money-without-losing-it-1e8f</guid>
      <description>&lt;p&gt;Throughout my career, a majority of software I've developed had something to do with money. From complex web shops to payment gateways, &lt;strong&gt;money processing is everywhere&lt;/strong&gt;. It seems to be a &lt;strong&gt;very responsible job&lt;/strong&gt;, yet I can't remember any college courses, bootcamps, webinars, conference talks specifically discussing money-related issues. Is money handling so easy that it's not worth mentioning at all?&lt;/p&gt;

&lt;p&gt;You can do a lot of things with monetary amounts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sum them up in a shopping cart,&lt;/li&gt;
&lt;li&gt;place an order,&lt;/li&gt;
&lt;li&gt;pass it to a payment gateway,&lt;/li&gt;
&lt;li&gt;issue an invoice,&lt;/li&gt;
&lt;li&gt;print a PDF file,&lt;/li&gt;
&lt;li&gt;send an e-mail receipt,&lt;/li&gt;
&lt;li&gt;prepare reports for the management,&lt;/li&gt;
&lt;li&gt;prepare tax documents,&lt;/li&gt;
&lt;li&gt;and many more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are so many use cases, however it looks like everyone assumes that it's all about just adding and printing some numbers. Easy peasy?&lt;/p&gt;

&lt;h1&gt;
  
  
  What can go wrong?
&lt;/h1&gt;

&lt;p&gt;I've heard a story about a big e-commerce platform that integrates different parcel delivery APIs. While requesting a delivery, the shop had to declare the value of the goods for insurance. Some APIs expected an amount of dollars (like $12.34) while other APIs used cents (like 1234). The e-commerce developer &lt;strong&gt;made a mistake which costed the company hundreds of thousands of dollars&lt;/strong&gt; because the values sent were too big.&lt;/p&gt;

&lt;p&gt;Throughout my career, I've witnessed numerous issues related to processing money in all the projects I've been involved in.&lt;/p&gt;

&lt;p&gt;For example, my fellow e-commerce admin complained that she couldn't set a product price to $4.10 - the system set it at $4.09. However, $4.20 worked fine.&lt;/p&gt;

&lt;p&gt;Where do these errors come from?&lt;/p&gt;

&lt;h1&gt;
  
  
  How computers handle fractions
&lt;/h1&gt;

&lt;p&gt;Most currencies in the world have subunits. For example, one dollar equals 100 cents. This is why we're used to represent &lt;strong&gt;monetary amounts as decimal numbers&lt;/strong&gt;. So, $12.34 equals twelve dollars and thirty four cents.&lt;/p&gt;

&lt;p&gt;This piece of JavaScript code seems reasonable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We expect the result to be 0.3, but in fact we see 0.30000000000000004. What happened?&lt;/p&gt;

&lt;p&gt;A standard for storing and processing fractions that is supported natively by modern CPUs is IEEE 754. It was established in the early 80s and back then it defined only &lt;em&gt;binary arithmetics&lt;/em&gt;, not decimal. Until now, when you see the word &lt;code&gt;float&lt;/code&gt; or &lt;code&gt;double&lt;/code&gt; in your favorite programming language, they most likely represent a binary floating-point number. &lt;strong&gt;Converting that number to a decimal counterpart will be subject to error.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;float&lt;/code&gt; and &lt;code&gt;double&lt;/code&gt; are good types for scientific calculations. They were designed to store a very wide range of real numbers by using a scientific notation. Obviously if you try to squeeze that range in only 32 bits, your calculations won't be precise, but how many developers are aware of it?&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-347561901460447232-195" src="https://platform.twitter.com/embed/Tweet.html?id=347561901460447232"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-347561901460447232-195');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=347561901460447232&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;There are many libraries designed specifically to process decimal numbers. Java has &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html" rel="noopener noreferrer"&gt;BigDecimal&lt;/a&gt;, PHP has &lt;a href="https://www.php.net/manual/en/ref.bc.php" rel="noopener noreferrer"&gt;bcmath&lt;/a&gt;, JavaScript has &lt;a href="https://github.com/MikeMcl/big.js/" rel="noopener noreferrer"&gt;big.js&lt;/a&gt;. They have dedicated arithmetic engines inside to ensure precision.&lt;/p&gt;

&lt;p&gt;This problem is also important when you try to &lt;strong&gt;store monetary amounts in a SQL database&lt;/strong&gt;. You have to be careful when picking a type for a column. In most dialects, &lt;code&gt;FLOAT&lt;/code&gt; is a binary type and &lt;code&gt;DECIMAL&lt;/code&gt; or &lt;code&gt;NUMBER&lt;/code&gt; are decimal types. &lt;strong&gt;Remember to use a proper type!&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Money around the world
&lt;/h1&gt;

&lt;p&gt;There are almost 200 countries in the world and around 170 currencies - at least in the &lt;a href="https://www.iso.org/iso-4217-currency-codes.html" rel="noopener noreferrer"&gt;ISO 4217 standard&lt;/a&gt;. Currencies have different values, so for example 10 USD is not equal to 10 EUR. This is why we should care not only about processing amounts, but also joining them with respective currencies. It's just like in physics where you can't add 1 kilogram and 1 pound without a conversion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most currencies have a minor unit of 1/100&lt;/strong&gt;, so 1 USD equals 100 cents, 1 GBP equals 100 pennies, and so on. &lt;strong&gt;But there are exceptions.&lt;/strong&gt; Japanese yen do not have a subunit (it had in the past). Most varieties of dinar use 1/1000, while Mauritanian ouguiya has 1/5.&lt;/p&gt;

&lt;p&gt;I've seen a code which integrated with an external payment API. The code was supposed to convert a decimal amount (let's say, &lt;code&gt;123.45&lt;/code&gt;) and submit it to the API which expected an integer amount of a smallest unit (&lt;code&gt;12345&lt;/code&gt;). The &lt;code&gt;if&lt;/code&gt; below really bothers me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(!&lt;/span&gt;&lt;span class="s"&gt;"JPY"&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;equals&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now imagine having such conditions everywhere in your code. How error-prone can it be?&lt;/p&gt;

&lt;h1&gt;
  
  
  Money in different languages
&lt;/h1&gt;

&lt;p&gt;If you want your application to work internationally, you might need to adjust it to different languages and regions. This process is called internationalization, or &lt;strong&gt;i18n&lt;/strong&gt;. Besides message translations, it also involves &lt;strong&gt;number and currency formatting&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Region&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;English&lt;/td&gt;
&lt;td&gt;United States&lt;/td&gt;
&lt;td&gt;USD12,345.67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polish&lt;/td&gt;
&lt;td&gt;Poland&lt;/td&gt;
&lt;td&gt;12 345,67 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spanish&lt;/td&gt;
&lt;td&gt;Spain&lt;/td&gt;
&lt;td&gt;12.345,67 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spanish&lt;/td&gt;
&lt;td&gt;Mexico&lt;/td&gt;
&lt;td&gt;12,345.67 USD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As you see in the table above, even a single language can differ across regions. This is why operating systems introduced &lt;em&gt;locales&lt;/em&gt;. These are sets of predefined rules which release us from implementing all the formatting by hand.&lt;/p&gt;

&lt;p&gt;Yet still I've seen many cases where people did not use localization properly. They took shortcuts by manually replacing dots with commas. Imagine copying the same replace function a hundred times across the whole application!&lt;/p&gt;

&lt;h1&gt;
  
  
  The Money Pattern
&lt;/h1&gt;

&lt;p&gt;Martin Fowler suggested that &lt;strong&gt;amount and currency can be coupled&lt;/strong&gt; in a data structure called &lt;code&gt;Money&lt;/code&gt;. Moreover, a class like this should provide basic arithmetics. &lt;a href="https://martinfowler.com/eaaCatalog/money.html" rel="noopener noreferrer"&gt;In his book from 2002, Martin wrote&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A large proportion of the computers in this world manipulate money, so it's always puzzled me that money isn't actually a first class data type in any mainstream programming language.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are implementations of the Money Pattern for most popular languages, but I have an impression that they are little known. Most developers assume that an integer or &lt;code&gt;BigDecimal&lt;/code&gt; type is enough to handle money properly.&lt;/p&gt;

&lt;p&gt;Let's see how a dedicated library benefits us, as shown in this Java example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Money&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Money&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"EUR"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// 100 euro&lt;/span&gt;
&lt;span class="nc"&gt;Money&lt;/span&gt; &lt;span class="n"&gt;gross&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;multiply&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.23&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// 123 euro&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Java has a JSR-354 standard for handling monetary amounts and a reference implementation called &lt;a href="https://javamoney.github.io/ri.html" rel="noopener noreferrer"&gt;Moneta&lt;/a&gt;. For PHP, there is a similar library called &lt;a href="http://moneyphp.org/en/stable/" rel="noopener noreferrer"&gt;MoneyPHP&lt;/a&gt;. For JavaScript, try &lt;a href="https://dinerojs.com/" rel="noopener noreferrer"&gt;dinero.js&lt;/a&gt;, &lt;a href="https://currency.js.org/" rel="noopener noreferrer"&gt;currency.js&lt;/a&gt; or &lt;a href="https://github.com/davidkalosi/js-money" rel="noopener noreferrer"&gt;js-money&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Apart from simple arithmetics, most "money" libraries provide a way to &lt;strong&gt;easily convert between currencies&lt;/strong&gt;. Sometimes the only thing we need to do is to feed an object called exchange rate repository with recent data pulled from an API. Sometimes a library does it for us:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ExchangeRateProvider&lt;/span&gt; &lt;span class="n"&gt;rateProvider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MonetaryConversions&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getExchangeRateProvider&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;CurrencyConversion&lt;/span&gt; &lt;span class="n"&gt;conversion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rateProvider&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getCurrencyConversion&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"CHF"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;Money&lt;/span&gt; &lt;span class="n"&gt;amountUsd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Money&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"USD"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;Money&lt;/span&gt; &lt;span class="n"&gt;amountChf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;amountUsd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conversion&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Last but not least, money libraries help us &lt;strong&gt;adjust the printed output&lt;/strong&gt; to a specific locale:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;MonetaryAmountFormat&lt;/span&gt; &lt;span class="n"&gt;formatter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MonetaryFormats&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getAmountFormat&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Locale&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ENGLISH&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;formatter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gross&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;  &lt;span class="c1"&gt;// EUR123.00&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Handling financial calculations is easy if you follow a few simple rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use proper data types&lt;/strong&gt; for decimal arithmetics. Avoid &lt;code&gt;float&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pair an amount with a currency.&lt;/strong&gt; Even if your software operates only on a single currency, you never know when your client would like to enter foreign markets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be careful while exchanging data with external APIs.&lt;/strong&gt; Pay attention to what is being sent - is it dollars or cents?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you don't know what you're doing, you can make silly mistakes that might cost your clients a fortune. Why don't you become a professional that other business professionals can rely on? Surprise your coworkers and your clients with knowledge and experience! Good luck!&lt;/p&gt;

</description>
      <category>money</category>
      <category>java</category>
      <category>php</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Improving communication between office and remote employees</title>
      <dc:creator>Piotr Horzycki</dc:creator>
      <pubDate>Thu, 11 Apr 2019 20:03:45 +0000</pubDate>
      <link>https://dev.to/peterdev/improving-communication-between-office-and-remote-employees-1jc9</link>
      <guid>https://dev.to/peterdev/improving-communication-between-office-and-remote-employees-1jc9</guid>
      <description>&lt;p&gt;Remote work is challenging. People working remotely need perfect &lt;strong&gt;communication skills and discipline&lt;/strong&gt; because no one is watching over their shoulder. However, the real struggle starts when we try to combine office and remote employees. What problems are we going to face and how can we improve the situation?&lt;/p&gt;

&lt;p&gt;I was tired of working in a crowded and noisy open space, so switching to a remote job was a big relief to me. However, I still had to cooperate with people sitting in an office and it turned out to be quite a challenge for all of us. Luckily, with some understanding from everyone in the team, things improved quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let others know where and who you are
&lt;/h2&gt;

&lt;p&gt;Your coworkers should know if you’re available or not. Set a status which says &lt;em&gt;“In the office”&lt;/em&gt; or &lt;em&gt;“Working remotely 9-5”&lt;/em&gt;. Use &lt;em&gt;“Away”&lt;/em&gt; when you have a break and &lt;em&gt;“Do not disturb”&lt;/em&gt; when you need some peace.&lt;/p&gt;

&lt;p&gt;At some point, my employer forced everyone to &lt;strong&gt;set their photos as profile pictures&lt;/strong&gt; on Slack. All the funny cats as avatars are now gone. Having real pictures is a good way to integrate people, especially when remote guys visit the office from time to time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improve conference calls
&lt;/h2&gt;

&lt;p&gt;We often have calls where one group of people is sitting at the office and another group is remote. The biggest challenge is to create &lt;strong&gt;equal participation&lt;/strong&gt; opportunities &lt;strong&gt;for everyone&lt;/strong&gt; in the team.&lt;/p&gt;

&lt;p&gt;Both office and remote people must have a good connection and a good microphone, so everyone can understand what other people are saying. Remote folks usually have headsets; please check their sound quality upfront! If your mic sounds like an old telephone, buy something better.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fda40u3pddsm66lk92pod.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fda40u3pddsm66lk92pod.png"&gt;&lt;/a&gt;&lt;/p&gt;
The best table setup for a call with remote people. Every person maintains the same distance from a microphone. A webcam captures everyone at the table, so that remote participants see exactly what’s happening.



&lt;p&gt;The office group can have a &lt;strong&gt;shared microphone on the table&lt;/strong&gt;. You can find some good products with an omnidirectional mic and an integrated speaker for around $100. &lt;strong&gt;Quality matters&lt;/strong&gt; even more because people are going to sit in a distance from the microphone, thus remote guys will hear more room reflections. Maintain an equal distance from the microphone, so that everyone can be heard equally loud.&lt;/p&gt;

&lt;p&gt;When the office team joins a meeting, they share one user account. Remote people do not know who exactly is present in the room. The solution is simple: &lt;strong&gt;turn the camera on!&lt;/strong&gt; The best way is to have an external camera with an overall view of the conference room. If you don’t have it, just rotate a laptop whenever someone else is starting to speak.&lt;/p&gt;

&lt;p&gt;Any new people should introduce themselves, like &lt;em&gt;“Hi, I’m Mark, I’m resposible for X and I joined the meeting because …”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s good to know who’s joining us and why, and it’s nice to see people smiling. Remote people should launch their cameras too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Share anything valuable hanging on the office walls
&lt;/h2&gt;

&lt;p&gt;Sometimes people at the office find it convenient to draw things on the wall, or stick some cards here and there. Remote workers do not see these walls. You need to at least &lt;strong&gt;share a picture&lt;/strong&gt; of any diagrams you made on that wall. Make sure remote folks are somehow able to contribute to those drawings.&lt;/p&gt;

&lt;p&gt;The same goes with any printed announcements, like &lt;em&gt;“Hey, we’re having a party tomorrow”&lt;/em&gt;. Of course if remote people can relate to them. You don’t have to share information about a broken coffee machine, for instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet in person from time to time
&lt;/h2&gt;

&lt;p&gt;You should meet and have some fun together. The team spirit is much stronger when you can share memories from crazy trips and parties. An organization can facilitate this by organizing different events, like trainings, conferences, lightning talks, etc. Of course you can also have your own initiatives, even if it's just having pizza and beer.&lt;/p&gt;

&lt;p&gt;Mixing office and remote workers can bring a lot of fun. It increases diversity because a company does not limit itself to hiring only the people available in a specific location. However, it takes some practice to do it right and get rid of any communication obstacles.&lt;/p&gt;

</description>
      <category>remote</category>
      <category>office</category>
      <category>softskills</category>
      <category>team</category>
    </item>
    <item>
      <title>Offboarding: How to quit your job gracefully</title>
      <dc:creator>Piotr Horzycki</dc:creator>
      <pubDate>Sat, 23 Feb 2019 22:06:23 +0000</pubDate>
      <link>https://dev.to/peterdev/offboarding-how-to-quit-your-job-gracefully-12n1</link>
      <guid>https://dev.to/peterdev/offboarding-how-to-quit-your-job-gracefully-12n1</guid>
      <description>

&lt;p&gt;I read many interesting &lt;a href="https://dev.to/search?q=onboarding"&gt;articles about preparing an efficient onboarding process&lt;/a&gt;. It is crucial to make new developers contribute to the team as soon as possible. Unfortunately, sooner or later people quit. This is also something our team should prepare for.&lt;/p&gt;

&lt;p&gt;Most of the time, employees and contractors have a notice period which lasts usually from two weeks to three months. This might seem like enough time to transfer knowledge and duties, but my experience shows that it’s never enough.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prepare for the offboarding period
&lt;/h1&gt;

&lt;p&gt;When an experienced person brings their resignation letter, often a panic mode starts within the team. Suddenly everyone wants something and the person who quits has a really busy time.&lt;/p&gt;

&lt;p&gt;Sometimes, ambition strikes. Knowing that the days of our current job are counted, we can fall into &lt;strong&gt;a mania of fixing everything&lt;/strong&gt;. This can bring &lt;strong&gt;too much chaos&lt;/strong&gt; into the team and the resulting value is not worth it. If you suddenly decide to update all libraries in the system, you can break a lot of things and drag people away from their current tasks.&lt;/p&gt;

&lt;p&gt;There is a simple way to avoid such an “offboarding rush”. &lt;strong&gt;Your team should perform regular documentation updates, automate manual tasks, write tests and don’t wait too long with refactoring bad code&lt;/strong&gt;. This should be a routine, not an exception.&lt;/p&gt;

&lt;p&gt;You should avoid the so-called &lt;a href="https://www.investopedia.com/terms/s/silo-mentality.asp"&gt;knowledge silos&lt;/a&gt;. It’s inevitable that developers in your team will specialize in different parts of the system, and that’s ok. However, you should &lt;strong&gt;foster information exchange&lt;/strong&gt; whenever feasible. This includes proper knowledge base, commit messages, branch names, issue descriptions, chat groups/channels etc.&lt;/p&gt;

&lt;p&gt;If you create a &lt;strong&gt;hack or workaround&lt;/strong&gt; somewhere, under time pressure, then at least &lt;strong&gt;describe it in a visible place&lt;/strong&gt;. Other people will be aware of that hack’s existence when you’re not around. I’ve witnessed a lot of situations when experienced people left a lot of hacks even on production servers and then just quit. Such &lt;strong&gt;hacks break in the least appropriate time&lt;/strong&gt;, like a peak of a sales season.&lt;/p&gt;

&lt;p&gt;The same goes with &lt;strong&gt;every manual task&lt;/strong&gt; done by a particular person, like manual deployment, setting up repositories and so on. These should be at least documented, so that someone can take over such duties. The best way is to automate as much as possible in a clean and descriptive manner.&lt;/p&gt;

&lt;p&gt;Easy to say, huh? But developers often postpone maintenance tasks which are not a part of the client’s requirements. If stakeholders don’t yell at you when you don’t ship unit tests on time, then… you postpone them. They won’t complain about your internal documentation either. Stakeholders aren’t interested if your workplace is clean or dirty if they get a working product. But &lt;strong&gt;things can break soon if you don’t clean your mess!&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Make a good use of the time that’s left
&lt;/h1&gt;

&lt;p&gt;When the date of somebody’s departure is set, the whole team should decide how to spend the remaining time. You can organize &lt;strong&gt;knowledge sharing meetings or pair programming sessions&lt;/strong&gt;. You can sit and discuss &lt;strong&gt;refactoring ideas&lt;/strong&gt; that could be realized in the future. An experienced developer might share thoughts about further product development and possible problems.&lt;/p&gt;

&lt;p&gt;Focus on the most important and valuable activites. As I said before, &lt;strong&gt;don’t try to fix everything at once&lt;/strong&gt;. Also, a person that is about to quit should not do any more tasks on his or her own. The offboarding time should be spent on supporting the team.&lt;/p&gt;

&lt;h1&gt;
  
  
  Be honest but polite
&lt;/h1&gt;

&lt;p&gt;Quitting a job is often preceded by months or even years of frustration. There can be a lot of reasons for that, and when you finally make the decision to leave, you probably think it’s the only solution left.&lt;/p&gt;

&lt;p&gt;In the first years of my career I made a mistake of not being honest about my work expectations, like salary or duties. Employment is all about two parties getting along with each other. You shouldn’t be afraid to talk honestly to your boss.&lt;/p&gt;

&lt;p&gt;However, &lt;strong&gt;don’t burn bridges&lt;/strong&gt;. You never know what happens in the future. Maybe you’ll meet your boss again in another company? Maybe some day you’ll receive an interesting offer from your superior?&lt;/p&gt;

&lt;p&gt;Also, be polite and &lt;strong&gt;do not spread your frustration&lt;/strong&gt; everywhere. Your team might still contain new, enthusiastic people. Don’t take their motivation away.&lt;/p&gt;

&lt;h1&gt;
  
  
  Be responsible
&lt;/h1&gt;

&lt;p&gt;The way people quit a job tells a lot about their social skills and emotional intelligence. Also, the way a team deals with people leaving the workplace speaks a lot about its practices. We all need to be responsible, mature and polite, so we can avoid sudden stress caused by someone quitting.&lt;/p&gt;


</description>
      <category>hr</category>
      <category>softskills</category>
      <category>offboarding</category>
      <category>team</category>
    </item>
    <item>
      <title>Do we still need recruitment agencies?</title>
      <dc:creator>Piotr Horzycki</dc:creator>
      <pubDate>Sat, 14 Apr 2018 09:41:29 +0000</pubDate>
      <link>https://dev.to/peterdev/do-we-still-need-recruitment-agencies-4gpk</link>
      <guid>https://dev.to/peterdev/do-we-still-need-recruitment-agencies-4gpk</guid>
      <description>&lt;p&gt;As a candidate looking for jobs, I've never cooperated with any recruitment agencies. But as a senior developer responsible for tech interviews, I was forced to work with some HR companies and I had some really weird situations because of that. Sometimes it's annoying, sometimes it just makes me laugh. Anyway, due to my bad experiences it's hard for me to find any reason to pay commission to an HR/talent agency. I've always disliked "men-in-the-middle". Yet, many companies seek talents through agencies in addition to their own headhunting struggles.&lt;/p&gt;

&lt;p&gt;Let me briefly explain a standard recruitment process we developed in our company. We didn't have an HR department, so the whole process was led by me and CTO. First, I prepared a job offer which would reflect our current needs. Then, the CTO posted that offer on various platforms. We received different resumes and reviewed them. If you did not have a meaningful GitHub profile, we usually asked to do our simple recruitment task: write a PHP shopping cart implementation for existing unit tests; kind of TDD, most people solved it under 4 hours. We also sent some technical questions to see if we don't waste your (and our) time meeting you at the office. Especially if you lived several hundred miles away. If we liked your answers and the solution to our task, we would invite you to a personal meeting (around 1.5 hour) consisting of a soft interview and tech interview. Finally, you could receive an offer from us... and turn it down if you did not like it.&lt;/p&gt;

&lt;p&gt;Simple, isn't it? Just two parties making business with each other. We are the client and we buy services that you provide. We negotiate the deal and if everyone's happy, just tell us when you can start. The description I mentioned is generic; we tried to approach every candidate individually according to the provided materials, proven experience and a lot of other factors. You didn't have to solve our coding task if you found another way to show off. Fun fact: we've never cared about your formal education.&lt;/p&gt;

&lt;p&gt;Unfortunately the resumes we received from job board users were not enough and because the company did not want to invest its money in greater headhunting endeavors like going to conferences or recruiting a full-time HR guy, well... it decided to use some help from external HR agencies. We would present our needs to the agency and it was supposed to find right people for the job. We received a written recommendation for every candidate. After successfully hiring an employee, the company paid commission to the agency.&lt;/p&gt;

&lt;h1&gt;
  
  
  How recruiting with agencies went wrong
&lt;/h1&gt;

&lt;p&gt;I wouldn't moan if those companies did their job well, but what I experienced instead was:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The recommendations were generic and useless. Every candidate was described as a positive, pro-active team player who aims for personal development. Blah, blah, blah. If you stripped that BS, you would find out that you're dealing with a mediocre coder with a boring portfolio. Both the company and the candidate wasted time talking to the agency because one way or another, we had to figure out most things for ourselves. The most interesting facts were those off the record.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One agency used to save these recommendations as DOCX files. I work on Ubuntu and LibreOffice did not properly render those files, throwing some contents away from the page. I had to switch to Windows, launch Microsoft Word, prepare myself a PDF file and switch back. Eventually, the HR guys learned how to create PDF themselves. What a relief.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fk2zna3qgk9m5ukphjuqz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fk2zna3qgk9m5ukphjuqz.jpg" alt="How do I convert to PDF?"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The same agency stripped my recruitment task. It originally was a GitHub repo which consisted of some important files in the root directory (&lt;code&gt;composer.json&lt;/code&gt;, &lt;code&gt;docker-compose.yml&lt;/code&gt;, &lt;code&gt;phpunit.xml.dist&lt;/code&gt; and - most important - &lt;code&gt;README.md&lt;/code&gt;!) and a &lt;code&gt;tests&lt;/code&gt; directory. You had to write a simple implementation which passed all of my tests. I surprisingly found out that all candidates sent by that agency rewrote &lt;code&gt;composer.json&lt;/code&gt; on their own. I asked them: "Why would you do that? The whole autoloader was defined there!." It turned out that the agency sent the candidates only the &lt;code&gt;tests&lt;/code&gt; directory. They did not send the full repo, of course - the candidate could find out what company made that task. The target company's name is top secret in the beginning - and I recklessly used it as a vendor part of PSR-4 namespaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The situation with missing &lt;code&gt;composer.json&lt;/code&gt; involved also one candidate which was so tired of endless meetings with an agency that - after learning what company is he applying to - he declined to cooperate with the agency and sent his resume directly to us. I didn't know that story and I was surprised to see that he already solved our task.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Speaking of endless meetings - that's the thing I always hear if someone decides to share his or her experience with an HR agency. When you see a fancy job ad like "For our client, a market leader..." and you send your resume, you're invited to an entry interview in the agency HQ. Then you receive our task to do at home. Then they invite you to another meeting... but not with us! If that meeting succeeds, you eventually make your way to our facility. You go there and probably hear the same questions you've already answered in the previous meetings, because the incompetent agency did not properly sum up your answers and we don't have enough data about you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sometimes we don't receive a full resume, but only a solved task (kind of a blind recruitment). Sometimes we receive a resume with a surname washed out. Sometimes we receive only the recommendation and not the original resume.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sometimes a candidate is forced to visit the target company together with a guy from HR, who ensures that we don't make a deal behind their back and we don't abuse you. To me it's like coming to an interview with your dad! He's a man-in-the-middle. It's not a deal between an employee and an employer. Fortunately, your "dad" stays only for a "soft interview" and he walks away during the tech interview (which I lead). He goes for a coffee and waits there until we're done. So basically he gets paid for drinking coffee in our office.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's funny to see how an extravert, upbeat HR guy brings a terrified candidate to the meeting. At the first glance I would hire the HR guy, not a shy, scared dev.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;My coworker received an offer for my position from an agency when I decided to leave the company.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;My boss received an offer from an agency to hire a colleague who was just about to leave the company.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you get hired and work for a while, the agency calls you from time to time to ask how is it going. That's what my coworkers told me. As an employee, I would find this annoying.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have no way to convince my soon-to-be-ex employer to stop wasting money with HR agencies (or invest in the right one). But I still wonder why good devs in Poland respond to the job ads posted by agencies where you don't have a target company's name disclosed. The salary range is not specified either. If I invest my time talking to the HR guy, I would like to know in advance who am I going to work for and what salary I can expect!&lt;/p&gt;

&lt;h1&gt;
  
  
  Carving my own path
&lt;/h1&gt;

&lt;p&gt;Like I said in the beginning, I have never looked for a job through an agency. I have some basic googling skills, but let me show you a brief story of my career which provides some more tips:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I met my first employer during high school. It was a local news company. My friend had already worked for them and he asked if I could make some photos at local events. Still being a student, I started my humble photography career in my spare time. After my high school exams (Polish &lt;em&gt;matura&lt;/em&gt;) and before going to university, I got a permanent job offer. They discovered I can code PHP for food, so they hired me to work on their new website during the day AND make photos in the evenings. Weird setup, but this job gave me a lot of life experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After five years, I met my future girlfriend. I decided to relocate to Gdańsk which is ~300 km away from my hometown. I started browsing pracuj.pl, a Polish job board and soon I found an offer from an education company. I sent my resume, did a recruitment task and after three weeks I got an offer! I've been working there for over four years. During that time, my salary has doubled and I went from a mid developer to a team leader.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Me and my girlfriend decided to change our lifestyles and travel more. I needed a full remote job. I remember meeting a nice software house at a PHPers conference in Poznań. I sent my resume. Unfortunately they just stopped their recruitment process at a time. But after a month I received an e-mail inviting me to a new process, which I passed successfully. I had three interviews via phone and Skype: entry, tech and soft skills. I really liked all those interviews. One of my interviewers said he saw my PHPers presentation about database optimization and he already knew my name. I got the offer with a salary which allows me to live decently, buy more music equipment (oh yeah!) and even save money for retirement.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see, my ~10 years career as a developer did not include any deals with any recruitment agencies. It is important to say that I'm not an easy-going, upbeat and extravert person. I'm not good at getting my foot in the door, but at least I've learned how to create my resume properly, find a possible employer and make him interested in my offer. I've spent a lot of time browsing Polish nofluffjobs board where all the offers are plain and simple, with salary specified upfront.&lt;/p&gt;

&lt;p&gt;What's more to do? I guess I should visit more conferences and give more talks, so that people will know my name. I should write more blog posts and possibly contribute to Open Source. That way I'm going to develop my personal brand and hopefully do my business stuff without the HR agencies.&lt;/p&gt;

&lt;p&gt;If you work in an HR/talent agency, please improve your skills. I know that IT headhunting is very hard and it might be really frustrating to abuse LinkedIn for the whole day just to receive a bunch of rude replies (or no replies at all). But if you want to do a good job as a headhunter, you need to understand how candidates and companies behave and what they really need. We're all here to make business happen, right?&lt;/p&gt;

&lt;p&gt;I gained all of the above experiences living in Poland. I would love to hear from you guys how the job market looks like in other countries. Feel free to comment!&lt;/p&gt;

</description>
      <category>hr</category>
      <category>recruitment</category>
      <category>career</category>
      <category>jobs</category>
    </item>
  </channel>
</rss>
