<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gytis Daujotas on Medium]]></title>
        <description><![CDATA[Stories by Gytis Daujotas on Medium]]></description>
        <link>https://medium.com/@gytdau?source=rss-452fbc95d223------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*2u4Kxf6qmLvHzNjP8mKLBA.jpeg</url>
            <title>Stories by Gytis Daujotas on Medium</title>
            <link>https://medium.com/@gytdau?source=rss-452fbc95d223------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 16:45:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gytdau/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[To Get More Done, Take Better Breaks]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@gytdau/to-get-more-done-take-better-breaks-f5b4bb9d7cf2?source=rss-452fbc95d223------2"><img src="https://cdn-images-1.medium.com/max/1038/1*hi-J-o6wbO64h-NiBvgv1A.png" width="1038"></a></p><p class="medium-feed-snippet">You&#x2019;re in it for the long run: we&#x2019;re still disregarding the value of proper rest.</p><p class="medium-feed-link"><a href="https://medium.com/@gytdau/to-get-more-done-take-better-breaks-f5b4bb9d7cf2?source=rss-452fbc95d223------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@gytdau/to-get-more-done-take-better-breaks-f5b4bb9d7cf2?source=rss-452fbc95d223------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5b4bb9d7cf2</guid>
            <category><![CDATA[time-management]]></category>
            <category><![CDATA[rest]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[time]]></category>
            <dc:creator><![CDATA[Gytis Daujotas]]></dc:creator>
            <pubDate>Sun, 16 Jun 2019 10:37:35 GMT</pubDate>
            <atom:updated>2019-06-16T10:37:35.163Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Four Hours Are All You Have]]></title>
            <link>https://medium.com/@gytdau/four-hours-are-all-you-have-d0a342ca5f31?source=rss-452fbc95d223------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0a342ca5f31</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[routine]]></category>
            <category><![CDATA[time]]></category>
            <category><![CDATA[stoicism]]></category>
            <dc:creator><![CDATA[Gytis Daujotas]]></dc:creator>
            <pubDate>Fri, 03 May 2019 15:05:07 GMT</pubDate>
            <atom:updated>2019-05-03T15:06:06.734Z</atom:updated>
            <content:encoded><![CDATA[<h4>You have less time than you think you have, but that’s still enough.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*4LmWIaRuy5QCjYmNwazTsA.png" /></figure><p>An upright ape throws a rock at some deer. He scurries up a boulder and picks some fruit. He finishes off his Tuesday by chiseling some flint and trying his hardest to stab a fish. And he has a better work-life balance than you.</p><p>Unlike what we want to believe, our hunter-gatherer ancestors weren’t in a constant battle for food. They had to work for three to five hours a day to secure their nutritional needs for their tribe, and after that, they’re done. At the end of their primordial workday, they’d work on less intense chores like cooking, or bathing, or just enjoying the ebb and flow of life.</p><p>Scientists have now found traces of this behavior left over in our own brains. We seem to be able to work for the same stretch of three to five hours, at which point our efficiency would rapidly decrease. But this is something that the best of us seem to have known all along.</p><p>The pattern of the four high quality hours is pervasive throughout history. Charles Darwin, for example, worked for two 90 minute stretches a day. Great mathematician Henri Poincar worked in two stretches of two hours each. And the same pattern is repeated in Thomas Jefferson, Ernest Hemingway, Charles Dickens, and almost all other great thinkers in our past and present.</p><p>If you’re not assembling trinkets on an assembly line, you too are bound by the human limits of concentration and focus. Our best work can be squeezed only into this period, and even if we try working harder we’d only manage to do work that demands little to no focus.</p><p>This brings new perspective to the ceaseless flow of time in our lives. How did you spend your four hours today? What about yesterday? Did you further yourself or did someone else take your time for their own goals? If you sum the result of all those four hour periods in your life together, what will be the product? These are all questions worth asking.</p><p>It also allows us to see the flawed way we look at our time. Overtime, for example, goes right out the window, if we want to have any hope that we’re using our time efficiently. And on top of that, we find that we’re flawed in our belief that we can cram in a course on our commute, or learn a new language in our daily fifteen minute break — now we know that our failures to do so are more down to our biology than pathetic lack of willpower. You can do anything you want, just in the right quantity.</p><p>In some ways, the knowledge grants you peace. You need not try any harder, for four hours is the meager daily pittance you’ll always be given. This is all you have, and how you spend it makes all the difference.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0a342ca5f31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 starting steps to clean code]]></title>
            <link>https://medium.com/@gytdau/5-starting-steps-to-clean-code-7b3a17469f0a?source=rss-452fbc95d223------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b3a17469f0a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding-style]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Gytis Daujotas]]></dc:creator>
            <pubDate>Thu, 06 Apr 2017 21:22:28 GMT</pubDate>
            <atom:updated>2017-07-16T18:27:56.171Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQr63LP4X4st89m88UdWWQ.jpeg" /></figure><h4>A detailed guide on leveling up your coding style</h4><p>Many developers spend a lot of time thinking about organizing their code. And the reason is clear: in a team of 10 people, 9 people will read the code that 1 person writes. That’s why the time-saving benefits of clean code are difficult to understate.</p><p>A commonly cited reason to switch frameworks is because it “looks cleaner” or “feels more minimal”. But frameworks and libraries aren’t a magic pill. Whichever framework you use, it’s still up to you to make sure the code you write is clean. The framework you’re using can’t force you to make good decisions about your code — the best it can do is just try to show you common conventions.</p><p>To help you learn the fundamental knowledge, here are five basic principles:</p><h3>1. Correct naming</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JavnuVtusXN77fLLn2C6Q.png" /></figure><p>This is one of the most important aspects of clean code. Although it can be difficult to name your variables or functions correctly in some cases, it’s makes up a big component of what makes clean code feel clean.</p><p>One tip is to always be consistent with naming. If a variable is passed around your code as client, and you’re accepting that variable, call it client as well.</p><p>Always try to be descriptive with your name. In an ideal world, you could choose a name that is both descriptive and short. If that doesn’t work, then I prefer to have a long name rather than a confusing name. currentNinjaWeaponType is better than weaponType , even if it’s more cumbersome to type out.</p><p>Whenever you need a new variable name, you should pause for a few seconds to think about what would be the most ideal. That meager amount of extra time spent is always worth it, since you’ll repeat that name throughout the rest of your code.</p><h3>2. Ensure Single Responsibility</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cytLP4HnOSYPK_UwhL2hRw.png" /></figure><p>Ah, we’ve all done this back when we were trying to learn to program. We created something called a God component — a class or object that knew everything, did everything, and was responsible for every part of the application.</p><p>We probably know by now that we’re supposed to separate our code into classes. But how far should we take it? How many classes should we separate the code into? The answer: as many as you can.</p><p>Although you probably are already using classes and splitting your code into functions, chances are that you can go even further. Every class or object should ideally have a single responsibility: it does only one thing. Try your best to separate large, bulky functions and classes to make them shorter.</p><p>Is a function responsible for connecting to the printer and printing a document? Separate those two into different functions, since they’re doing different things.</p><p>Sure, it’ll result in more lines of code, but lines of code are an inaccurate measurement of code complexity. More spaced out code is generally easier to understand.</p><h3>3. Minimize repetition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXpYEjkdEGykK8R2z3it1w.png" /></figure><p>This goes hand-in-hand with #2, and while it seems kind of obvious, it’s worth trying to hone in on.</p><p>If you’re doing the same thing twice but with a different configuration, you should consider making it into a class or a function that accepts that configuration as an argument. This ensures that if the nature of the thing you’re doing changes, you only have to change it at one place.</p><p>Actively look through your codebase to ensure you don’t repeat anything. A bad sign is when you copy paste code from one function into the other — that’s a red flag for repetitive code.</p><h3>4. Write comments</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4upoAaCyx9bCYV-WSerQrg.png" /></figure><p>Many developers have a love-hate relationship with comments. On one hand, they help clarify your code and the logic behind it. On the other, comments usually don’t get updated with code, leaving the comments irrelevant.</p><blockquote>The proper use of comments is to compensate for our failure to express ourself in code.<em> - Robert Martin, author of Clean Code</em></blockquote><p>In general, I think it’s a good idea to use comments, but only when you need to explain the reasoning. Avoid restating what the code already expresses:</p><pre>getClient(); // Get the client.<br>doAction(type: &quot;scroll&quot;); // Do an action which scrolls.</pre><p>Instead, it’s always better to explain the reasoning behind your code:</p><pre>getClient();<br>doAction(type: &quot;scroll&quot;); // We have to scroll after we get the client so that the user sees the client.</pre><p>While good code is supposed to be able to explain itself, we can’t always achieve that. Comments used in moderation can help others make far more sense of your code.</p><h3>5. Spend time refactoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uxVtE99NKfHWfO5l7vgzQ.png" /></figure><p>Inevitably, these habits will fall out of practice when you need to meet that deadline that’s fast approaching or your manager piles an insane amount of work onto you. That’s okay. That happens to everyone.</p><p>Some people try set a certain amount of time out for refactoring. Keep a list of technical debt you’ve accrued, and before you mark a task fully complete, try to shorten the list and fix some of the issues. This might work better for you if you or your company operates on the idea of sprints, since you can take a sprint to solve all of your technical debt issues.</p><p>If that’s not your cup of tea, then you might learn a few things from the Boy Scouts. They have a rule that says<em> “Always leave the campground cleaner than you found it”</em>, and you can also apply this interesting rule to code.</p><p>Every time you add a function or modify a module, clean up one little thing you find — even if you feel it’s insignificant. Fix a variable name or update some out-of-date comments. You don’t need to spend a lot of time up-front, but applying this rule will slowly snowball into having a fully clean codebase. It’s perfect if you don’t want a lot of up-front commitment.</p><h3>What next?</h3><p>Although this is a lot to think about it, you’ll feel the benefits if you apply even one of these rules. Try your best to do so!</p><p>If you’d like to delve deeper into the topic, I’d highly recommend the book <a href="https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=mt_paperback?_encoding=UTF8">Clean Code</a>. Although it’s a bit pricey, this book formed most of the inspiration for this story.</p><p>Good luck!</p><p><strong>I’m a sixteen year old developer, so it’d mean a lot if you could point out any flaws or give me feedback. Thanks! </strong>♥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b3a17469f0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>