<?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>Forem: Tomi Adenekan</title>
    <description>The latest articles on Forem by Tomi Adenekan (@tominekan).</description>
    <link>https://forem.com/tominekan</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%2F483812%2Fb5cfece6-b0fa-442a-a4b9-f040af251d6e.png</url>
      <title>Forem: Tomi Adenekan</title>
      <link>https://forem.com/tominekan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tominekan"/>
    <language>en</language>
    <item>
      <title>Developer Bias Check</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Tue, 18 May 2021 22:27:20 +0000</pubDate>
      <link>https://forem.com/tominekan/developer-bias-check-54b3</link>
      <guid>https://forem.com/tominekan/developer-bias-check-54b3</guid>
      <description>&lt;h2&gt;
  
  
  Why are we biased?
&lt;/h2&gt;

&lt;p&gt;Bias is necessary for survival. If you eat some food that was poisoned, you probably would have reservations about eating it the next time you encounter that type of food.  More than that, if you have heard all your life about how bad pirates are, when you encounter one, most likely the first thing you feel is fear. However, when it comes to interpersonal relationships in a professional setting (aka Soft Skills) it can be a crutch. With that introduction done, the million dollar question is ..&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Are you a biased developer?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;No really, &lt;em&gt;think&lt;/em&gt; about it. For most people, the immediate answer that comes to mind is &lt;em&gt;absolutely not&lt;/em&gt;. But why? And more importantly, are you really? I have created a check help you answer that question for yourself. This is by no means exhaustive and there are probably far more questions than the 7 I came up with.&lt;/p&gt;

&lt;p&gt;If some of the situations do not apply to you, then try to imagine yourself in that situation. Do try to be honest, the only person you are fooling is yourself. Okay, here we go ..&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Do you sometimes forget to design for accessibility? &lt;em&gt;(&lt;a href="https://uxdesign.cc/design-accessible-websites-6ebffcf583e2"&gt;Article&lt;/a&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;When a pretty person says that they can (and do) code, do you get a feeling of doubt? &lt;em&gt;(&lt;a href="https://www.maxim.com/women/victorias-secret-model-coding-2018-"&gt;Article&lt;/a&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;When someone rants about inequality in the development field, do you feel annoyed?&lt;/li&gt;
&lt;li&gt; Do you try to make sure the data you collect is representative all walks of life? &lt;em&gt;(&lt;a href="https://sitn.hms.harvard.edu/flash/2020/racial-discrimination-in-face-recognition-technology/"&gt;Article&lt;/a&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;When you picture a good programmer, does a White (or Asian) young male come to mind? &lt;em&gt;(&lt;a href="https://uxdesign.cc/design-accessible-websites-6ebffcf583e2"&gt;Article&lt;/a&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Does the college a candidate went to play a major factor your hiring process? &lt;em&gt;(&lt;a href="https://www.investopedia.com/articles/personal-finance/051915/university-prestige-really-important.asp"&gt;Article&lt;/a&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt; Do you try to make your language inclusive? &lt;em&gt;(&lt;a href="https://online.rider.edu/online-bachelors-degrees/liberal-studies/guide-to-using-inclusive-language/"&gt;Article&lt;/a&gt;)&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Whew&lt;/em&gt;, that's it, if you answered yes to just one of the questions &lt;em&gt;you have some biases&lt;/em&gt;. We all do,  &lt;strong&gt;no one is without bias&lt;/strong&gt;, not me, not you, or anyone around you, and that's okay 🙂.&lt;/p&gt;

&lt;p&gt;Leave a comment if you have any questions, comments (&lt;em&gt;oof&lt;/em&gt;), suggestions, or even criticisms (so long you are kind about it).  &lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Klog 1: Cleaning up messes</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Fri, 30 Apr 2021 23:03:38 +0000</pubDate>
      <link>https://forem.com/tominekan/klog-1-cleaning-up-messes-3ndo</link>
      <guid>https://forem.com/tominekan/klog-1-cleaning-up-messes-3ndo</guid>
      <description>&lt;p&gt;This is klog, a series of posts on my misfortunes and misadventures in maintaining my project &lt;a href="https://github.com/tominekan/klarg"&gt;klarg&lt;/a&gt;. The naming is a bit unfortunate, but it sounded (and still sounds) good. If you haven't checked it out, &lt;del&gt;what is your purpose in life?&lt;/del&gt; why are you here?&lt;/p&gt;

&lt;p&gt;This log (or klog 😏) is about my struggles to refactor the code. Those who have refactored code are very familiar with the discomfort of going through messy code and fixing it. The most painful part was realizing that I wrote such &lt;strong&gt;evil&lt;/strong&gt; code. Feelings aside, the problem was that a simple parsing library does not need to contain over &lt;em&gt;&lt;strong&gt;1000&lt;/strong&gt;&lt;/em&gt; lines of code. It's simply not necessary.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem(s)
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kpXsBvti--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9aa4lwnt4myhdu2n0sm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kpXsBvti--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9aa4lwnt4myhdu2n0sm.png" alt="1062 lines of code"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;the problem&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;I had a set of functions that I needed to call two times, one being for a command line subcommand, and another for a command line command (hmm 🤔, that sounds confusing). Anyway, the way I implemented it was that I copied and pasted the function definition from the command to the subcommand, with both the string and number functions, with minor edits. This meant that if any &lt;em&gt;oof&lt;/em&gt; happened to my code, I was in deep trouble. I would have to go and change 4 instances of the code, each with different customizations. Not only that, but inside each copy, there were multiple copies. Just think about that (or look at it)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GK33hMV4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k21vkraoyzc6i3nnj7cc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GK33hMV4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k21vkraoyzc6i3nnj7cc.png" alt="Three copies of the same code"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;big oof&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;This is twelve copies that need to change if anything goes wrong. &lt;/p&gt;

&lt;h1&gt;
  
  
  The Process
&lt;/h1&gt;

&lt;p&gt;I decided that I would make a set of base functions, I would then rebuild on top of them and run the tests to make sure nothing broke. I also decided that I would try to remove as much copying as possible, therefore, I would base (haha) my number collecting function on my string collecting function.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Result
&lt;/h1&gt;

&lt;p&gt;Somehow, I got exactly what I wanted (maybe it's just me, but what developers envision in their head and what it actually becomes a lot of the times doesn't match up). I reduced the code size &lt;strong&gt;19%&lt;/strong&gt; (203 lines). I uploaded it to GitHub and made a new release.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ACywEwNG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adqfhud8292xitvmjhno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ACywEwNG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adqfhud8292xitvmjhno.png" alt="Much Reduce"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;🔥👌🔥&lt;/em&gt;&lt;/center&gt;
&lt;h1&gt;
  
  
  The Oof Factor
&lt;/h1&gt;

&lt;p&gt;While creating a new release, I found out that I had klarg as v0.0.1 instead of v1.0.0.&lt;/p&gt;

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

&lt;p&gt;The end.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Introducing Klarg v0.0.1</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Wed, 28 Apr 2021 23:04:30 +0000</pubDate>
      <link>https://forem.com/tominekan/introducing-klarg-v0-0-1-5549</link>
      <guid>https://forem.com/tominekan/introducing-klarg-v0-0-1-5549</guid>
      <description>&lt;p&gt;&lt;strong&gt;WARNING: A terrible sense of humor lies below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Introducing klarg v0.0.1. &lt;em&gt;What is klarg?&lt;/em&gt; You might ask, and I might tell you that it is the result of bad decisions upon bad decisions. Or that it is a dead simple command line argument processing library. But that sounds like bragging. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Why should you use it?&lt;/em&gt; Well, if me making it is not enough, then just look this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# glorious_syntax.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;klarg&lt;/span&gt;

&lt;span class="n"&gt;klarg_is_cool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;klarg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;klarg-cool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;klarg_is_cool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# Not even considering another option 
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Klarg is cool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When we do this ...&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python glorious_syntax.py &lt;span class="nt"&gt;--klarg-cool&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We get this&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Klarg is cool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can also configure klarg as easily as you can make a cake. (which by the way, is &lt;em&gt;very&lt;/em&gt; easily). I mean, just look at this&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;klarg&lt;/span&gt;
&lt;span class="n"&gt;klarg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;long_prefix&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;+&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Just like that. We can call that taking advantage of python's awesomeness, just like that. &lt;/p&gt;

&lt;p&gt;Also, there are no third party dependencies. &lt;del&gt;wow, much rare&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;On a more serious note, check it out on &lt;a href="https://github.com/tominekan/klarg" rel="noopener noreferrer"&gt;github&lt;/a&gt;, it actually is a pretty cool project.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/tominekan" rel="noopener noreferrer"&gt;
        tominekan
      &lt;/a&gt; / &lt;a href="https://github.com/tominekan/klarg" rel="noopener noreferrer"&gt;
        klarg
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple command line arguments parser
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Klarg&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/tominekan/klargwebsite/assets/klarg_icon.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Ftominekan%2Fklargwebsite%2Fassets%2Fklarg_icon.png" alt="Klarg Icon"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;K&lt;/strong&gt;ommand &lt;strong&gt;L&lt;/strong&gt;ine &lt;strong&gt;ARG&lt;/strong&gt;ument parsing library.&lt;/p&gt;

&lt;p&gt;Klarg is a small and simple command line argument parsing library built with no 3rd party dependencies.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Why use klarg?&lt;/h1&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Simple syntax&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;It abstracts all the complexities away so that you can focus on developing the appication itself.&lt;/p&gt;

&lt;div class="highlight highlight-source-python notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;# example.py&lt;/span&gt;
&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;klarg&lt;/span&gt;
&lt;span class="pl-s1"&gt;name&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;klarg&lt;/span&gt;.&lt;span class="pl-en"&gt;get_str&lt;/span&gt;(&lt;span class="pl-s"&gt;"name"&lt;/span&gt;)
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;f"Your name is: &lt;span class="pl-s1"&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt;&lt;span class="pl-s1"&gt;name&lt;/span&gt;&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/span&gt;"&lt;/span&gt;)

&lt;span class="pl-c"&gt;# python example.py --name klarg&lt;/span&gt;
&lt;span class="pl-c"&gt;# Your name is: klarg&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Easy configuring&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;It makes use of the powerful dictionary data type to make configuring klarg a breeze.&lt;/p&gt;

&lt;div class="highlight highlight-source-python notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;# example.py&lt;/span&gt;
&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;klarg&lt;/span&gt;

&lt;span class="pl-c"&gt;# Replace -- with +&lt;/span&gt;
&lt;span class="pl-v"&gt;CONFIG&lt;/span&gt;[&lt;span class="pl-s"&gt;"long_prefix"&lt;/span&gt;] &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;"+"&lt;/span&gt;
&lt;span class="pl-s1"&gt;name&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;klarg&lt;/span&gt;.&lt;span class="pl-en"&gt;get_str&lt;/span&gt;(&lt;span class="pl-s"&gt;"name"&lt;/span&gt;)
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;f"Your name is: &lt;span class="pl-s1"&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt;&lt;span class="pl-s1"&gt;name&lt;/span&gt;&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/span&gt;"&lt;/span&gt;)

&lt;span class="pl-c"&gt;# python example.py +name klarg&lt;/span&gt;
&lt;span class="pl-c"&gt;# Your name is klarg&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Simple data types&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;Klarg only returns basic data types such…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tominekan/klarg" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>python</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Lessons Learnt From a Year of Coding</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Mon, 02 Nov 2020 19:30:24 +0000</pubDate>
      <link>https://forem.com/tominekan/lessons-learnt-from-a-year-of-coding-4heg</link>
      <guid>https://forem.com/tominekan/lessons-learnt-from-a-year-of-coding-4heg</guid>
      <description>&lt;p&gt;I just recently turned 14 (&lt;em&gt;cough&lt;/em&gt; yesterday &lt;em&gt;cough&lt;/em&gt;). I realized that I had come far in my journey of learning how to code and I wanted to share a few things I had learnt along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Journey Never Stops
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rV1CmS8C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9yn7vhjsvzhgi0w9p7he.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rV1CmS8C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9yn7vhjsvzhgi0w9p7he.gif" alt="Cat Learning"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;Even Cats Can Learn&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;Learning to code is a never ending journey. What I mean is that there is always something you can do better, some optimization you can make, some feature you can add, some framework you can learn, some project you can create. There will always be something more you can &lt;strong&gt;&lt;em&gt;learn&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's Okay to Fail
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9mk3YP3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lf1we04hdnv4bad6lqnm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9mk3YP3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lf1we04hdnv4bad6lqnm.gif" alt="Epic Fail"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;Oof&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;Failure is a big part of learning. I have heard that said so many times before but believe me, it is true. What failing does (other than sting) is that it reinforces and/or teaches lessons about what to (or not to) do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for help
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nrBdWpDA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2byqbsjprfbtp2ivl824.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nrBdWpDA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2byqbsjprfbtp2ivl824.gif" alt="Ask for help"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;But not like this&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;If you don't know ask for help. Trust me, people are willing to help if you showed that you were not being lazy with your question, i.e not taking the time to try, not bothering to format the question &lt;a href="https://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt; is a very helpful resource.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try new things
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--joiGdXQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/v7fobmylp1gqzjkwojnw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--joiGdXQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/v7fobmylp1gqzjkwojnw.jpeg" alt="Lazy"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;Struggles ...&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;In all seriousness, try new things. Not only does it help you learn, it also means that you have a bigger tool belt, which looks shiny on a resume. If you don't do something, you 100% failed at it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know Your Stuff
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jul5ORQR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eimhdz9ya43vf6ei6x5w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jul5ORQR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eimhdz9ya43vf6ei6x5w.gif" alt="Basics Mastered"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;Big Brain&lt;/em&gt;&lt;/center&gt;

&lt;p&gt;If you don't know the basics, you will never know the advanced stuff because the advanced stuff is the basic stuff put together(usually). I have fallen into the trap of wanting to do the advanced stuff before the basics. Trust me (or not) it is not fun.&lt;/p&gt;

&lt;h1&gt;
  
  
  Other Tidbits
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Delete Delete Delete
&lt;/h3&gt;

&lt;p&gt;The delete key is the best code optimizer (if you have any better ones leave a comment :)&lt;/p&gt;

&lt;h3&gt;
  
  
  Know when to stop
&lt;/h3&gt;

&lt;p&gt;Breaks are for humans, you are a human (I think) and you need breaks. If something is challenging take a step back, take a break, eat some food (I love food) come back. You will have a refreshed mind (and a full belly :).&lt;/p&gt;

&lt;h3&gt;
  
  
  Clean Code
&lt;/h3&gt;

&lt;p&gt;Write clean code, please, it makes it easier on everyone. In English class, we had to make a capstone project to end finish 8th grade. I decided I would create an app to go along with my explanatory video. I wrote such bad, unclean, unmaintainable, buggy, evil, disgusting, disappointing, unfortunate, slimy, ugly code. It was a pain to complete, and the finished product was buggy and had all manners of unusual surprises. I tried to go back and refactor, however, it was far too gone for that, I had to throw the project away.&lt;/p&gt;

&lt;h3&gt;
  
  
  Know what to use
&lt;/h3&gt;

&lt;p&gt;It would be useless to learn assembly for web development because assembly is very low level (although you &lt;strong&gt;&lt;em&gt;technically could&lt;/em&gt;&lt;/strong&gt;). Just like it would be unfortunate to learn html for operating system design (I would love to see someone try though).&lt;/p&gt;

&lt;h3&gt;
  
  
  Stay up to date
&lt;/h3&gt;

&lt;p&gt;It is helpful to know the current news, and fads of technology. However, do not go into a field just because of the latest framework or library. You do not understand how much pain you will go through because of that. Learn the concept, not the framework.&lt;/p&gt;

&lt;h1&gt;
  
  
  Snazzy GIF
&lt;/h1&gt;

&lt;p&gt;I was distracted ;)&lt;/p&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pjQLz4-7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/027qsj1w7f691vos1aag.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pjQLz4-7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/027qsj1w7f691vos1aag.gif" alt="Fists of Fury"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;/p&gt;
&lt;center&gt;&lt;em&gt;Fists of Fury&lt;/em&gt;&lt;/center&gt;

</description>
      <category>watercooler</category>
      <category>programming</category>
      <category>tips</category>
    </item>
    <item>
      <title>What are the core concepts that a new developer needs to know?</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Sun, 25 Oct 2020 12:10:35 +0000</pubDate>
      <link>https://forem.com/tominekan/whst-are-the-core-concepts-that-a-new-developer-needs-to-know-3i4n</link>
      <guid>https://forem.com/tominekan/whst-are-the-core-concepts-that-a-new-developer-needs-to-know-3i4n</guid>
      <description>&lt;p&gt;I have been hearing a lot about a developer needing to learn core concepts and not just the latest frameworks/libraries. What are the core concepts a developer needs to know?&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>discuss</category>
    </item>
    <item>
      <title>The Way of the DEVELOPAH</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Fri, 23 Oct 2020 20:32:26 +0000</pubDate>
      <link>https://forem.com/tominekan/the-way-of-the-developah-1a0j</link>
      <guid>https://forem.com/tominekan/the-way-of-the-developah-1a0j</guid>
      <description>&lt;h1&gt;
  
  
  Warning:
&lt;/h1&gt;

&lt;p&gt;Many have tried this path, few succeed ... &lt;br&gt;
Proceed at your own risk ... &lt;/p&gt;



&lt;p&gt;In life, everybody strives to be unique, to be different, being a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; should be no different. A &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; must strive to generate code as unique as possible. &lt;/p&gt;

&lt;p&gt;The benefits of being a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increased Security (if no one can understand your code, how can it be hacked?).&lt;/li&gt;
&lt;li&gt;It will remain the same forever, (after all, a testament to your creativity has to last forever).&lt;/li&gt;
&lt;li&gt;It will have tons of new &lt;em&gt;surprises&lt;/em&gt; (it is always best to keep the user alert, it stimulates the mind).&lt;/li&gt;
&lt;li&gt;Your colleagues will be impressed, (who can write code the way you do?).&lt;/li&gt;
&lt;li&gt;No one will mess with your code.&lt;/li&gt;
&lt;li&gt;Everyone who looks at your code will know &lt;strong&gt;exactly&lt;/strong&gt; who wrote it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the steps to achieve true greatness ...&lt;/p&gt;
&lt;h3&gt;
  
  
  Name Creatively:
&lt;/h3&gt;

&lt;p&gt;A true &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; must strive to be as creative as possible. Naming conventions are for the &lt;em&gt;witless&lt;/em&gt;. Functions must reflect the creativity of the &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;printName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- This is unacceptable
&lt;/span&gt;    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;MaGICPUff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;magicCounter&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- Much Better
&lt;/span&gt;    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;magicCounter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Variables Deserve Some Extra Love
&lt;/h3&gt;

&lt;p&gt;Variables are beautiful, useful tools, they can be anything you want them to be. Give them some love, they deserve better than &lt;code&gt;isReady&lt;/code&gt; or &lt;code&gt;counter&lt;/code&gt;. They deserve the best of your creativity, things like &lt;code&gt;howaREyOuFeeling&lt;/code&gt; or &lt;code&gt;areYoUgOOdToDAY&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;stROngForCes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HowaReYoudoIngToDAY&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;IloveVaRIAblES&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;HowaReYoudoIngToDAY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Functions, All or Nothing:
&lt;/h3&gt;

&lt;p&gt;Functions must do all or nothing, one thing is not enough &lt;em&gt;or&lt;/em&gt;, it is too much.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;printName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- Still Unacceptable
&lt;/span&gt;    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;maGIcPuFF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;puffinDog&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- the developah way
&lt;/span&gt;    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;requests&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;puffinDog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Your name is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;puffinDog&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hi"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sOMeFuNC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;complex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;series&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;because&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;can&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- The developah way
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Life is a puzzle. So is programming ...
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Developah's&lt;/em&gt;&lt;/strong&gt; live for challenges, to be a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; you need to encourage people to be challenged. It is good for the brain and the &lt;em&gt;soul&lt;/em&gt;. So, here are some tips:&lt;/p&gt;

&lt;h3&gt;
  
  
  Mix and Match
&lt;/h3&gt;

&lt;p&gt;They say mixing global and local variables is a terrible idea, but take a moment and ask yourself why? Is it because it makes everything complicated? But think about it this way, complicated is unique, unique is you. You are a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;bObsMom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Requesting thing"&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;bObSIster&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bObSMom&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- Tricked em ;P
&lt;/span&gt;    &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;bObsMom&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bObsMom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Misleading Comments
&lt;/h3&gt;

&lt;p&gt;Ever have that annoying colleague that takes offense with every single line of code you write. Well, this will give them the time of their lives as they try to figure out this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;requestData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
    &lt;span class="s"&gt;"""Requests data from url"""&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;requests&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;
    &lt;span class="c1"&gt;# Collecting data
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"found"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- Beauty of life
&lt;/span&gt;        &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Final Thing ...
&lt;/h3&gt;

&lt;p&gt;Everyone says that you should organize files this way, or that way. I say &lt;strong&gt;no&lt;/strong&gt;, organize it &lt;strong&gt;&lt;em&gt;your&lt;/em&gt;&lt;/strong&gt; way. The &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; way. Clean hates creative. Clean is boring.&lt;/p&gt;

&lt;p&gt;This:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hu1RnBlt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kafm7597ac5h5lousktm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hu1RnBlt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kafm7597ac5h5lousktm.png" alt="Ugly App"&gt;&lt;/a&gt;&lt;br&gt;
You look at that and you wonder if it even has any soul. I mean, &lt;em&gt;look&lt;/em&gt; at it. It just wants to die.&lt;/p&gt;

&lt;p&gt;Now, after you have spoiled your eyes on that &lt;em&gt;thing&lt;/em&gt;.&lt;br&gt;
Let me show you another one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3cH_z6C1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8de70dosxhgqtidl0433.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3cH_z6C1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8de70dosxhgqtidl0433.png" alt="Beautiful"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at that, look at the shining beauty. Everyone knows that this is you, you have made your mark in history as a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Being a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt; is a long path. There will be tons of people telling you what not to do. Listen not to them, for they only speak lies. You know what you are doing, and you know it better than anyone, don't let anyone else tell you otherwise. You are you. You are a &lt;strong&gt;&lt;em&gt;Developah&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Note:
&lt;/h3&gt;

&lt;p&gt;Please don't try this at home, or at work. Or anywhere. Anytime.&lt;/p&gt;

</description>
      <category>python</category>
      <category>codequality</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How To Install Python on Debian</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Tue, 20 Oct 2020 16:09:44 +0000</pubDate>
      <link>https://forem.com/tominekan/how-to-install-python-on-debian-4o8o</link>
      <guid>https://forem.com/tominekan/how-to-install-python-on-debian-4o8o</guid>
      <description>&lt;p&gt;Python is a very popular language for all sorts of things like Web Development, Machine Learning (and Data Analysis), Scripting, and other areas. It has become one of the most popular programming languages on Earth with a large community of developers, so, lets get started.&lt;/p&gt;

&lt;h1&gt;
  
  
  Warning:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;If you have come to this tutorial because your installation of python failed, run these commands (replace &lt;code&gt;&amp;lt;python_version&amp;gt;&lt;/code&gt; with the version of your broken installation):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;updatedb
&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-rfv&lt;/span&gt; /usr/local/bin/&amp;lt;python_version&amp;gt; &lt;span class="c"&gt;# or /usr/bin/&amp;lt;python_version&amp;gt;&lt;/span&gt;
&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-rfv&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;locate &amp;lt;python_version&amp;gt;&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;updatedb
locate &amp;lt;python_version&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last command should give you nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Note:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;python3.9&lt;/code&gt; is can be replaced with your python version. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Preparation:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;In order to install python fully, some tools to build python need to be installed, open up the terminal and type:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev tk-dev liblzma-dev lzma
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Installation:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Download the latest version of python from the &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;official python website&lt;/a&gt; or use
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Inflate the python &lt;code&gt;.tar.gz&lt;/code&gt; or &lt;code&gt;.tgz&lt;/code&gt; file by typing:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xf&lt;/span&gt; Python-3.9.0.tar.xz &lt;span class="c"&gt;# or tar -xf Python-3.9.0.tgz&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; Python-3.9.0.tar.xz &lt;span class="c"&gt;# or rm -v Python-3.9.0.tgz&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change Directory into the Python Folder and start configuring python by typing:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;Python-3.9.0
./configure &lt;span class="nt"&gt;--enable-optimizations&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should look something like this:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh4jk8i3rlh9eyikmc15c.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh4jk8i3rlh9eyikmc15c.png" alt="Image Of Python Configuring"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image Of Python Configuring&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To build python, run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nt"&gt;-j&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;nproc&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt; &lt;span class="c"&gt;# Optimized for the number of processors the computer has&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should look like this:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdgt9ax3l3wiwuzbp216v.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdgt9ax3l3wiwuzbp216v.png" alt="Image of Python Being Built"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Image of Python being built&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To Install python, run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;make altinstall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We use altinstall to avoid replacing other versions of python with this one (it tends to break things on the computer).&lt;/p&gt;

&lt;p&gt;This should look like:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhrctl09ov4yn27izy1jj.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhrctl09ov4yn27izy1jj.png" alt="Sudo Make Altinstall Process"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Sudo Make Altinstall Process&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finally, to test if python was successfully installed, type:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3.9 &lt;span class="nt"&gt;--version&lt;/span&gt;
Python 3.9.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>python</category>
    </item>
    <item>
      <title>Python Basic Object Oriented Programming</title>
      <dc:creator>Tomi Adenekan</dc:creator>
      <pubDate>Wed, 07 Oct 2020 17:12:06 +0000</pubDate>
      <link>https://forem.com/tominekan/python-basic-object-oriented-programming-2587</link>
      <guid>https://forem.com/tominekan/python-basic-object-oriented-programming-2587</guid>
      <description>&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; This is a long tutorial, (also, this is my first tutorial, so it will probably not be good :)&lt;/p&gt;

&lt;p&gt;Object Oriented Programming, OOP, is a way to model objects, it is useful for simulations. Before Object Oriented Programming, long pieces of code were written with functions. Functions have their strengths, but they tend to make your code look like a nice bowl of &lt;em&gt;spaghetti&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jQ2cgC7K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h8a0y16ft8hswbtonhwx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jQ2cgC7K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h8a0y16ft8hswbtonhwx.jpeg" alt="Spaghetti Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delicious, but no one can read it, because no one can read &lt;em&gt;spaghetti&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;However, another way to code came up, this method was less like spaghetti and more like neat, organized &lt;strong&gt;breadsticks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UV2KYr0O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pil7we1bsqq22d8bxrjm.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UV2KYr0O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pil7we1bsqq22d8bxrjm.jpeg" alt="Good Breadsticks, MMM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's imagine that we are a kitchen making company. We are also excellent programmers, so we are writing some code to help with the kitchen making process. We need to come up with a generic template for the kitchen. We have to &lt;strong&gt;type&lt;/strong&gt; (typing is important, do not copy and paste) this code in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GenericKitchen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numOfApplicances&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kitchenSize&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numberOfApplicances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numOfApplicances&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchenSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;kitchenSize&lt;/span&gt; &lt;span class="c1"&gt;# kitchenSize is a tuple (width, height)
&lt;/span&gt;        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"I have been inited"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;getInventory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;kitchenWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchenSize&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;kitchenHeight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchenSize&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Number of appliances: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numberOfApplicances&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Size of kitchen: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;kitchenWidth&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; by &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;kitchenHeight&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Breakdown:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GenericKitchen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just used to tell python that &lt;code&gt;GenericKitchen&lt;/code&gt; is a class&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numOfAppliances&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kitchenSize&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numberOfAppliances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numOfAppliances&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchenSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;kitchenSize&lt;/span&gt; 
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"I have been inited"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;__init__&lt;/code&gt; method (a.k.a function) is a dunder method (&lt;strong&gt;d&lt;/strong&gt;ouble &lt;strong&gt;under&lt;/strong&gt;score). A dunder method is a type of function that allows built the class to interact with built in functions, however this &lt;code&gt;__init__&lt;/code&gt; method is important because it allows . &lt;code&gt;self&lt;/code&gt; tells python that this variable is part of the &lt;code&gt;GenericKitchen&lt;/code&gt; class (more on this later).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;getInventory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;kitchenWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchenSize&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;kitchenHeight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kitchenSize&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Number of appliances: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;numberOfApplicances&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Size of kitchen: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;kitchenWidth&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; by &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;kitchenHeight&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get Inventory is a function that inherits from &lt;code&gt;self&lt;/code&gt; and therefore inherits all the variables from self. &lt;code&gt;kitchenWidth&lt;/code&gt; and &lt;code&gt;kitchenHeight&lt;/code&gt; are local variables, meaning that they cannot be used outside of the function.&lt;/p&gt;

&lt;p&gt;To call a class, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;kitchenDimensions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# ^^^^^^^^^^^^^^^ 
# Don't use such long names, they are a pain to type
&lt;/span&gt;&lt;span class="n"&gt;normalKitchen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GenericKitchen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kitchenDimensions&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="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;been&lt;/span&gt; &lt;span class="n"&gt;inited&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might be wondering, why did python print &lt;code&gt;I have been inited&lt;/code&gt; on the screen if you didn't call the function. Well, the reason why is because the &lt;code&gt;__init__&lt;/code&gt; method is a dunder method, it's function is to do something when the class is called. It looks similar to,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&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="s"&gt;"h"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"e"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"l"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"l"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"o"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why, because &lt;code&gt;list&lt;/code&gt; is a class. The list's &lt;code&gt;__init__&lt;/code&gt; method generates a list and returns it to the variable number. &lt;/p&gt;

&lt;h2&gt;
  
  
  Self
&lt;/h2&gt;

&lt;p&gt;Self is a very important concept to understand (understand yourself too :)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;self&lt;/code&gt; is the container for all the variables shared by the class. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RandomClass&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jim"&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;printName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Tomi"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;printName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;setAge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;

&lt;span class="n"&gt;rand&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;RandomClass&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;printName&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="n"&gt;Jim&lt;/span&gt;
    &lt;span class="n"&gt;Tomi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What is happening is that with each class definition, &lt;code&gt;self&lt;/code&gt; is defined with it. &lt;code&gt;self&lt;/code&gt; then becomes the container for everything declared in the class that is shared among the class. When &lt;code&gt;printName&lt;/code&gt; takes the argument &lt;code&gt;self&lt;/code&gt;, it takes all of the variables and functions associated with &lt;code&gt;self&lt;/code&gt; such as &lt;code&gt;self.age&lt;/code&gt; and &lt;code&gt;self.setAge&lt;/code&gt;. When we pass a class to a variable, what is happening is that &lt;code&gt;self&lt;/code&gt; gets passed along with it, &lt;code&gt;self&lt;/code&gt; will then equal the variablename&lt;/p&gt;

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

&lt;p&gt;Classes are important to know to both model things, and for cleaner code. Breadstick Code is better than Spaghetti Code (I just made Breadstick Code Up). Classes are defined using &lt;code&gt;class ClassName&lt;/code&gt;. &lt;code&gt;self&lt;/code&gt; is where all the instances of the class are contained.&lt;/p&gt;

</description>
      <category>python</category>
      <category>oop</category>
    </item>
  </channel>
</rss>
