<?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: Pavel Gurkov</title>
    <description>The latest articles on DEV Community by Pavel Gurkov (@trueneu).</description>
    <link>https://dev.to/trueneu</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%2F113837%2Fe4cc4f99-ee01-4c03-89d1-143b75c048e5.png</url>
      <title>DEV Community: Pavel Gurkov</title>
      <link>https://dev.to/trueneu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/trueneu"/>
    <language>en</language>
    <item>
      <title>Question: How many of you google basic things for your language after several years of experience?</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Fri, 23 Apr 2021 15:46:58 +0000</pubDate>
      <link>https://dev.to/trueneu/question-how-many-of-you-google-basic-things-for-your-language-after-several-years-of-experience-2pej</link>
      <guid>https://dev.to/trueneu/question-how-many-of-you-google-basic-things-for-your-language-after-several-years-of-experience-2pej</guid>
      <description>&lt;p&gt;What I mean is, say you're a Javascript, or Python, or C programmer. How many of you google how to write a for loop in your language regularly, despite having used it for several years? Or a while loop, or a subscription operator, or something basic like that.&lt;/p&gt;

&lt;p&gt;The reason I'm asking is just to understand the general trend.&lt;/p&gt;

</description>
      <category>development</category>
      <category>people</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Stop living in a bubble</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Thu, 11 Mar 2021 23:36:08 +0000</pubDate>
      <link>https://dev.to/trueneu/stop-living-in-a-bubble-339m</link>
      <guid>https://dev.to/trueneu/stop-living-in-a-bubble-339m</guid>
      <description>&lt;p&gt;Stop being self-important.&lt;/p&gt;

&lt;p&gt;Stop seeking for acceptance.&lt;/p&gt;

&lt;p&gt;Stop seeking for approval.&lt;/p&gt;

&lt;p&gt;Stop denying you may be not interesting to people.&lt;/p&gt;

&lt;p&gt;That things you work on may be not interesting to people.&lt;/p&gt;

&lt;p&gt;That your opinions may be not interesting to people.&lt;/p&gt;

&lt;p&gt;Your value is not derived from the amount of likes.&lt;/p&gt;

&lt;p&gt;Or the amount of followers.&lt;/p&gt;

&lt;p&gt;Or the amount of interest.&lt;/p&gt;

&lt;p&gt;You're the one deciding your own value.&lt;/p&gt;

&lt;p&gt;If you're living in a real world you know a few things.&lt;/p&gt;

&lt;p&gt;Not everybody's nice.&lt;/p&gt;

&lt;p&gt;Not everybody likes you.&lt;/p&gt;

&lt;p&gt;Not everybody shares your views.&lt;/p&gt;

&lt;p&gt;Not everybody thinks you're smart.&lt;/p&gt;

&lt;p&gt;Should you care?&lt;/p&gt;

&lt;p&gt;No. That's all okay.&lt;/p&gt;

&lt;p&gt;The only thing you should care about is your own critical thinking.&lt;/p&gt;

&lt;p&gt;Your own analytical mind.&lt;/p&gt;

&lt;p&gt;Your own moral grounds.&lt;/p&gt;

&lt;p&gt;Your own attitude.&lt;/p&gt;

&lt;p&gt;Your own views.&lt;/p&gt;

&lt;p&gt;Your own analysis and synthesis.&lt;/p&gt;

&lt;p&gt;And acceptance that not everybody does, or ever will, accept you.&lt;/p&gt;

&lt;p&gt;Stop being defensive.&lt;/p&gt;

&lt;p&gt;Stop living in a bubble where everybody's your friend.&lt;/p&gt;

&lt;p&gt;Not everybody supports you.&lt;/p&gt;

&lt;p&gt;Not everybody roots for you.&lt;/p&gt;

&lt;p&gt;And that’s okay. &lt;/p&gt;

&lt;p&gt;Find allies you can truly rely on,&lt;/p&gt;

&lt;p&gt;and pop the bubble.&lt;/p&gt;

&lt;p&gt;(cover image copyright belongs to Michele K. Short/HBO)&lt;/p&gt;

</description>
      <category>people</category>
      <category>community</category>
      <category>acceptance</category>
      <category>behavior</category>
    </item>
    <item>
      <title>Tutorials considered harmful</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Tue, 02 Mar 2021 21:08:00 +0000</pubDate>
      <link>https://dev.to/trueneu/tutorials-considered-harmful-4onc</link>
      <guid>https://dev.to/trueneu/tutorials-considered-harmful-4onc</guid>
      <description>&lt;p&gt;Disclaimer: everything below is just my opinion. I’m an engineer with about 10 years of experience, I worked for small shops, medium-sized firms and large corporations, communicated with a lot of people and read a countless number of articles on tech. Below is my view on a particular aspect I run into on daily basis, whether reading or talking to people. I might be totally wrong, and if you want to discuss it, let's do so in the comments section.&lt;/p&gt;

&lt;p&gt;First of all, let’s establish some well-known facts about learning and acquiring knowledge.&lt;/p&gt;

&lt;h1&gt;
  
  
  Learning
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gZK4AOa5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://imgs.xkcd.com/comics/study.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gZK4AOa5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://imgs.xkcd.com/comics/study.png" alt="https://xkcd.com/749/" title="https://xkcd.com/749/"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;a href="https://xkcd.com/749/"&gt;https://xkcd.com/749/&lt;/a&gt;



&lt;p&gt;One of the qualities defining Homo Sapiens is curiosity. Essentially, being curious equals being hungry for knowledge. Now, any living organism is interacting with environment in some way, and one can define curiosity as a mere 'will to live'. Those who didn't adapt to changing environment well and fast enough, are extinct, and were not curious enough. Those who did, were curious, were striving, were successful and thus prosper. But I mean something a bit more specific: curiosity is the interest in how things work as opposed to just using things. Dive deep, if I may.&lt;/p&gt;

&lt;p&gt;Little children feed their curiousity by tearing apart dolls and toy cars to look what's inside. It's especially interesting if a toy has a lot of moving parts: a child comes up with certain assumptions how pieces fall together, builds a hypothesis and may try to prove or disprove it. Let's take this part out and re-assemble the car without it, will my car still run?&lt;/p&gt;

&lt;p&gt;In a sense, that's what we're doing in our professional lives every day (except our objects aren't toys). We disassemble - in a broad sense - stuff, reassemble it in different order, poke bits and bytes with a stick, play around with different systems and read source code to get a better understanding how things work under the hood. We do that to be able to use things more effectively, and to feed our natural curiosity. IT as a field is great for this type of hunger: the amount of information is so vast that there's enough for a bunch of peoples lifetimes.&lt;/p&gt;

&lt;p&gt;There's another way of gaining knowledge without necessarily having to experiment yourself, namely formal education. You have teachers, or professors, which are - at least, supposedly - masters of their fields. They present the information in a well-structured, systematic way, starting from fundamental, basic and simple knowledge, all the way up to highly complicated and often abstract concepts. The media can differ: lectures, books, VOD courses, webinars, etc. Although you can't exactly call it 'formal' if you're not supervised by a trained teacher, I'd still very much consider it 'education' if you're reading a book written by that teacher.&lt;/p&gt;

&lt;h1&gt;
  
  
  Fundamental Knowledge Importance
&lt;/h1&gt;

&lt;p&gt;My humble opinion is our industry as a whole took a wrong turn sometime in the 90s. It's been worsening year after year ever since, and there's seemingly no end to it. What am I talking about? Let me give you an analogy.&lt;/p&gt;

&lt;p&gt;OK, so imagine a surgeon. This particular surgeon has worked for certain hospitals throughout her career. She has a nice resume, soft-skills and hard-skills, years of experience and overall, a good record and a good salary. But there's a problem.&lt;/p&gt;

&lt;p&gt;She doesn't know how the human body works as a whole. See, she's a knee surgeon. She knows everything about knees. She has seen thousands of different knees of different sizes, shapes and ages. If you have a knee problem, there's no one that can treat you better. But here's a catch: if during a surgery something else goes wrong, say your heart starts to give in all of sudden, or your lungs malfunction, or a blood knot gets into the bloodstream... You're toast. She doesn't know what to do in these types of situations, and she'll desperately need help from another doctor. But under the time constraints, chances are when the help arrives, it's time to call it. Sorry. She's just a knee surgeon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_fiB3hLy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://upload.wikimedia.org/wikipedia/commons/f/fa/Therac-25.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_fiB3hLy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://upload.wikimedia.org/wikipedia/commons/f/fa/Therac-25.jpg" alt="Medical equipment actually kills people from time to time. Source: https://en.wikipedia.org/wiki/Therac-25"&gt;&lt;/a&gt;&lt;/p&gt;
Medical equipment actually kills people from time to time. Source: &lt;a href="https://en.wikipedia.org/wiki/Therac-25"&gt;https://en.wikipedia.org/wiki/Therac-25&lt;/a&gt;



&lt;p&gt;Does it sound absurd to you? If it doesn't, it should. This is the kind of the vibe I get from the absolute majority of developers nowadays. Sure, they know their knees - a language, a framework, an API - and they've probably mastered that particular tool. But they have no idea how the body - the environment around - works. Just the basics would be enough. But a lot of people have no clue how the CPU works, or how scheduling works, or what's a process state, or what's a process even, or how virtual memory works, or a filesystem, or dozen of other things they actually use every day in their professional lives. I mean, you don't have to know how a car works to drive it, but we're kind of car mechanics here. Things go wrong every day, and we have to debug and troubleshoot stuff every day, and the better we understand the ins and outs, the better we can diagnose the problem, the better we can follow it up so it never resurfaces again. Without understanding, our fixes are merely band-aids. They help now, but in a week or two they're gonna be obsolete. And the wound will bleed even worse, because computers don't self-heal.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tutorials
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--60JFaf72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://imgs.xkcd.com/comics/walkthrough.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--60JFaf72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://imgs.xkcd.com/comics/walkthrough.png" alt="https://xkcd.com/744/"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;a href="https://xkcd.com/744/"&gt;https://xkcd.com/744/&lt;/a&gt;



&lt;p&gt;A large portion of content one can find on the web about information technologies is tutorials. Usually, a step-by-step list on how to achieve this particular thing, without digging too deep into details, or explaining the rationale behind steps taken. More often than not, tutorials are written in a specific way with a lot of assumptions, for example that everything else around is set to default. More often than not, tutorials are written by people that just have achieved something themselves, and are eager to share their knowledge with the world.&lt;/p&gt;

&lt;p&gt;While inherently sharing knowledge is a good thing, and I can't not support it, I'm questioning the whole idea. The quality of the information in this case is often sub-par. The reason is that the person has just learned something herself: she didn't put enough time in to truly understand it, to experiment with it, to try 9 more different approaches and come to the conclusion that the 7th is the best. There's no attention to details, as the person is not aware there are details. It reminds me of Dunning-Kruger effect: the less you know about something, the more likely you are to be victim to the cognitive bias of overestimating your knowledge. It's not necessarily because you're intentionally ignorant: you just don't know any better, at least yet.&lt;/p&gt;

&lt;p&gt;This creates the soil for such incomplete knowledge adoption. It's one thing to write a tutorial, but if it's taken as a Holy Grail by readers... Oh boy. System administrators in ex-USSR countries had this joke about 10-15 years ago: there's this site with a great amount of tutorials on FreeBSD, lissyara.su. There was a generation of young sysadmins using the site as a bible, and not having read anything else. As a result, the moment they encountered something not covered in tutorials, they were completely stuck. So when a person demonstrated a lot of practical skills without any fundamental knowledge whatsoever, people would call him a "lissyara adept", or just "lissyara", in a diminishing way. Without understanding how things work, you can't repair anything. It's like giving crutches right away instead of treating the fracture.&lt;/p&gt;

&lt;p&gt;There's a reason why a professor usually has years of experience in the field, ideally she has her own course and own textbook and own set of assignments. She knows the subject in and out, so she can, based on knowledge and experience, tell important from unimportant, structure the information in a digestable way, and pitch it right. Most tutorial authors don't have any of that. Why would they? They've learned the concept a day ago themselves! They're just translating stuff as is, there's no capability to restructure it or rethink it or tell it from a different point of view. If there are factual errors, or some important detail is omitted, or the article is plain wrong - the author just doesn't know that. So the author translates erroneous knowledge further... multiplying and amplifying it.&lt;/p&gt;

&lt;p&gt;And that's why I consider writing, and especially reading, tutorials harmful.&lt;/p&gt;

&lt;h1&gt;
  
  
  A Way Out?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CyYE3Op1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://imgs.xkcd.com/comics/tv_problems.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CyYE3Op1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://imgs.xkcd.com/comics/tv_problems.png" alt="https://xkcd.com/1760/"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;a href="https://xkcd.com/1760/"&gt;https://xkcd.com/1760/&lt;/a&gt;



&lt;p&gt;Fundamental knowledge is king. Sure, tear apart the toy car and try to reason about what the insides do, but don't post a "that's how you do it" article right after that. Make a hypothesis, try to prove it or disprove it, and fact-check in a more formal, theoretical form: read a book, listen to a university course, or talk to a known professional engineer, to ensure that your understanding conforms with reality. Get more knowledge on the topic, on the adjacent subjects. Better to do all of the above. Maybe a couple of times. Foster your inner child and its natural curiousity! And feed it, feed it until you're sick, and then feed it more.&lt;/p&gt;

&lt;p&gt;It should be fun to go "oh, so that's why CPUs have protected mode and real mode!", "oh, so that's how a bootloader works!", "oh, so that's how Load Average is computed!", "oh, that's why I can't utilize my network bandwidth!", "oh, that's how JS layouts memory!" and so on. And once you get that, inside and out, that's a good article stuff. And go out there and share and write it, because the web is lacking high quality materials.&lt;/p&gt;

&lt;p&gt;Santayana said "Those who cannot learn from history are doomed to repeat it". This applies surprisingly well to a lot of aspects of life. And no one will ever be able to learn absolutely everything. But something is better than nothing.&lt;/p&gt;

&lt;p&gt;In the end, you probably don't want to be that surgeon that teaches their students about knees, only to find out 20 years later that the death toll was way too high because students couldn't tell liver from bladder. Or a battery from an engine. Or running from uninterruptible. Or page in from page out. Well, you get the idea.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>education</category>
      <category>development</category>
      <category>opinion</category>
    </item>
    <item>
      <title>double precision: subtleties leading to incorrectness</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Sat, 04 Jul 2020 17:01:37 +0000</pubDate>
      <link>https://dev.to/trueneu/double-precision-subtleties-leading-to-incorrectness-5dd3</link>
      <guid>https://dev.to/trueneu/double-precision-subtleties-leading-to-incorrectness-5dd3</guid>
      <description>&lt;p&gt;I was solving some entry-level problems on &lt;a href="https://codewars.com"&gt;codewars&lt;/a&gt;, one of the many resources dedicated to helping programmers practice. There was one very easy problem that I solved in 5 minutes... As it turned out, solution was incorrect, but all the tests passed. :) I got thinking about it and didn't move on for the next couple of hours.&lt;/p&gt;

&lt;p&gt;It's stated in the following way:&lt;br&gt;
Given a &lt;code&gt;long long&lt;/code&gt; integer &lt;code&gt;N&lt;/code&gt;, write a function, that&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if &lt;code&gt;N&lt;/code&gt; is a perfect square (meaning there's integer &lt;code&gt;n&lt;/code&gt; which satisfies &lt;code&gt;n^2=N&lt;/code&gt;), return &lt;code&gt;(n+1)^2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;if &lt;code&gt;N&lt;/code&gt; is not a perfect square, return &lt;code&gt;-1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sounds really simple, right? Just as simple as FizzBuzz. But it's actually a bit more complicated than this.&lt;/p&gt;

&lt;p&gt;The actual correct solution is not the aim of this article, and it's relatively easy to come up with one once you understand the shortcomings of dirty-and-fast version.&lt;/p&gt;

&lt;p&gt;So how would one solve that?&lt;/p&gt;

&lt;p&gt;The vast majority, I believe (at least based on what I saw on codewars itself), will come up with something like (let's think c++):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include &amp;lt;cmath&amp;gt;
&lt;/span&gt;
&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What can possibly go wrong here?&lt;/p&gt;

&lt;p&gt;First, let's make a couple of sensible assumptions. &lt;code&gt;double&lt;/code&gt; and &lt;code&gt;long long&lt;/code&gt; are both 64-bit wide, and &lt;code&gt;double&lt;/code&gt; is implemented adhering to &lt;a href="https://en.wikipedia.org/wiki/IEEE_754"&gt;IEEE 754&lt;/a&gt; standard.&lt;/p&gt;

&lt;p&gt;When in the first line of our function we invoke &lt;code&gt;std::sqrt(N)&lt;/code&gt;, &lt;code&gt;N&lt;/code&gt; gets implicitly converted to &lt;code&gt;double&lt;/code&gt;. Due to how &lt;code&gt;double&lt;/code&gt; is implemented, it may lead to precision loss.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nUa_CVkP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.researchgate.net/profile/JD_Bakos/publication/220782372/figure/fig1/AS:393932719575046%401470932287967/IEEE-754-Double-Precision-Floating-Point-Format.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nUa_CVkP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.researchgate.net/profile/JD_Bakos/publication/220782372/figure/fig1/AS:393932719575046%401470932287967/IEEE-754-Double-Precision-Floating-Point-Format.png" alt=""&gt;&lt;/a&gt;&lt;a href="https://www.researchgate.net/profile/JD_Bakos/publication/220782372/figure/fig1/AS:393932719575046@1470932287967/IEEE-754-Double-Precision-Floating-Point-Format.png"&gt;source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The number encoded by the standard may be written as &lt;code&gt;(-1)^s * (2^e) * (1 + m)&lt;/code&gt;, where &lt;code&gt;s&lt;/code&gt; equals to sign bit value, &lt;code&gt;e&lt;/code&gt; is encoded by exponent bits and &lt;code&gt;m&lt;/code&gt; is encoded by significand bits. We're omitting here some special cases such as denormalized and special values like &lt;code&gt;Inf&lt;/code&gt; and &lt;code&gt;NaN&lt;/code&gt;, as they're irrelevant to the problem. &lt;code&gt;m&lt;/code&gt; is encoded as a fractional part of the number with implied 1 before the decimal point, e.g. &lt;code&gt;10000...000&lt;/code&gt; significand bits encode decimal &lt;code&gt;1.5&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now the question is, what is the largest integer number that may be represented by &lt;code&gt;double&lt;/code&gt; without loss of precision, with all the integer numbers less than that also may be represented as such?&lt;/p&gt;

&lt;p&gt;Let's look at &lt;code&gt;2^53&lt;/code&gt; (52 bits + 1 leading &lt;code&gt;1&lt;/code&gt;). It can be stored for sure, all zeroes in significand bits and &lt;code&gt;e&lt;/code&gt; representing &lt;code&gt;53&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What about &lt;code&gt;2^53+1&lt;/code&gt;? We have &lt;code&gt;e&lt;/code&gt; still giving us &lt;code&gt;2^53&lt;/code&gt;, but now we have to add a &lt;code&gt;1&lt;/code&gt; to the right of significand bits. The thing is, it's not sufficient to have 52 bits for that, we need 53. Intuitive way to think of it is to think of exponent as right shift. Significand bits &lt;code&gt;00000...000&lt;/code&gt; * &lt;code&gt;2^53&lt;/code&gt; encodes &lt;code&gt;2^53&lt;/code&gt;, but to encode &lt;code&gt;2^53+1&lt;/code&gt;, we don't have enough width available. There's no problem with &lt;code&gt;2^53+2&lt;/code&gt;, however - the rightmost available bit is sufficient now.&lt;/p&gt;

&lt;p&gt;Similarly, all the numbers below &lt;code&gt;2^53&lt;/code&gt; have sufficient bit width to be encoded without any loss of precision.&lt;/p&gt;

&lt;p&gt;Guess now you get the idea: if &lt;code&gt;N&lt;/code&gt; supplied to our function is greater than &lt;code&gt;2^53&lt;/code&gt;, we're not guaranteed at all to successfully determine if that's a perfect square or not due to possible precision loss.&lt;/p&gt;

&lt;p&gt;But it gets even funnier!&lt;/p&gt;

&lt;p&gt;If we pass a "magical number" &lt;code&gt;(2^26 + 1) * (2^26 + 1) - 1&lt;/code&gt; to our function, it'll happily follow the "perfect square" path. The fractional part of &lt;code&gt;sqrt(N)&lt;/code&gt; will be zero. Why? This number is well below &lt;code&gt;2^53&lt;/code&gt;, so there's no precision loss due to conversion.&lt;/p&gt;

&lt;p&gt;The trick is that the delta against the perfect square here reduces the square root by around &lt;code&gt;2^-27&lt;/code&gt; (derivative of &lt;code&gt;f(x)=x^(1/2)&lt;/code&gt; is &lt;code&gt;f'(x)=1/(2*x^(1/2))&lt;/code&gt;). It happens to be about &lt;code&gt;2^53&lt;/code&gt; times smaller than the actual result (which is just above &lt;code&gt;2^26&lt;/code&gt;). Again, we're facing the limit of double precision here, right on the edge.&lt;/p&gt;

&lt;p&gt;As you could guess, it's not the only "magical number" leading to incorrect results. Try &lt;code&gt;2^26 + 2&lt;/code&gt; or &lt;code&gt;2^26 + 3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So, our little program there is incorrect. As it was stated before, it's not the point to provide correct solution here, but here's a thought: we could use integer arithmetics strictly to make it correct. Making it efficient however is a whole another problem.&lt;/p&gt;

&lt;p&gt;There's also &lt;code&gt;long double&lt;/code&gt; type, which may or may not be implemented as 80-bit (or more) wide floating point number. Its 63 fraction bits are sufficient for maintaining 64-bit integers conversions; furthermore, it's sufficient to encode those errors that make not-so-perfect squares look perfect. But that's only if you're lucky and &lt;code&gt;long double&lt;/code&gt; isn't just a &lt;code&gt;double&lt;/code&gt; synonym.&lt;/p&gt;

&lt;p&gt;The main point here is that if the program is incorrect only for a handful of corner cases, it can't be considered correct as a whole. And sometimes to identify those corner cases, you have to think about implementation of low-level details all the way down to hardware.&lt;/p&gt;

&lt;p&gt;Bonus (if you think it's somehow restricted to c/c++):&lt;/p&gt;

&lt;p&gt;Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="mf"&gt;2.7&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Oct&lt;/span&gt;  &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;2017&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="mi"&gt;4503599761588224&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4503599761588224&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mf"&gt;67108865.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Golang:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"math"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%f"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;4503599761588224&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;67108865.000000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4503599761588224&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="mi"&gt;67108865&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;etc.&lt;/p&gt;

</description>
      <category>ieee754</category>
      <category>double</category>
      <category>programming</category>
      <category>development</category>
    </item>
    <item>
      <title>My comment was marked as violating code of conduct. Why?</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Tue, 12 Mar 2019 13:30:59 +0000</pubDate>
      <link>https://dev.to/trueneu/my-comment-was-marked-as-violating-code-of-conduct-why-16og</link>
      <guid>https://dev.to/trueneu/my-comment-was-marked-as-violating-code-of-conduct-why-16og</guid>
      <description>&lt;p&gt;How can I find out the reason? Who do I ask? How do I find one to ask? I'm really curious.&lt;br&gt;
Ideally, I'd like to have the ability to talk to the person that decided so. Their identity is not important.&lt;/p&gt;

</description>
      <category>help</category>
    </item>
    <item>
      <title>My comment was marked as violating code of conduct. Why?</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Tue, 12 Mar 2019 13:29:25 +0000</pubDate>
      <link>https://dev.to/trueneu/my-comment-was-marked-as-violating-code-of-conduct-why-4blo</link>
      <guid>https://dev.to/trueneu/my-comment-was-marked-as-violating-code-of-conduct-why-4blo</guid>
      <description></description>
      <category>meta</category>
    </item>
    <item>
      <title>Can I filter out certain tags from my feed?</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Tue, 13 Nov 2018 14:03:40 +0000</pubDate>
      <link>https://dev.to/trueneu/can-i-filter-out-certain-tags-from-my-feed-36jg</link>
      <guid>https://dev.to/trueneu/can-i-filter-out-certain-tags-from-my-feed-36jg</guid>
      <description>&lt;p&gt;Pretty self-descriptive: I want certain tags &lt;em&gt;never&lt;/em&gt; to appear in my feed. Any way to achieve that?&lt;/p&gt;

</description>
      <category>help</category>
    </item>
    <item>
      <title>Keyboard-driven productivity in macOS</title>
      <dc:creator>Pavel Gurkov</dc:creator>
      <pubDate>Sun, 11 Nov 2018 22:52:13 +0000</pubDate>
      <link>https://dev.to/trueneu/keyboard-driven-productivity-in-macos-5hak</link>
      <guid>https://dev.to/trueneu/keyboard-driven-productivity-in-macos-5hak</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ktbc0n9fvg0hkxeat80.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ktbc0n9fvg0hkxeat80.jpeg" alt="alt text" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Picture: Kinesis Advantage2 keyboard, &lt;a href="https://www.kinesis-ergo.com/shop/advantage2/" rel="noopener noreferrer"&gt;https://www.kinesis-ergo.com/shop/advantage2/&lt;/a&gt; . All rights reserved by Kinesis, it’s their trademarks, etc. Looks pretty cool, but I have some doubts on ⇧⌥⌘ shortcuts ergonomics&lt;/p&gt;

&lt;p&gt;This article was originally posted on Medium.com, &lt;a href="https://medium.com/@true.neu/keyboard-driven-productivity-in-macos-def201b6c8fa" rel="noopener noreferrer"&gt;https://medium.com/@true.neu/keyboard-driven-productivity-in-macos-def201b6c8fa&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  So hey, fellow developer.
&lt;/h1&gt;

&lt;p&gt;Or a devops, or sysadm, it doesn’t really matter.&lt;/p&gt;

&lt;p&gt;Have you ever wondered how much time and effort do you waste when reaching out to your pointer device throughout the day?&lt;/p&gt;

&lt;p&gt;Let’s make a wild assumption that you change your application in focus 100 times a day. From terminal emulator to IDE, then to messenger, then to browser, and back to terminal emulator, 25 cycles, and you do not use ⌘⇥ to do so. So each time you have to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove your hand from home row of your keyboard&lt;/li&gt;
&lt;li&gt;Reach to the mouse&lt;/li&gt;
&lt;li&gt;Find the current pointer location&lt;/li&gt;
&lt;li&gt;Point to the application you need and click&lt;/li&gt;
&lt;li&gt;Return you hand to the home row.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Assuming each individual action takes about 0.5 seconds, we have 2.5 seconds in total. Times 100, it’s a bit more than 4 minutes spent only to change focus. You might argue that it’s not a lot, compared to a standard 8-hour long workday. Well, add to that every time you need to reach mouse to change active tab in your browser, or click a menu item, or start an application, or to focus searchbar in the browser, or copy text from a terminal emulator. You probably won’t like your findings.&lt;/p&gt;




&lt;h1&gt;
  
  
  Now what can you do to fix this?
&lt;/h1&gt;

&lt;p&gt;Though I’ll be talking about software I use personally (namely macOS, Jetbrains IDEs, iTerm and Google Chrome), you may find a lot of things useful even if our favorites are not the same. For example,&lt;/p&gt;

&lt;h2&gt;
  
  
  Keyboard
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Touch typing
&lt;/h3&gt;

&lt;p&gt;There’s no arguing or pros and cons about that. If you don’t know how to touch type and using hunt-and-peck technique, or just memorized where each key is located and your hands resemble piano player’s hands, you’re either slow, or making a lot of typos, or (the most common case) both. There are exceptions of course, but in general you should learn to touch type as soon as possible.&lt;/p&gt;

&lt;p&gt;To put this a little bit into perspective, an average touch typer such as myself, types at 40-60 wpm. An average hunt-and-peck typer would have speed at 27–37 wpm (&lt;a href="https://blog.typing.com/hunt-and-peck/" rel="noopener noreferrer"&gt;https://blog.typing.com/hunt-and-peck/&lt;/a&gt;). This, of course, doesn’t mean you’ll produce twice as much code you’re producing today; but you’d half the time needed to respond to your colleagues in Slack. If you type 200 words each day (just a bit more than twice this paragraph), you’ll have 2.5 minutes more left to think about the function naming.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keyboard layout
&lt;/h3&gt;

&lt;p&gt;Think if your current keyboard layout is optimal for what you’re doing. Chances are you’re using standard QWERTY. As a person that doesn’t like his fingers to travel much away from the home row, frequently uses parenthesis, brackets and other characters which usually require pressing Shift + a digit, I opted for Programmer Dvorak layout (&lt;a href="https://www.kaufmann.no/roland/dvorak/" rel="noopener noreferrer"&gt;https://www.kaufmann.no/roland/dvorak/&lt;/a&gt;). You might find regular Dvorak or Colemak more appealing.&lt;/p&gt;

&lt;p&gt;I must say that there are some disadvantages of choosing a non-standard keyboard layout.&lt;/p&gt;

&lt;p&gt;You’ll have to learn it, it takes time and dedication, though it’s not as hard as learning to touch type for the first time, as you know the general technique already.&lt;br&gt;
You’ll have troubles typing on QWERTY keyboard, especially in case of Dvorak. Colemak is much more forgiving in that aspect, as it diverges not so drastically. Personally, I don’t think it matters much, as I don’t usually push people off their seats and type e-mails impersonating them. But you might have a different perspective on this one.&lt;br&gt;
You have to decide what to do with your shortcuts. For example, macOS has this peculiar ‘Dvorak + QWERTY-⌘’ layout, which changes your ⌘ layer to still use QWERTY, so ⌘C and ⌘V are in their old place. I don’t like this way, because well, okay, what do we do with ⌃ shortcuts then? ⌃⌘? And anyway, when your brain is trying to cope with new layout, it’s better to go all-in and let your C and V be on the same key regardless of modifiers pressed.&lt;br&gt;
What software could you make use of to customize this aspect of your setup? Well, to make your own, redistributable keyboard layout, there’s Ukelele (&lt;a href="https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;amp;id=ukelele" rel="noopener noreferrer"&gt;https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;amp;id=ukelele&lt;/a&gt;). Karabiner-Elements can also be of great use (&lt;a href="https://pqrs.org/osx/karabiner/" rel="noopener noreferrer"&gt;https://pqrs.org/osx/karabiner/&lt;/a&gt;), and will be mentioned later on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other keyboard mods
&lt;/h3&gt;

&lt;p&gt;There are a couple of other low-level modifications I like to use. Most of common UNIX-like shortcuts like ⌃w, ⌃a, ⌃e work out of the box in macOS. But not ⌥ ones. I don’t really like Option layer in macOS, as it yields symbols which are used less often than I change my jobs. But good news, we can remap, for instance, ⌥D to forward delete a word system-wide. You can find an extensive list for such modifications at &lt;a href="https://github.com/ttscoff/KeyBindings" rel="noopener noreferrer"&gt;https://github.com/ttscoff/KeyBindings&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Another one is inspired by Nikita Prokopov’s blog post, &lt;a href="http://tonsky.me/blog/cursor-keys/" rel="noopener noreferrer"&gt;http://tonsky.me/blog/cursor-keys/&lt;/a&gt;. The basic idea is that you remap your Caps Lock key to fn, and map fn+JKLI to you cursor keys. So whenever you have to navigate using arrow keys, you don’t have to move your hands away from home row at all. I went a bit further and also mapped fn+SDFE to ⌃a/PgDown/⌃e/PgUp.&lt;/p&gt;

&lt;p&gt;Are you using standard macOS behaviour (so-called Character Picker) to type accents by holding a letter key like ‘a’, ‘o’, ‘e’, ‘c’? No? Well me neither. Let’s switch it off, or we won’t be able to type ‘aaaaaaaaaaaaaaaaaaaa’ as a commit message with just one keypress. Take a look at this link: &lt;a href="http://m10lmac.blogspot.com/2011/07/os-x-107-lion-getting-rid-of-character.htmtl" rel="noopener noreferrer"&gt;http://m10lmac.blogspot.com/2011/07/os-x-107-lion-getting-rid-of-character.htmtl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the last, but not the least, is one of standard Karabiner-Elements modifications to map Caps Lock to “hyper-modifier” (⇧⌥⌃⌘), which is normally not used at all in any kind of applications. As Caps Lock is already taken by arrows mod, I map it to right ⌥.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shortcuts
&lt;/h2&gt;

&lt;p&gt;You should take a look at the most useful shortcuts for your applications and learn to take advantage of them. Whenever there’s two ways to do something, where one is with mouse, always opt for another one. Whenever there’s only one, spend some time to find out the right one. Without the mouse. In case you didn’t figure.&lt;/p&gt;

&lt;h3&gt;
  
  
  System
&lt;/h3&gt;

&lt;p&gt;Don’t forget about system-wide shortcuts, such as focus the menu bar or the dock. Another one, surprisingly useful for multi-window applications such as Adium is “Move focus to next window”.&lt;/p&gt;

&lt;p&gt;I’m sure you’re using Spotlight, it’s a nice way of finding/running things on your computer. However, I’ve replaced my Spotlight completely with Alfred. Unlike most of the soft I’m talking about, it’s not free, but it has an especially cool feature: Workflows. Practically, it’s Automator from a different perspective: you set a trigger and a bunch of actions to follow, which can also utilize the input provided in Alfred’s omnibar. The Workflow I use the most is pretty stupid: it triggers on ⇧⌥⌃⌘letter, and launches a specific application. I have iTerm on ‘a’, Chrome on ‘d’, IDEA on ‘g’ and so on. That enables me to switch focus between applications really fast (because remember, I mapped ⇧⌥⌃⌘ to right ⌥?)&lt;/p&gt;

&lt;p&gt;Alfred has an extensive list of features which don’t bring a lot of value to the topic, but nevertheless I’ll mention my favorite one: Clipboard History. Whenever I press ⌥⌘V, I get a list of things that were in my clipboard recently, with omnibar active. That saves a lot of browser tab switches, when you have to copy-paste 5–6 values between tabs; instead of doing it one by one, you can do so in bulks.&lt;/p&gt;

&lt;h3&gt;
  
  
  IDE
&lt;/h3&gt;

&lt;p&gt;If you’re using a powerful text editor or an IDE, chances are you can shortcut nearly any action available. For instance, there are one hour long videos on just using IntelliJ IDEA shortcuts, such as &lt;a href="https://www.youtube.com/watch?v=eq3KiAH4IBI" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=eq3KiAH4IBI&lt;/a&gt;. There’s not much to say about this, you just have to force yourself to use a shortcut whenever possible until it becomes second nature. Here are some of my favorites for IDEA, if it helps: Extend/Shrink selection, Recent files, Recent projects, Git/VCS commands, Jump to Navigation bar, Focus Project tool window, VCS tool window, Parameter info, Jump to definition, Show usages, Search for File/Symbol, Find in path, Replace in path, and of course Find action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser
&lt;/h3&gt;

&lt;p&gt;If you use Google Chrome, there’s a great extension for it called Vimium (&lt;a href="https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en" rel="noopener noreferrer"&gt;https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en&lt;/a&gt;). It enables you to control nearly every action in your browser with keyboard: opening and scrolling pages, following links, shortcutting Next/Prev buttons on paged views, etc. There are extensions like this for Firefox and Safari as well, but they’re not nearly as powerful. However, if you can’t stand Google Chrome, it may be worth to check them out (&lt;a href="https://github.com/philc/vimium/wiki/Alternative-Vimium-for-Other-Browser" rel="noopener noreferrer"&gt;https://github.com/philc/vimium/wiki/Alternative-Vimium-for-Other-Browser&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  Terminal
&lt;/h3&gt;

&lt;p&gt;To navigate through terminal emulator’s input, don’t use arrow keys or ⌃f/⌃b if you have to move the cursor further than a couple of symbols. Throw in some ⌥f/⌥b to move by word boundaries. All in all, learning typical UNIX shortcuts to move around text and edit it won’t hurt.&lt;/p&gt;

&lt;p&gt;I’m sure that from time to time, you have to copy something from your terminal emulator window. iTerm has a couple of nice features: first, you can define shortcuts to move selection boundaries left or right, and second, you can enable so-called Shell Integration, that makes your local shell a bit more intelligent knowing it’s input and output is controlled by iTerm.&lt;/p&gt;

&lt;p&gt;First one enables you to use the following pattern to select and copy text from arbitrary piece of terminal’s output: ⌘f (Find) + beginning of the piece you’d like to copy + (in my case) ⌥⇧→ (actually, ⇪⌥⇧l if we take into account everything I said before) + ⌘c.&lt;/p&gt;

&lt;p&gt;Second one enables you to copy all the output from the previous command, or current command you’re currently typing in, with a single shortcut.&lt;/p&gt;

&lt;p&gt;Also, if you use iTerm and don’t have tmux integration enabled, please please please enable it right now. If for some reason you tried and didn’t like it, that’s okay, fair enough. It’s just, I personally don’t see any reason to use another different set of shortcuts that don’t make sense anywhere outside screen or tmux, but that’s me. Some people still love vim for some reason, you know.&lt;/p&gt;

&lt;p&gt;Learning everything new and unusual takes time. But if you’re successful in not letting yourself use old, slow but familiar way, soon new and fast habits will become your second nature. I don’t really move my hands away from home row anymore, and that feels great. I don’t spend time on useless muscular activity (I have table tennis and bass guitar for useful muscular activity, thank you very much), and it just looks cool. Seriously. It’s almost like I don’t move my hands at all, but everything works as it should.&lt;/p&gt;

&lt;p&gt;This article was written without touching mouse a single time (though I’d punish some design decisions on Medium. Like really, you have all this free space on the left and right, but no buttons to insert an image or make a header?..)&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus level
&lt;/h3&gt;

&lt;p&gt;I notice that I sometimes start to suffer from syndromes I’d describe as ‘pre-RSI’. Wrist soreness, mild pain, etc. So… if you use more than one keyboard, Karabiner-Elements by default mirrors any modifiers pressed on one keyboard to all the others. That means you may seamlessly use two keyboards at the same time. You know, almost like split keyboards. Which is exactly what I do: my left hand types on laptop’s keyboard, and my right one uses standard Apple Wired. This way both my arms are straight without having to curve wrists at unnatural angles.&lt;/p&gt;

&lt;p&gt;Well yeah, that’s it. See you at the home row!&lt;/p&gt;

&lt;h3&gt;
  
  
  P.S.
&lt;/h3&gt;

&lt;p&gt;When copy-pasting this to dev.to, I've encountered following behaviour: you just can't scroll your post entry textbox with arrow keys. You can't. When your cursor goes out of visibility, viewing area doesn't move at all. I &lt;em&gt;had&lt;/em&gt; to use mouse for this one. Compared to this, writing this in Medium editor was a breeze.&lt;/p&gt;

</description>
      <category>macos</category>
      <category>productivity</category>
      <category>keyboard</category>
      <category>shortcuts</category>
    </item>
  </channel>
</rss>
