<?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: My Linh Tran Vo</title>
    <description>The latest articles on DEV Community by My Linh Tran Vo (@mylinh_tranvo).</description>
    <link>https://dev.to/mylinh_tranvo</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%2F1093674%2F0eb1866f-4cb4-4226-bc38-1e206d9817fa.png</url>
      <title>DEV Community: My Linh Tran Vo</title>
      <link>https://dev.to/mylinh_tranvo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mylinh_tranvo"/>
    <language>en</language>
    <item>
      <title>Speed code-reading</title>
      <dc:creator>My Linh Tran Vo</dc:creator>
      <pubDate>Mon, 05 Jun 2023 18:19:19 +0000</pubDate>
      <link>https://dev.to/mylinh_tranvo/speed-code-reading-1179</link>
      <guid>https://dev.to/mylinh_tranvo/speed-code-reading-1179</guid>
      <description>&lt;p&gt;This is the second post in my book review series of &lt;em&gt;The Programmer's Brain by Felienne Hermans&lt;/em&gt;. The main point of this chapter is why code-reading is hard and how to speed-code in programming. &lt;/p&gt;

&lt;p&gt;Normally, developers spend 60% of our time on average reading code than writing it. Yet, we rarely receive training on how to read code effectively, making this task seems harder than it needs to be. In my opinion, having the ability to read and analyse code written by other developers greatly enhances one's productivity.&lt;/p&gt;

&lt;p&gt;Let's have a look at the example below, which is taken from the second chapter of the before mentioned book.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class InsertionSort {
  public static void main (String [] args) {
    int [] array = {45,12,85,32,89,39,69,44,42,1,6,8};
    int temp;
    for (int i = 1; i &amp;lt; array.length; i++) {
      for (int j = i; j &amp;gt; 0; j--) {
        if (array[j] &amp;lt; array [j - 1]) {
          temp = array[j];
          array[j] = array[j - 1];
                        array[j - 1] = temp;
        }
      }
    }
    for (int i = 0; i &amp;lt; array.length; i++) {
      System.out.println(array[i]);
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you read the code snippet above, your brain engages in combining the knowledge stored in your long-term memory (LTM). If you're already familiar with the syntax of a for-loop or an array in Java, you can quickly recall that information.&lt;/p&gt;

&lt;p&gt;Additionally, as you read the code snippet, your brain tries to retain key details like the array declaration with elements, the introduction of a temporary variable, the presence of a nested loop to iterate over the same array, and more. It may also recognise that this code implements the Insertion Sort algorithm, which can be a significant time-saver for those who have previously encountered it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibx2spy2a24giwsmcdvv.png" alt="Cognitive process in remembering code" width="687" height="567"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Felienne Hermans, 2.1.1 What just happened in your brain&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Why code-reading is hard
&lt;/h3&gt;

&lt;p&gt;Remembering a codebase you've never encountered before is akin to trying to recall the phone number of someone you've just met. It's not an easy task. When we try to remember something, we initially rely on our STM before transferring it to LTM. However, &lt;em&gt;&lt;strong&gt;our STM has limited capacity&lt;/strong&gt;&lt;/em&gt; (&lt;a href="https://dev.to/myllinhtran/the-programmers-brain-at-the-first-glance-57f5#:~:text=I%20find%20the%20metaphor%20used%20by%20the%20author%20quite%20insightful.%20It%27s%20like%20comparing%20LTM%20to%20the%20hard%20drive%20of%20a%20computer%2C%20STM%20to%20the%20RAM%20or%20cache%2C%20and%20the%20working%20memory%20to%20the%20brain%27s%20processor."&gt;remember the RAM example?&lt;/a&gt;), making it challenging to retain large amounts of new information. Thus, to overcome this limit, our brain needs to collaborate with the LTM. &lt;/p&gt;

&lt;h3&gt;
  
  
  How to speed-code
&lt;/h3&gt;

&lt;p&gt;To overcome the capacity limit of our STM, we can utilise a technique known as &lt;em&gt;&lt;strong&gt;code chunking&lt;/strong&gt;&lt;/em&gt; along with our knowledge of the programming language used in the code we are reading.&lt;/p&gt;

&lt;p&gt;In essence, code chunking, also referred to as code grouping or code segmentation, is a programming technique that involves breaking down extensive code sections into smaller, more manageable chunks. These chunks are organised into logical sections or modules based on their functionality, purpose, or organisation.&lt;/p&gt;

&lt;p&gt;Since code-chunking helps to read code better, we can then look at how to write chunkable code. One of the methods to help create chunkable code is by using &lt;em&gt;&lt;strong&gt;design patterns&lt;/strong&gt;&lt;/em&gt;. This refers to the general, reusable solutions and proven approaches to commonly occurring problems in software design. These patterns facilitate code comprehension by establishing a common language, providing problem-solving guidelines, organising code structures, promoting code reuse, and documenting design intent. By utilising design patterns, developers can more easily grasp the purpose, functionality, and structure of the codebase, leading to improved code comprehension.&lt;/p&gt;

&lt;p&gt;Another method is to use &lt;em&gt;&lt;strong&gt;comments&lt;/strong&gt;&lt;/em&gt;. While it's true that code should ideally be self-explanatory, comments can be helpful in aiding code comprehension, particularly for novice programmers like myself. High-level comments can provide valuable insights into the codebase and assist in understanding its functionality.&lt;/p&gt;

&lt;p&gt;Hermans also mentions another technique called &lt;em&gt;&lt;strong&gt;leaving beacons&lt;/strong&gt;&lt;/em&gt;. According to her:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Beacons typically indicate that a piece of code contains certain data structures, algorithms, or approaches.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Node:                    # this is a beacon
    def __init__(self, key): 
        self.left = None       # this is another beacon
        self.right = None      # this is also a beacon
        self.val = key 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the given code snippet, thanks to these beacons we know that we have a class called Node that represents a node in a binary tree. Each node contains a value and references to its left and right nodes.&lt;/p&gt;

&lt;p&gt;In summary, this chapter highlights the importance of effective code reading and presents techniques such as code chunking, comments, and leaving beacons to improve code comprehension. It offers valuable insights for both novice and experienced programmers, making it an interesting and informative read.&lt;/p&gt;

</description>
      <category>books</category>
      <category>review</category>
      <category>programming</category>
    </item>
    <item>
      <title>Confusion while coding</title>
      <dc:creator>My Linh Tran Vo</dc:creator>
      <pubDate>Fri, 02 Jun 2023 11:03:42 +0000</pubDate>
      <link>https://dev.to/mylinh_tranvo/the-programmers-brain-at-the-first-glance-57f5</link>
      <guid>https://dev.to/mylinh_tranvo/the-programmers-brain-at-the-first-glance-57f5</guid>
      <description>&lt;p&gt;This is the first post in my book review series.&lt;/p&gt;

&lt;p&gt;The reason I've decided to write this serie is because I struggled a lot with reading and understanding code written by other developers, and I still do. It got even harder when I started focusing more on backend programming instead of frontend. Backend coding is quite different, and it requires a different way of reading.&lt;/p&gt;

&lt;p&gt;I always wondered if other developers have a natural ability to read code like it's a regular language. For me, it wasn't that easy. I realised that it's a skill that can be acquired, so I looked for some guidance.&lt;/p&gt;

&lt;p&gt;My current company provides free access to &lt;a href="https://learning.oreilly.com" rel="noopener noreferrer"&gt;O'Reilly&lt;/a&gt;, an awesome platform with tons of engineering books. I found a book there called &lt;strong&gt;The Programmer's Brain by Felienne Hermans&lt;/strong&gt;, and it caught my attention.&lt;/p&gt;

&lt;p&gt;In the first chapter, the book directly addresses the challenge I face in understanding code: &lt;em&gt;"Decoding your confusion while coding."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Confusion is what I've been feeling all along. Often, I find myself perplexed when deciphering patterns, classes, methods, and variables. Occasionally, I even forget the purpose of a method or variable as I navigate through the codebase.&lt;/p&gt;

&lt;p&gt;According to the author, before we can truly grasp code, we must understand the reasons behind our confusion.&lt;/p&gt;

&lt;p&gt;To put it simply, there are three types of confusion when reading code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lack of knowledge:&lt;/strong&gt; Imagine reading code in a language you're not very familiar with. Every new syntax becomes a roadblock in your code-reading flow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lack of information:&lt;/strong&gt; Imagine reviewing code in a pull request on GitHub. You come across a method that requires you to navigate to another method to understand what it does. But you can't do it directly in the GitHub interface without the help of your editor. You don't have enough information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lack of processing power:&lt;/strong&gt; Think of a function where you understand every syntax and variable. But it involves calculations that are too complex to process mentally without writing down each step of the program.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These confusions stem from issues in different aspects of memory. Lack of knowledge relates to long-term memory (LTM), while lack of information relates to short-term memory (STM). On the other hand, lack of processing power refers to the working memory.&lt;/p&gt;

&lt;p&gt;I find the metaphor used by the author quite insightful. It's like comparing LTM to the hard drive of a computer, STM to the RAM or cache, and the working memory to the brain's processor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq1qdmn4qdg2voisysjw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhq1qdmn4qdg2voisysjw.png" alt="Information filter flow" width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, whenever we read code, our brain utilizes various areas of memory. I guess to enhance our ability to read code, we need to train ourselves to better utilize these cognitive processes.&lt;/p&gt;

</description>
      <category>books</category>
      <category>programming</category>
      <category>learning</category>
      <category>review</category>
    </item>
    <item>
      <title>Level up your skills with pair programming</title>
      <dc:creator>My Linh Tran Vo</dc:creator>
      <pubDate>Thu, 01 Jun 2023 13:35:42 +0000</pubDate>
      <link>https://dev.to/mylinh_tranvo/topics-to-write-about-37di</link>
      <guid>https://dev.to/mylinh_tranvo/topics-to-write-about-37di</guid>
      <description>&lt;p&gt;The focus of today's post is on the well-known concept in the developers' world: &lt;strong&gt;Pair Programming&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When I initially began learning coding, I discovered the concept of Pair Programming from my mentor, who also happens to be my husband. I realised how it aids in enhancing one's programming skills, although I naturally had doubts at first.&lt;/p&gt;

&lt;p&gt;Given my introverted personality and struggle with imposter syndrome, it took me some time to gather the courage to actively approach my engineer colleagues and propose pairing sessions. Typically, I aimed to initiate such sessions at least once every sprint, occasionally even more frequently depending on the number of programming tasks relevant to the current sprint. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what is Pair Programming about?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The name itself is self-explanatory. When practicing Pair Programming, you collaborate with a team member who ideally possesses seniority or more experience either in the programming language or the project you'll be working on. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the benefits of this method?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was honestly surprised at how quickly my programming skills improved after just a few pairing sessions. It got me wondering, why did that happen?&lt;/p&gt;

&lt;p&gt;One of the coolest things about pair programming is the interaction between you and your colleague during the session. In my limited experience with pairing, usually, one person takes the lead while the other follows along, providing comments and insights along the way. This collaboration generates new ideas and leads to better problem-solving (after all, two brains are better than one!). It's like having a study buddy, but for coding.&lt;/p&gt;

&lt;p&gt;Pairing also serves as a way to reinforce the knowledge you gain from observing your teammate's approach to problem-solving. Instead of talking to a rubber duck (yes, some programmers do that), you're discussing your thoughts and explanations with an actual person. And let's be honest, bouncing ideas off a real person should yield better results than talking to an inanimate object. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're a junior developer like me and still getting acquainted with the team, don't hesitate to suggest a pairing session with someone you feel comfortable with. Chances are, they'll be more than willing to join you. &lt;/p&gt;

&lt;p&gt;Don't worry about potentially slowing down your colleague's workflow due to your limited knowledge and experience. Remember, for you, it's a valuable learning experience, and for your colleague, it's an excellent opportunity to practice mentoring and enhance their communication skills.&lt;/p&gt;

&lt;p&gt;Happy pairing!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>novicelearner</category>
      <category>softskills</category>
    </item>
  </channel>
</rss>
