<?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 Andrei Rukavina on Medium]]></title>
        <description><![CDATA[Stories by Andrei Rukavina on Medium]]></description>
        <link>https://medium.com/@rukavina.andrei?source=rss-4a561890dbc3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*aa415lVflV9rJKnT6kQW8A.jpeg</url>
            <title>Stories by Andrei Rukavina on Medium</title>
            <link>https://medium.com/@rukavina.andrei?source=rss-4a561890dbc3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:46:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rukavina.andrei/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[I can't finish my project.]]></title>
            <link>https://medium.com/@rukavina.andrei/i-cant-finish-my-project-bf8690bcd206?source=rss-4a561890dbc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8690bcd206</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[procastination]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[to-do-list]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Andrei Rukavina]]></dc:creator>
            <pubDate>Tue, 09 Jul 2019 19:42:53 GMT</pubDate>
            <atom:updated>2019-07-09T19:42:53.094Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*jU0uwuzvTZ6XYQSxWYlbbA.jpeg" /><figcaption>Photo/Image courtesy of commitstrip.com. Via [<a href="https://alyjuma.com/side-project-essentials/">Source</a>]</figcaption></figure><p>I can’t finish my project. It doesn’t matter if it’s for school, work, or personal. It seems impossible for me to finish it.</p><p>Is it related to the fact that I’m a serial procrastinator? Is it because I start too many «projects» at the same time? Am I afraid of conclusions? What if it doesn’t end up being what I wanted to be? Honestly I have no clue.</p><p>After 12 years of being an active Computer Scientist I realized it’s fabulous to start from a white canvas. Having that initial liberty feels just great.</p><blockquote>I’ll add this new feature, I’m going to use this new lib (or sometimes a new language), I’ll refactor this chunk, this module, this API. Everything is broken now, I have to clean-up my environment.</blockquote><p>Apparently the endless flow of ideas to refactor something that isn’t there yet ends up depressing me in the long term. Motivation and creativity decreases and after a few weeks in, my “new”project becomes one of my WIP ideas.</p><blockquote>It would be more accurate to call them NWA (Never working again) ideas.</blockquote><p>I just did it again. (Not like Britney)</p><p>Running some basic statistics on my GitHub repository, only 3 out of 57 projects ended up getting to <strong>PROD </strong>-or what I think a <strong>PROD </strong>state is-. This is just a very discouraging 5.26%.</p><p>What is wrong? Is it just me? Well, after discussing this with friends and colleagues (from different generations, genders and nationalities) it seems I’m not alone nor the only case. We all share this “skill”. Anyways, this doesn’t contribute to my mental well-being. In fact, it’s quite the opposite. Why can’t we (computer/software professionals) just finish what we started?</p><p>How I see it can be broken down in just a few pain-points:</p><ul><li>We are lazy and irresponsible.</li><li>Anxiety is our worst enemy.</li><li>Competitive mindset.</li><li>We’re not good expressing our goals, nor to motivate others in the long-term.</li><li><strong>TODO</strong>: Elaborate more about <em>TODOs</em></li></ul><h4>Lazy &amp; Irresponsible</h4><p>We’re all lazy. Admit it. We all overestimate how much time we think we will invest working but we never accomplish it. Of course we aren’t equal. There are people lazier than others, but we all are at some level.</p><h4>Anxiety</h4><p>It is depressing to open LinkedIn, Twitter, review Journals or Magazines, turn-on the TV. Everyone is doing something awesome. Everyone is giving talks or lectures about some new and exciting technology. Like that guy you knew a few years ago. Yep, that one with no more talent than the average Joe. He is now writing a paper about a new type of <em>&lt;insert random technology&gt;</em> which you’ve never heard about but apparently is the new thing. At the same time, you’re deep inside stack-overflow trying to decrypt how to flatten a list of a lists in the most <a href="https://docs.python-guide.org/writing/style/">Pythonic</a> way possible (…right, because that’s the priority). Yes, you could probably argue that 90% of the content published on many on the mentioned platforms are just a smoke screen. Again, people tend to overestimate their own accomplishments selling instead of communicating. But this is not enough to ignore the fact that they <strong>do</strong> (because they finish) stuff. I don’t.</p><p>This makes me feel more anxious about how far behind I am. There is always too much to learn and I’m not using the correct tools. So, I get started right away by doing a tutorial of the new <em>&lt;same technology as before&gt;</em> written entirely in COBOL and R…😨</p><h4>Competitive mindset</h4><p>Stop competing.</p><h4>We’re not good motivating others</h4><p>This is another critical part of the process. Many of my failed projects began with a big team, totally onboard with the idea.</p><p>They are committed… committed to disappear after the first round of tasks. Sometimes they get to the second, but that’s how far I can retain talent (for free)</p><p>Not everyone share your passion about your project, and believe me, it’s your fault. Motivating others is no simple task, especially if it’s after hours and for free. Being part of something that doesn’t exist yet is not enough.</p><p>Before putting up a team. Try to get to a MVP or POC. Walk those dark moments yourself or with someone you know won’t quit. Onboard more people later and do not waste the precious energy and stamina on calls or meetings.</p><h4>TO-DOs</h4><p>Are these familiar to you? (do you know people that abuse from these?) because I got the feeling that most developers after they get a certain piece of code done (and it does what it’s supposed to do) they never look back at it again. At least, until maintenance has to be made or a new feature has to be added. So, those TO-DO will be lost for ever, buried deep in your code. So, does it make sense to write those comments at all? Should they be written on a physical medium like a whiteboard, paper, or something else where they remain in the focus of developers? Some IDEs keep track of it but is just too easy to ignore them. Apparently there is some controversy around this topic.</p><p>I just wanted to share this with you. I don’t have any hope, you’ve reached this section. This is just for me to experience once in a while what it means to finish something, even small, like this post. It would have been ideal to do it before the deadline I set to myself, but that’s a different story</p><blockquote>As a great Twitterer once wrote: Launch when you’re ready, not when is perfect.</blockquote><p>Feel free to contact me if you feel like this, specially during this modern era of ever-changing hype.</p><p>Thanks for reading and have a wonderful 2018! 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8690bcd206" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write a Python script header]]></title>
            <link>https://medium.com/@rukavina.andrei/how-to-write-a-python-script-header-51d3cec13731?source=rss-4a561890dbc3------2</link>
            <guid isPermaLink="false">https://medium.com/p/51d3cec13731</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[header]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Andrei Rukavina]]></dc:creator>
            <pubDate>Sat, 14 Apr 2018 18:25:09 GMT</pubDate>
            <atom:updated>2018-04-14T20:21:59.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJ-SqKuScYaxeTyGN93Hxg.jpeg" /><figcaption><em>Photo/Image courtesy of ar</em>chitecturendesign.net. Via [Source]</figcaption></figure><h3>Sharing</h3><p>It is not clear what a script header should contain. If you’re starting to wonder what your code should look like before sharing it and not looking bad after, this is for you.</p><p>What you could try:</p><ul><li>Give it some format.</li><li>Remove idiotic comments.</li><li>Add normal comments.</li><li>Concisely describe the file at the beginning.</li></ul><p>The last point may be trickier. <strong>The Header</strong>. <br>You have seen many examples during the past few hundreds Google searches but you still don’t have a clear idea of what to include. If this happened to you, be welcome! you’re not alone.</p><p>Once upon a time a programmer decided to write his own header, following what he thought were good practices for any scripting language. It contained a few common ideas as:</p><ol><li>Interpreter</li><li>Encoding</li><li>Basic description</li><li>Current version</li><li>Imports</li><li>Date of creation<br>…and for some reason…</li><li>Complete <strong>update</strong> history (I’m sorry, don’t be like me)</li></ol><p>After years of writing my own headers and not being consistent, I invested a little effort in understanding what a good header should contain (and how to express it)</p><p>The following will be explained for Python, however it can be extrapolated to any other scripting language, like R (for those doing ML).</p><p>As we all do, I first Googled a few times about this topic. To my surprise, there wasn’t a solid answer or standard; nonetheless, I started suspecting my original template was pure (garbage).</p><p>If you don’t want to read…</p><h4>Lazy C&amp;P Python template:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6ec95508b8e0660781a66ecf2ffccad/href">https://medium.com/media/c6ec95508b8e0660781a66ecf2ffccad/href</a></iframe><p>..and…</p><h4>Lazy C&amp;P R template:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c776e1343940958062f419396d1b6c70/href">https://medium.com/media/c776e1343940958062f419396d1b6c70/href</a></iframe><p>My research started here: <a href="https://stackoverflow.com/questions/1523427/what-is-the-common-header-format-of-python-files">Stack Overflow: What is the common header format in Python files</a>. After talking to friends and other computer scientists, I came up with this:</p><h3>Full Example</h3><p>Because we all learn better when copying, following is an example of my YouTube ripper while it was still being coded:</p><p>```</p><p>#!/usr/bin/env python<br># -*- coding: utf-8 -*-</p><p>```</p><p>Write some interesting and meaningful module description. Include<br>information only about the script.</p><p>This Source Code Form is subject to the terms of the Mozilla Public<br>License, v. 2.0. If a copy of the MPL was not distributed with this<br>file, You can obtain one at http://mozilla.org/MPL/2.0/.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/441f07ace550756f6dc9416c57d2c5a5/href">https://medium.com/media/441f07ace550756f6dc9416c57d2c5a5/href</a></iframe><h3>Sections:</h3><p>Although is a clear intention to be used in R, avoid flowerbox comments in Python. And please do not use them to separate sections.</p><h4>Shebang</h4><p>In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark (#!) at the beginning of a script. It is also called sha-bang,hashbang,pound-bang,or hash-pling.</p><h4>Syntax</h4><p>#!interpreter [optional-arg]</p><p>In which interpreter is an absolute path to an executable program. The optional argument is a string representing a single argument. White space after #! is optional. In Linux, the file specified by interpreter can be executed if it has the execute right and contains code which the kernel can execute directly.</p><h4>Encoding</h4><p>The encoding information is then used by the Python parser to interpret the file using the given encoding. Most notably this enhances the interpretation of Unicode literals in the source code and makes it possible to write Unicode literals using e.g. UTF-8 directly in an Unicode aware editor.</p><p>This varies from one language to another, but for our example we are following the standard: <a href="https://www.python.org/dev/peps/pep-0263/">PEP263</a>.</p><h4>Examples</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0b27d309e933b3332fc0f1664311f47/href">https://medium.com/media/b0b27d309e933b3332fc0f1664311f47/href</a></iframe><h4>Basic description</h4><p>Basic description of your script functionality. Be as descriptive as possible in just a few lines.</p><p>For Python please check: <a href="https://www.python.org/dev/peps/pep-0258">PEP258</a>.</p><p><em>More about descriptions</em><br>Any string literal immediately following an assignment statement is interpreted by the <strong>docstring</strong> extraction machinery as the docstring of the target of the assignment statement, under the following conditions:</p><ol><li>The assignment must be in one of the following contexts:<br>1.a. At the top level of a module (i.e., not nested inside a compound statement such as a loop or conditional): a module attribute.<br> <br>1.b. At the top level of a class definition: a class attribute.<br> <br>1.c. At the top level of the “<em>__init__</em>” method definition of a class: an instance attribute. Instance attributes assigned in other methods are assumed to be implementation details. (@@@ __new__ methods?)<br> <br>1.d. A function attribute assignment at the top level of a module or class definition. <br>Since each of the above contexts are at the top level (i.e., in the outermost suite of a definition), it may be necessary to place dummy assignments for attributes assigned conditionally or in a loop.</li><li>The assignment must be to a single target, not to a list or a tuple of targets.</li><li>The form of the target:<br>3.a. For contexts 1a and 1b above, the target must be a simple identifier (not a dotted identifier, a subscripted expression, or a sliced expression).<br> <br> 3.b. For context 1c above, the target must be of the form <em>self.attrib</em>, where <em>self</em> matches the <em>init</em> method’s first parameter (the instance parameter) and <em>attrib</em> is a simple identifier as in 3a.<br> <br> 3.c. For context 1d above, the target must be of the form <em>name.attrib</em>, where <em>name</em> matches an already-defined function or method name and <em>attrib</em> is a simple identifier as in 3a.</li></ol><p>Blank lines may be used after attribute docstrings to emphasize the connection between the assignment and the docstring.</p><p><strong>Examples:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a62c0d3ecfb4ba3886e232bc5e059ef0/href">https://medium.com/media/a62c0d3ecfb4ba3886e232bc5e059ef0/href</a></iframe><p><strong>Note:</strong> In the module’s docstring, please include a basic license info.</p><h4>Current version</h4><p>Keep only the current revision. Please do not keep the entire track of updates in the script, we have GitHub, Mercurial or SVN for that.<br>If you need to do it, store than information on a separated file, like CHANGELOG. md:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/92305a5951287f04c4a1fbe73e68702a/href">https://medium.com/media/92305a5951287f04c4a1fbe73e68702a/href</a></iframe><p>The format is based on <a href="http://keepachangelog.com/en/1.0.0/">Keep a Changelog</a> and this project adheres to <a href="http://semver.org/spec/v2.0.0.html">Semantic Versioning</a>. Check them out for more information.</p><p><strong>Remember:</strong></p><p>REV <strong>M.m.r,</strong> where:</p><ul><li>M: Mayor — Refactoring, Adding extra capabilities. This is not a fix.</li><li>m: Minor — This is a fix. Correcting an existing functionality.</li><li>r: Release — Programmer error. Bug.</li></ul><h4>Imports</h4><p>Imports are a very important part of any script. You should keep it clean and one per line!<br>Go from the more Generic imports to those very specific to your script.</p><p>1. Built-in imports<br>Things like <strong>os</strong>, <strong>sys</strong>, <strong>datime</strong>, <strong>argparse</strong> should be first.</p><p>2. Common libraries<br>Continuing with the Python example, consider: <strong>numpy</strong>, <strong>pandas</strong> and others.</p><p>3. Specific not well known or widely used libs (betas?)<br>In our example this is: <strong>youtube_dl </strong>(Which is a great module BTW!)</p><p>4. Your own libs or files.</p><h3>Wrapping up</h3><p>As Oliver Lacan Said:</p><blockquote>This document is not the truth; it’s my carefully considered opinion, along with information and examples I gathered.</blockquote><blockquote>This is because I want our community to reach a consensus. I believe the discussion is as important as the end result.</blockquote><p>I hope this helps you write more efficient headers. Feel free to comment if you have any suggestions you want me to implement in this post.<br>All questions are welcomed.</p><p><a href="http://rukavina.andrei@gmail.com/">Andrei.-</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d3cec13731" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>