<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leonard Kioi kinyanjui</title>
    <description>The latest articles on DEV Community by Leonard Kioi kinyanjui (@lenniezelk).</description>
    <link>https://dev.to/lenniezelk</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%2F74564%2Fac5b6753-9c5a-4c19-bd0e-a6c456e82d57.JPG</url>
      <title>DEV Community: Leonard Kioi kinyanjui</title>
      <link>https://dev.to/lenniezelk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lenniezelk"/>
    <language>en</language>
    <item>
      <title>How to fix Dart Lang Error: RangeError (index): Index out of range: no indices are valid: 0</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Tue, 23 May 2023 00:56:16 +0000</pubDate>
      <link>https://dev.to/lenniezelk/how-to-fix-dart-lang-error-rangeerror-index-index-out-of-range-no-indices-are-valid-0-2nff</link>
      <guid>https://dev.to/lenniezelk/how-to-fix-dart-lang-error-rangeerror-index-index-out-of-range-no-indices-are-valid-0-2nff</guid>
      <description>&lt;p&gt;In C like languages like JS, its a common operation to assign a value to an array in a &lt;code&gt;for&lt;/code&gt; loop at a given index using []. Like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp935lk0ulnxyrt030ioj.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%2Fuploads%2Farticles%2Fp935lk0ulnxyrt030ioj.png" alt="JS Forloop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Dart lang trying this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkutidet56zeguznzxr5c.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%2Fuploads%2Farticles%2Fkutidet56zeguznzxr5c.png" alt="Dart Incorrect For Loop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You get the error: &lt;code&gt;RangeError (index): Index out of range: no indices are valid: 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The solution is to use List's insert method &lt;code&gt;.insert(i, value)&lt;/code&gt; or &lt;code&gt;.add(value)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdw36h5kc792nli87k8p0.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%2Fuploads%2Farticles%2Fdw36h5kc792nli87k8p0.png" alt="Dart Lang using add in for loop"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dart</category>
    </item>
    <item>
      <title>Pattern Matching in Python</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Sat, 20 Mar 2021 11:03:24 +0000</pubDate>
      <link>https://dev.to/lenniezelk/pattern-matching-in-python-5b9d</link>
      <guid>https://dev.to/lenniezelk/pattern-matching-in-python-5b9d</guid>
      <description>&lt;p&gt;Python 3.10 has introduced &lt;a href="https://en.wikipedia.org/wiki/Pattern_matching"&gt;Pattern Matching&lt;/a&gt;. I've been eager to try this out for some time now. I first found out about pattern matching when I tried out Elixir lang a while back. Python 3.10 is still pre-release, you can download it &lt;a href="https://www.python.org/downloads/release/python-3100a6/"&gt;here&lt;/a&gt; or use &lt;a href="https://asdf-vm.com/#/"&gt;asdf&lt;/a&gt; to install it.&lt;/p&gt;

&lt;p&gt;Let's go through some use-cases which will help in gaining a good grasp of what's possible with pattern matching. In my day job, I use the Django web framework for developing web applications and create RESTful APIs. A common pattern when creating objects and saving in DB is:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;code&gt;get_or_create&lt;/code&gt; returns a tuple of the user and a bool indicating whether the user was created or was just fetched from DB.&lt;/p&gt;

&lt;p&gt;A different approach using pattern matching would be:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The first case matches when a new user is created, and the second matches when the user was not created.&lt;br&gt;
Now, this takes away the readability a bit but &lt;code&gt;get_or_create&lt;/code&gt; is common enough in Django to allow for this. In most cases weigh out the loss of readability vs the gains particularly in the beginning before pattern matching becomes common in the Python community.&lt;/p&gt;

&lt;p&gt;Pattern matching allows for guards. Let's say you need to carry out some action if the newly created user is a superuser:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The first case would match for newly created superusers and the second for the other newly created users.&lt;/p&gt;

&lt;p&gt;Another use-case would be pattern matching the response code when fetching data from the internet using for example the requests library:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;401 | 403&lt;/code&gt; is combining several literals in a single pattern. In other words &lt;code&gt;401 or 403&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is possible to pattern match on dictionary key and values. For example, if you fetch some data and want to extract specific fields from the response dict:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The first case captures the values for &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;email&lt;/code&gt; and ignores the rest.&lt;/p&gt;

&lt;p&gt;I hope this whets your appetite for pattern matching in Python. To learn more on this have a look at Guido's &lt;a href="https://github.com/gvanrossum/patma#tutorial"&gt;tutorial&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Python's removesuffix and removeprefix</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Sat, 27 Feb 2021 14:05:29 +0000</pubDate>
      <link>https://dev.to/lenniezelk/python-s-removesuffix-and-removeprefix-e9p</link>
      <guid>https://dev.to/lenniezelk/python-s-removesuffix-and-removeprefix-e9p</guid>
      <description>&lt;p&gt;Python 3.9 added the string methods &lt;code&gt;removesuffix&lt;/code&gt; and &lt;code&gt;removeprefix&lt;/code&gt;. When I first saw this I wondered why, since the go-to solution for this is &lt;code&gt;strip&lt;/code&gt;, &lt;code&gt;lstrip&lt;/code&gt; and &lt;code&gt;rstrip&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On diving into the documentation, I was surprised to find that &lt;code&gt;strip&lt;/code&gt;, &lt;code&gt;lstrip&lt;/code&gt; and &lt;code&gt;rstrip&lt;/code&gt; treat the input chars as a set of characters to remove not a substring. An example will better explain this. Take for example you have the string &lt;code&gt;test_some_stuff&lt;/code&gt; and you want to remove the prefix. The obvious way would be to go for &lt;code&gt;lstrip&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s = 'test_some_stuff'.lstrip('test_')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The expected output is &lt;code&gt;some_stuff&lt;/code&gt;. The actual output is &lt;code&gt;ome_stuff&lt;/code&gt;. You see the *strip methods will check the string for any of the set of characters provided and remove those from the string until a non-matching character. In the example above the &lt;code&gt;s&lt;/code&gt; is &lt;code&gt;some&lt;/code&gt; was also removed.&lt;br&gt;
The solution is to use &lt;code&gt;removeprefix&lt;/code&gt; and/or &lt;code&gt;removesuffix&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s = 'test_some_stuff'.removeprefix('test_')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output: &lt;code&gt;some_stuff&lt;/code&gt;&lt;br&gt;
If you desire to dig into this more have a look at the PEP that led to these two methods getting added.&lt;br&gt;
&lt;a href="https://www.python.org/dev/peps/pep-0616/"&gt;https://www.python.org/dev/peps/pep-0616/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>removeprefix</category>
      <category>removesuffix</category>
    </item>
    <item>
      <title>Improving readability of Python code</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Mon, 08 Feb 2021 18:36:23 +0000</pubDate>
      <link>https://dev.to/lenniezelk/improving-readability-of-python-code-1ii8</link>
      <guid>https://dev.to/lenniezelk/improving-readability-of-python-code-1ii8</guid>
      <description>&lt;p&gt;Readability of code as defined in Wikipedia:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In computer programming, readability refers to the ease with which a human reader can comprehend the purpose,
control flow, and operation of source code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python is one of the most readable programming languages out there but we can still improve this more by the following software&lt;br&gt;
development best practices and tools provided by Python core language and the Python community. By software development best practices&lt;br&gt;
I am referring to writing clean code. Watch things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use good descriptive variable and function names&lt;/li&gt;
&lt;li&gt;Follow SOLID principles&lt;/li&gt;
&lt;li&gt;Keep functions short&lt;/li&gt;
&lt;li&gt;Follow coding conventions for your programming language e.g PEP8&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Python, type hinting is also a good option since version 3.5. This will be my main focus for this article.&lt;/p&gt;

&lt;p&gt;In this article I am only going to refer to tools specific to Python, later I will add another article on SOLID with examples in Python.&lt;br&gt;
Python uses duck typing to determine the type of a variable. This usually leads to criticism where people say it reduces&lt;br&gt;
readability and I agree with them. I have been using Python for the past five years and it's annoying having to read a&lt;br&gt;
function body in order to know the type of parameters passed in. If it's a dictionary passed in or tuple it's worse because you&lt;br&gt;
have to look through the code to know the type of keys and values of the &lt;code&gt;dict&lt;/code&gt;. I've had to add print statements to determine&lt;br&gt;
the type being passed in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!python
def check_status(project, date):
    pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code above &lt;code&gt;project&lt;/code&gt; and  &lt;code&gt;date&lt;/code&gt; could be anything. Proper naming of the variables helps but still, &lt;code&gt;project&lt;/code&gt; could&lt;br&gt;
be an &lt;code&gt;int&lt;/code&gt;, the project database id, or a user-defined class instance. &lt;code&gt;date&lt;/code&gt; could be an &lt;code&gt;int&lt;/code&gt; or &lt;code&gt;datetime.date&lt;/code&gt; object.&lt;br&gt;
This is the problem typing module was added to solve. I don't think types within the function body are a huge deal since&lt;br&gt;
you can usually determine this from the context, even in Kotlin you don't have to specify the type when declaring a variable&lt;br&gt;
it can usually be inferred from the context.&lt;/p&gt;

&lt;p&gt;With Python's type hints, you can specify the parameter being passed to a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!python
from datetime import date

from .projects import Project

def check_status(project: Project, date: date):
    pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'm a huge fan of namedtuples, they have a smaller memory footprint compared to classes and are more descriptive than tuples. Typing&lt;br&gt;
takes their descriptiveness to a new level. You can specify the type for the field names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from typing import NamedTuple

class Truck(NamedTuple):
    num_wheels: int
    num_axles: int
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Setting up Dart for Local Development</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Mon, 08 Feb 2021 18:33:00 +0000</pubDate>
      <link>https://dev.to/lenniezelk/setting-up-dart-for-local-development-4h8</link>
      <guid>https://dev.to/lenniezelk/setting-up-dart-for-local-development-4h8</guid>
      <description>&lt;p&gt;I've been learning Flutter for mobile development lately. I like the journey so far and I'm going to be posting stuff I learn along the way. First, I'll show how to set up Dart for local development. I use &lt;code&gt;asdf&lt;/code&gt; for managing different versions of language runtimes on my local machine. I found out about it when trying to set up different Python versions. My dev machine comes with Python 3.7 but at work, we use Python 3.6 and I like having the exact version in use. What to do? &lt;code&gt;asdf&lt;/code&gt; to the rescue. &lt;code&gt;asdf&lt;/code&gt; has a plugin system that allows the installation of different language runtimes for example you can install Python 3.5, 3.6, and 3.8 on the same machine and switch between them. A lot of languages are supported you can find these &lt;a href="https://asdf-vm.com/#/plugins-all"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To setup &lt;code&gt;asdf&lt;/code&gt; run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.2`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;0.7.2&lt;/code&gt; with the latest version which you can find &lt;a href="https://github.com/asdf-vm/asdf/releases"&gt;here&lt;/a&gt;. Next add &lt;code&gt;asdf&lt;/code&gt; to your shell like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!shell
echo -e '\n. $HOME/.asdf/asdf.sh' &amp;gt;&amp;gt; ~/.zshrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' &amp;gt;&amp;gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to replace &lt;code&gt;.zshrc&lt;/code&gt; with your shell-specific config file e.g .bashrc. Reload your config file &lt;code&gt;source .zshrc&lt;/code&gt;. You are good to go.&lt;/p&gt;

&lt;p&gt;Now let's set up dart. We begin by installing the dart plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!shell
asdf plugin-add dart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can install dart sdk and tools by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!shell
asdf install dart 2.3.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace 3.2.1 with the latest version or the version you want. You can find these &lt;a href="https://github.com/dart-lang/sdk/releases"&gt;here&lt;/a&gt;. You need to choose a global version. This is the version that will be run when you type &lt;code&gt;dart&lt;/code&gt; in any shell. You can do this by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!shell
asdf global dart 2.3.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also set a version to be used only in the current shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!shell
asdf local dart 2.3.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy darting.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Run A Flutter App on Genymotion</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Mon, 08 Feb 2021 18:30:51 +0000</pubDate>
      <link>https://dev.to/lenniezelk/how-to-run-a-flutter-app-on-genymotion-hah</link>
      <guid>https://dev.to/lenniezelk/how-to-run-a-flutter-app-on-genymotion-hah</guid>
      <description>&lt;p&gt;To run flutter apps for android development you have the option of running the app on android studio AVDs or genymotion. I prefer genymotion since I find more lightweight and I can run vagrant boxes usually for the backend of the application. This is not possible with AVDs. Flutter fails to recognize the devices created using genymotion. After searching around the internet I could not find a solution so I'm going to post what worked for me.&lt;/p&gt;

&lt;p&gt;Ensure you have installed the Android SDKs for the target platforms. You can do this from the SDK manager in Android Studio. Launch Genymotion. On the menu bar go to: &lt;code&gt;Genymotion &amp;gt; Settings&lt;/code&gt;. This will launch a dialog box. Select &lt;code&gt;ADB&lt;/code&gt; in the dialog. Enter the path to your Android SDK folder. For example on my local setup this is &lt;code&gt;/home/lk/Android/Sdk&lt;/code&gt;. Restart Genymotion and launch your devices. I had some problems with devices I had created before I made these changes. In this case I deleted and recreated them. When you run &lt;code&gt;flutter devices&lt;/code&gt; your launched device should appear now. Run &lt;code&gt;flutter run&lt;/code&gt; to launch the app. Happy fluttering.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Named Parameters in Dart, Swift and Python</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Mon, 08 Feb 2021 18:27:02 +0000</pubDate>
      <link>https://dev.to/lenniezelk/named-parameters-in-dart-swift-and-python-369p</link>
      <guid>https://dev.to/lenniezelk/named-parameters-in-dart-swift-and-python-369p</guid>
      <description>&lt;p&gt;In software development, we optimize for readability since code is read more than its written. Named parameters are one way to improve code readability. Let's say we have a function that calculates the distance between two points. Let's take two-point &lt;code&gt;Point&lt;/code&gt; class instances representing the start and end positions. When calling the functions, using positional arguments it's not very clear what is being referred to.&lt;/p&gt;

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


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In Dart:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In Swift:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;On the other hand, using named parameters makes function calls more expressive, it's clear to the reader what the arguments represent. This becomes helpful particularly as the number of arguments grows. Let's add one more argument. In the examples below when calling the functions it's not very clear what the third argument is when it's being read.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Using named parameters is really helpful in such a situation. In the three languages, it's possible to specify that the parameters should be passed as named parameters. In Python, we can add a &lt;code&gt;*,&lt;/code&gt; before the parameters, in dart we can add curly braces around the parameters, and in swift, we can remove the underscore before the parameter names.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>How To Get your PRs merged faster</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Mon, 08 Feb 2021 18:18:06 +0000</pubDate>
      <link>https://dev.to/lenniezelk/how-to-get-your-prs-merged-faster-29bh</link>
      <guid>https://dev.to/lenniezelk/how-to-get-your-prs-merged-faster-29bh</guid>
      <description>&lt;p&gt;Every developer wants their code in production as soon as possible. I am assuming you are in a team or at least have someone else to review your code before its merged into staging or production environments. In the past two years I have seen an improvement in the time it takes to get my code merged.&lt;/p&gt;

&lt;p&gt;I've had my PRs waiting for review for days on end. Its annoying to say the least. I'll share a few points that helped me get my PRs reviewed and merged a lot faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Its a team thing.
&lt;/h2&gt;

&lt;p&gt;As developers we tend to be fiercely independent. This unfortunately does not help deliver products to clients any faster. As a team you need to learn to set aside your individual goals and work on team goals. I used to say things like "I managed to complete all the tasks I set out to do this week" during retro. Now I try to see did we complete all tasks assigned to our team. Changing this mindset is hard and slow but its worth the results.&lt;br&gt;
Agree as a team to be setting aside time to review each other's PRs. Maybe at the start of the day and end of the day. This will leave you with enough time to focus on your tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Have a good relationship with your team mates.
&lt;/h2&gt;

&lt;p&gt;Try and have a good relationship with your team mates. Be interested in them as people. This helps resolve any conflicts when they do arise and we all work better with people we like. Remember at some point you will need help from your team mates and having a good relationship with them allows you to ask for help without things getting weird.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write clean code.
&lt;/h2&gt;

&lt;p&gt;Write good code. No one likes to read spaghetti code and super huge functions in which you have to spend a lot of time piecing together. If you regularly write bad code, your team mates will avoid your PRs and only check them when its completely unavoidable. This is a skill that can be learnt. There are good books and articles out there for this. A quick google search will guide you.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Flutter Loading Screen with Future Builder</title>
      <dc:creator>Leonard Kioi kinyanjui</dc:creator>
      <pubDate>Mon, 08 Feb 2021 18:10:32 +0000</pubDate>
      <link>https://dev.to/lenniezelk/flutter-loading-screen-with-future-builder-4j8n</link>
      <guid>https://dev.to/lenniezelk/flutter-loading-screen-with-future-builder-4j8n</guid>
      <description>&lt;p&gt;When developing UIs you need to give the user some feedback on a long-running process. A loading widget is normally the go-to solution. In React you would have a boolean property in the components state. If for example, you are fetching some data from the internet, you would set the boolean to &lt;code&gt;true&lt;/code&gt;. In the component's &lt;code&gt;render&lt;/code&gt; method you would display a loading widget based on the value of that boolean property. When you have your data you show the right component. Something like:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This can be achieved easily in Flutter with &lt;a href="https://api.flutter.dev/flutter/widgets/FutureBuilder-class.html"&gt;Future Builder&lt;/a&gt;. FutureBuilder allows you to specify a future and a builder function. The builder function will be passed snapshots based on the state of the future. You can then check the snapshot and display your loading widget. The same can be achieved by using view models and state management tools like &lt;a href="https://pub.dev/packages/provider"&gt;Provider&lt;/a&gt;. This is so much easier though. Example:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
