<?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: Marco Ledesma</title>
    <description>The latest articles on DEV Community by Marco Ledesma (@m4rcoperuano).</description>
    <link>https://dev.to/m4rcoperuano</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%2F236416%2F5de0fc37-c0ae-40de-b75c-b9bdc014c229.jpeg</url>
      <title>DEV Community: Marco Ledesma</title>
      <link>https://dev.to/m4rcoperuano</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m4rcoperuano"/>
    <language>en</language>
    <item>
      <title>Daily Stand Ups for Devs</title>
      <dc:creator>Marco Ledesma</dc:creator>
      <pubDate>Sat, 27 Jul 2024 17:24:06 +0000</pubDate>
      <link>https://dev.to/m4rcoperuano/daily-stand-ups-for-devs-2j41</link>
      <guid>https://dev.to/m4rcoperuano/daily-stand-ups-for-devs-2j41</guid>
      <description>&lt;p&gt;During a recent vacation, I wanted to code...something. My background is primarily in .NET and Laravel, with Laravel being my most go-to stack since its quick to develop anything. Anywho, at my company we've been managing our daily stand ups in a Confluence doc, constantly updating it as the sprint goes on. It turned out to be a really good system to keep track of everything we're doing and have it documented for each sprint. For example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Say your Sprint is called Abracadabra, you would create a corresponding Confluence document with the same name.&lt;/li&gt;
&lt;li&gt;You would then start by adding a table per day. Members of your team would insert their "In Progress" tasks, their "Priorities", and any "Blockers".&lt;/li&gt;
&lt;li&gt;You continue to insert new tables as the days of the sprint continue, until the sprint is over.&lt;/li&gt;
&lt;li&gt;Then you create another Sprint doc and repeat.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Although this worked well, we found that there were a lot of conflicts that occurred as a result, since all of us were updating the same confluence doc. This is where the idea for this app came along.&lt;/p&gt;

&lt;h3&gt;
  
  
  Daily Stand Up App
&lt;/h3&gt;

&lt;p&gt;The goal of this app is to replicate the same experience of writing stand up entries within a Document, with the exception that it would be impossible to have conflicts. &lt;/p&gt;

&lt;p&gt;The way it works is like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You create a Stand Up group, which would be your Sprint name. 
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60etmqmbao3c2pmkngrn.png" alt="Creating a Group, aka Sprint" width="800" height="201"&gt;
&lt;/li&gt;
&lt;li&gt;Once created, click "View". This will take you to a place to add entries.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb5xgqcr7wr495cb5r1vb.png" alt="Viewing the Group and its Stand Up Entries" width="800" height="315"&gt;
&lt;/li&gt;
&lt;li&gt;You can submit your first entry. All you need is a Date and your stand up details.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxacbbrrgvlks26rpyia.png" alt="Create your Stand Up Entry" width="800" height="201"&gt;
&lt;/li&gt;
&lt;li&gt;And then at any moment you can edit that entry.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tr9i3hrno8olkketiac.png" alt="Edit your Stand Up Entries" width="800" height="183"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All your stand up entries are under the stand up "group", which is under the currently selected "team". You can freely create teams, invite others to your team, and have everyone see each others stand up information (though only the author of the stand up entry can edit or delete their entry). &lt;/p&gt;

&lt;h3&gt;
  
  
  Open Source
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/m4rcoperuano/daily-standup-2" rel="noopener noreferrer"&gt;https://github.com/m4rcoperuano/daily-standup-2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wanted to build an app that is more of a tool rather than a product (though it can certainly be one). I also understand that not everyone wants to use a hosted platform where you, and others in your company, put sensitive information into. So by open sourcing it, you can pull the repository down and host it in any environment you wish. For the time being, I've hosted mine on a subdomain of my website: &lt;a href="https://standups.sunnyorlando.dev" rel="noopener noreferrer"&gt;https://standups.sunnyorlando.dev&lt;/a&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Is It Production Ready?
&lt;/h3&gt;

&lt;p&gt;Not quite. First, there is no landing page that advertises what this app does effectively (the landing page of the site is still Laravel's default one). Also, if you register for an account, you will be greeted with an empty "Dashboard" page (part of the starter kit I used). Otherwise, everything else should work as intended with security in mind. There's more work to do still when it comes to Unit tests too, and maybe some better coding practices. &lt;/p&gt;

&lt;p&gt;Overall, I'd say I've put about 10-12 or so hours into the project, and at best can be called a Beta.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tech Stack Details
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The app uses Laravel 11.x, PHP 8.3, and MySQL 8.0. &lt;/li&gt;
&lt;li&gt;I used &lt;a href="https://jetstream.laravel.com/" rel="noopener noreferrer"&gt;Laravel Jetstream&lt;/a&gt; to kickstart a few things for me, such as Authentication, Teams, and API support.&lt;/li&gt;
&lt;li&gt;The text editor for formatting your stand up entry is &lt;a href="https://ckeditor.com/docs/ckeditor5/latest/examples/index.html" rel="noopener noreferrer"&gt;CKEditor&lt;/a&gt; (which has come a long way!).&lt;/li&gt;
&lt;li&gt;The app is hosted on a decent-size Linode instance, with the provisioning of the server handled by Laravel Forge.&lt;/li&gt;
&lt;li&gt;It uses Redis as well for caching and user sessions.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What's next?
&lt;/h3&gt;

&lt;p&gt;As time permits, I plan to continue adding features to the project, such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mood tracking: Allows the team to see how everyone is feeling which, if you have a great company culture, may be helpful to see how your teammates are feeling sprint to sprint.&lt;/li&gt;
&lt;li&gt;Sprint Retro Automation: Creating sprint retro docs and trying to remember what exactly were issues during the sprint is hard, our memories are not reliable. Therefore, why not have users enter any sprint-retro information whenever they submit their daily stand up? Almost like building a list of notes throughout the sprint that get dumped into a Sprint-Retro bucket, of sorts. Furthermore, leveraging OpenAI, summarization of key points within the sprint should be fairly easy.&lt;/li&gt;
&lt;li&gt;Integrations with Slack, Github, and JIRA? &lt;/li&gt;
&lt;li&gt;Make Stand Ups fun! Honestly, its such a drag sometimes to just talk through everyone's todolists. There's an NPM package called beanheads (&lt;a href="https://beanheads.robertbroersma.com/" rel="noopener noreferrer"&gt;https://beanheads.robertbroersma.com/&lt;/a&gt;) that allows each person to customize their avatar. Then, my plan is to show these characters on the screen around a circle of sorts, maybe with a spinning arrow to navigate to the next person to begin giving their update, rather than being called upon by the SCRUM master (though I'm still thinking through all this). I really want the remote-nature of development work to feel more connected. Reading documents, meeting once a day, etc. it all feels so...isolating at times with remote work. Why not have a place where you can have fun with these mandatory meetings, perhaps with web-based games integrated in it? But i digress.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Questions
&lt;/h3&gt;

&lt;p&gt;In my time as a dev, I've been exposed to a variety of ways to do stand ups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Via Slack&lt;/li&gt;
&lt;li&gt;Via Meetings where nothing is written down&lt;/li&gt;
&lt;li&gt;Via Emails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I haven't found any that quite work as well as having an ongoing doc per Sprint, but perhaps we've been doing it wrong? I would love to know how your company handles daily stand ups and any pains associated with it :).&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>laravel</category>
      <category>vue</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Building Apps That Don't Make Any Money</title>
      <dc:creator>Marco Ledesma</dc:creator>
      <pubDate>Thu, 11 Jul 2024 00:07:37 +0000</pubDate>
      <link>https://dev.to/m4rcoperuano/building-apps-that-dont-make-any-money-4k9k</link>
      <guid>https://dev.to/m4rcoperuano/building-apps-that-dont-make-any-money-4k9k</guid>
      <description>&lt;p&gt;I've forgotten when it was released, but at some point in the past, I released an app called &lt;a href="https://sunnyorlando.dev/billpanda" rel="noopener noreferrer"&gt;Bill Panda&lt;/a&gt;, which you can read about following the link. It was my first complete app that I built to solve a personal problem. I went through the full experience of building it, tearing it down, rebuilding it, tearing it down again, and building it again. I created an LLC that the app is published under, a business banking account, and a light website to market the app. This is a post reflecting on some things I learned during this experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it in the first place
&lt;/h2&gt;

&lt;p&gt;For a long time I was using a spreadsheet to manage my recurring bills. There were apps out there, like Mint, that automate some of this stuff for you. But I always disliked that I couldn't mark my bills as paid ahead of time. I also couldn't use the data to create any cash projections. So i thought, why not build my own? It needed to do a few simple things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Track my recurring bills.&lt;/li&gt;
&lt;li&gt;Notify me of upcoming bills.&lt;/li&gt;
&lt;li&gt;Allow me to mark them as paid/unpaid.&lt;/li&gt;
&lt;li&gt;Let me add notes&lt;/li&gt;
&lt;li&gt;And eventually, reporting, so I can make cash projections.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I originally built it using Laravel - a web application framework. The frontend was all in Vue and the backend was PHP. You can see a demo of it here (I demoed it for a Hackathon, which I won second place :D): &lt;a href="https://devpost.com/software/family-newsletter." rel="noopener noreferrer"&gt;Bill Panda Web&lt;/a&gt;. The second time I used React Native. The third and final time, it was all Swift UI. It's been a fun journey building the app. I'm finally at a point where I can begin thinking about new features for it. But before I get to those, I thought I'd share a few mistakes I made along the way. You may find this helpful if:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You are about to build a payment system with recurrence.&lt;/li&gt;
&lt;li&gt;You work with recurring events in general.&lt;/li&gt;
&lt;li&gt;You plan on building your own app.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Mistakes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Regarding Recurring Events - Don't store every occurrence in your database!
&lt;/h3&gt;

&lt;p&gt;When I built the web-based version, i made a critical mistake. For my use-case, you should never populate your database with all occurrences of a recurring event. Not only are you creating a TON of data, you also corner yourself by having to answer questions like "this event repeats daily until the end of time, do i create every single event until the end of time in my database? Do i cap it to the first 1,000 events?” Whats the right number of recurring events to create? There is no right number. &lt;/p&gt;

&lt;p&gt;During my research developing recurring events, I ran into this amazing post on Github by user bmoeskau: &lt;a href="https://github.com/bmoeskau/Extensible/blob/master/recurrence-overview.md" rel="noopener noreferrer"&gt;https://github.com/bmoeskau/Extensible/blob/master/recurrence-overview.md&lt;/a&gt;. This post sent me in the right direction. You do not create every occurrence, you compute them. You follow a recurrence rule standard that's been around since &lt;a href="https://en.wikipedia.org/wiki/ICalendar" rel="noopener noreferrer"&gt;1998&lt;/a&gt;. I highly suggest reading the github post I linked above if you are going to create a recurring event system!&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Your friends and family may not like to use your app if they know that you have access to their finances
&lt;/h3&gt;

&lt;p&gt;If you've built the application, you have access to the database. You can promise you'll never look at the database, but cmon, you probably will. Trust is a big thing when it comes to finances - your friends and family probably won't want to use your app if it means handing over all their data. You have to &lt;strong&gt;guarantee&lt;/strong&gt; that their data will not be accessible to you. During the time that I developed the web app, I did not have a way around this. But by pivoting the technology I used, I did find a way. &lt;/p&gt;

&lt;p&gt;At some point in the last couple of years, Apple announced SwiftUI. &lt;br&gt;
This looked so interesting that I ended up diving back into iOS development (I've jumped back and forth between iOS/Android app development and Web Development in my history). As I started working in SwiftUI, I thought, why not try CoreData one more time? Maybe work with CoreData and CloudKit. If i was to incorporate CloudKit, the user never has to sign into the app. All their data can live inside a private CloudKit container that I, as the developer, have ZERO access to. It also has an incredible generous free tier that makes it so that I don't have to pay anything. Furthermore, CloudKit data syncs across your iOS devices seamlessly. It had everything I needed (it was also a huge, painful, learning curve). Happy to say that I made the right decision :). The app is running fully on CloudKit.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Not working with technology you love
&lt;/h3&gt;

&lt;p&gt;If you have a hobby project and your goal isn't really to get rich, then don't work with technology you loath. This is not to say that I hate Laravel or Vue (they powered the first iteration) - I truly love those technologies. No, the one i tend to loath sometimes is React Native -- which I used for the second iteration of the app. &lt;/p&gt;

&lt;p&gt;If you look at a prior post of mine (&lt;a href="https://dev.to/m4rcoperuano/react-native-best-practices-when-using-flatlist-or-sectionlist-4j41"&gt;https://dev.to/m4rcoperuano/react-native-best-practices-when-using-flatlist-or-sectionlist-4j41&lt;/a&gt;), I wrote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;...React Native has been the only [language]that has been able to change my mind and has me questioning why I would ever want to code in Swift or Java again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Looking back, this is still true.....sometimes. Sometimes I hate it. The debugging (not knowing if the bug is in your javascript code, your native module, the react native run time, or once its packaged) is maddening. This doesn't mean I would never code with React Native. For example, if you want to make a cross-platform app, or if it's a requirement from your client/job, then its no problem. But if you're doing it for fun, and you don't care about cross-platform, then save yourself the headache. Work with the native code and framework.&lt;/p&gt;

&lt;p&gt;But I digress. If you are working on a hobby project, work with tech that you love. It will motivate you to keep going back to it. Personally, I love using SwiftUI and sometimes wish it was all I did. &lt;/p&gt;
&lt;h2&gt;
  
  
  Sidequest: Why Is SwiftUI Awesome?
&lt;/h2&gt;

&lt;p&gt;SwiftUI is pretty darn cool once you get the hang of it. This is a framework that Apple has developed so that its easier to make native iOS apps. Here's a quick example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;MonthHeader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;monthName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;totalDue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;amountPaid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kt"&gt;VStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;alignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;leading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;spacing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;monthName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;font&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;foregroundColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textGeneral&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

         &lt;span class="kt"&gt;HStack&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="n"&gt;amountPaid&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toCurrency&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt; paid "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;foregroundColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;font&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subheadline&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bold&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"out of &lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="n"&gt;totalDue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toCurrency&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="kt"&gt;Spacer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
         &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;background&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;thinMaterial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listRowInsets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;EdgeInsets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
         &lt;span class="nv"&gt;top&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="nv"&gt;leading&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="nv"&gt;bottom&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="nv"&gt;trailing&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="p"&gt;}&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 a pretty simple view that displays this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs37vf6c98m4jd1lw9zyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs37vf6c98m4jd1lw9zyn.png" alt="Image description" width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I find this code super readable. You have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 required parameters defined at the very top. These are your "props", essentially (if you are familiar with Vue or React)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;MonthHeader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;monthName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;totalDue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;amountPaid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;....&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You then have you "body" field, which is essentially a &lt;code&gt;template&lt;/code&gt; tag, or what you return from a React component (again, if you are familiar with web). You can learn what the code does by reading my comments below:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;   &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;//VStack stands for Vertical Stack&lt;/span&gt;
      &lt;span class="kt"&gt;VStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;alignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;leading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;spacing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="c1"&gt;//Inside it we have a Text field that displays your prop,&lt;/span&gt;
         &lt;span class="c1"&gt;// monthName. It's then modified to look like a headline &lt;/span&gt;
         &lt;span class="c1"&gt;// with a specific foregroundColor.&lt;/span&gt;
         &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;monthName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;font&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;foregroundColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textGeneral&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

         &lt;span class="c1"&gt;//Then you have an HStack, or Horizontal Stack, that takes&lt;/span&gt;
         &lt;span class="c1"&gt;// your prop amountPaid and uses an extension (a function) &lt;/span&gt;
         &lt;span class="c1"&gt;// that converts it to currency. It also sets the color to a&lt;/span&gt;
         &lt;span class="c1"&gt;// specific "brand" color that I selected, and makes the &lt;/span&gt;
         &lt;span class="c1"&gt;// font a subheadline that is bolded. &lt;/span&gt;

         &lt;span class="c1"&gt;//Finally, another text element is right next to it &lt;/span&gt;
         &lt;span class="c1"&gt;// (concatenated) that represents the amount due. The reason &lt;/span&gt;
         &lt;span class="c1"&gt;// is separated from the first Text element is because I &lt;/span&gt;
         &lt;span class="c1"&gt;// don't want it to be colored at all.&lt;/span&gt;
         &lt;span class="kt"&gt;HStack&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="n"&gt;amountPaid&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toCurrency&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt; paid "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;foregroundColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
               &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;font&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subheadline&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bold&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"out of &lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="n"&gt;totalDue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toCurrency&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="kt"&gt;Spacer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
         &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="c1"&gt;//Then i apply some padding, change its background color to a &lt;/span&gt;
      &lt;span class="c1"&gt;// .thinMaterial, which apple has provided -- it changes the &lt;/span&gt;
      &lt;span class="c1"&gt;// background color to be blurred and translucent&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;background&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;thinMaterial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
      &lt;span class="c1"&gt;//finally, i remove any default padding provided by default &lt;/span&gt;
      &lt;span class="c1"&gt;// from Apple's SwiftUI framework&lt;/span&gt;
      &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listRowInsets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;EdgeInsets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
         &lt;span class="nv"&gt;top&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="nv"&gt;leading&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="nv"&gt;bottom&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="nv"&gt;trailing&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compared to the past, where you would have to create Swift ViewControllers, or worse, Objective-C ViewControllers, this is much welcome change. If my job was to create Swift apps full time, man, that would be exciting. &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;It took about 3 years to get the app to a state where I was happy with it. The app was built during nights and weekends, sometimes on vacations. It, thankfully, wasn't too stressful to build. If you love to code and you have a goal in mind, then you'll find the time to make the app that you always wanted to make. Its okay if it takes a long time--we have day jobs. Will I ever make money on this app? I don't really know and I don't really think about it. It serves its purpose to me and a few others (I have about 40+ daily users!). That's all I need to be content with it :).&lt;/p&gt;

</description>
      <category>swiftui</category>
      <category>startup</category>
      <category>laravel</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Coding in a Monolith</title>
      <dc:creator>Marco Ledesma</dc:creator>
      <pubDate>Mon, 30 May 2022 20:24:58 +0000</pubDate>
      <link>https://dev.to/m4rcoperuano/coding-in-a-monolith-4a80</link>
      <guid>https://dev.to/m4rcoperuano/coding-in-a-monolith-4a80</guid>
      <description>&lt;p&gt;In my experience, I found that web application monoliths are very common in a lot of successful businesses. There are probably many reasons for this, but I found that most companies start out, and continue to build upon, their &lt;a href="https://www.productplan.com/glossary/minimum-viable-product/"&gt;minimum-viable product&lt;/a&gt;. This type of product is usually prototyped quickly, using full-stack web-frameworks like Django, Laravel, of even ASP.NET's MVC framework. Developers then continue to build on top of that MVP as new feature requests are asked from them -- this is largely due to finding &lt;a href="https://www.productplan.com/glossary/product-market-fit/"&gt;product-market fit&lt;/a&gt;, leading to an app that is sometimes built on a wobbly foundation... so, what do you do if you are working with a product like this?&lt;/p&gt;

&lt;h3&gt;
  
  
  To Rebuild or Continue the &lt;a href="https://m.signalvnoise.com/the-majestic-monolith/"&gt;Majestic Monolith&lt;/a&gt;?
&lt;/h3&gt;

&lt;p&gt;It almost feels like a video game. Now that you've progressed in the game, do you restart your character and add points to the areas you know you need to be successful (now that you know what the game is like), or do you continue from where you left off, and try to adapt your acquired skills as the game continues to take you to uncharted places? &lt;/p&gt;

&lt;h4&gt;
  
  
  To Rebuild:
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Pros
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;No more legacy code 😸&lt;/li&gt;
&lt;li&gt;You can now use the latest technologies 📡&lt;/li&gt;
&lt;li&gt;You understand the business better, so your architecture will be significantly better thanks to the advantage of hindsight. 👀&lt;/li&gt;
&lt;li&gt;Overall, better development experience 🎉&lt;/li&gt;
&lt;li&gt;Higher flexibility to adapt to future business changes. With better architecture comes better flexibility. ⚡️&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Cons
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Your customers are not going to wait until a new build is complete, they will continue to ask for more features. Now you have a problem - adding features to the old app &lt;em&gt;while&lt;/em&gt; building the new. 😤&lt;/li&gt;
&lt;li&gt;Introduction of a new system of bugs 🐛. Despite the old system having a lot of legacy garbage, its had years of bug fixes &amp;amp; testing. This rebuild will not have that out the gate, leading to some instability in the new system.&lt;/li&gt;
&lt;li&gt;Questions from stakeholders asking you - when is it going to be done? 💀 This is the most challenging thing to predict. It took years to get you to the legacy system - how does one estimate a rebuild of an entire system?&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  To Continue? 🚌
&lt;/h4&gt;

&lt;p&gt;Continuing an app doesn't really require Pros/Cons. If you're considering a rebuild, you already know the cons of continuing the current monolith. The Pros are usually straight forward - features continue to be built, albeit at a slower pace.&lt;/p&gt;

&lt;h4&gt;
  
  
  Third Option? 🏗
&lt;/h4&gt;

&lt;p&gt;This last option is a combination of the other two -- you build parts of a brand new system, while also continuing your existing monolith. For example, say you have a subsystem to handle notifications. I can imagine your monolithic folder structure would look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/
   Events/
      NotificationDelivered.php
   Mail/
      OrderSuccessfulEmail.php
      ItemShippedEmail.php
   Jobs/
      ProcessOrder.php
      ShipItems.php
   Actions/
      SubmitOrder.php
      ShipOrders.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;SubmitOrder.php&lt;/code&gt; will dispatch the &lt;code&gt;ProcessOrder.php&lt;/code&gt; job. This job then delivers an Email to the user (&lt;code&gt;OrderSuccessfulEmail.php&lt;/code&gt;), which then fires a generic event called &lt;code&gt;NotificationDelivered.php&lt;/code&gt;. You can consider these 3 files as part of a larger "&lt;a href="https://martinfowler.com/bliki/DomainDrivenDesign.html"&gt;domain&lt;/a&gt;", such as "Orders". Some of the other files can be considered as part of another domain called "Shipping". Let's refactor these classes around domains.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/
   Events/
      NotificationDelivered.php

domain/
   Orders/
      Mail/
         OrderSuccessfulEmail.php
      Jobs/
         ProcessOrder.php
      Actions/
         SubmitOrder.php
   Shipping/
      Mail/
         ItemShippedEmail.php
      Jobs/
         ShipItems.php
      Actions/
         ShipOrders.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So what do we gain from this? &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your domains are clearly defined within these domain folders. &lt;/li&gt;
&lt;li&gt;All these features are just groups of related domain functions. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Having these domains split into their own feature folders allows us to detach these domains in the future. For example, the entire Shipping feature could be copied into its own Laravel instance, run separately as a micro-service someday 😵‍💫. Of course, it doesn't need to happen right away, but moving your monolith to a pattern like this will put you in the right direction for slowly breaking it apart in the future 😸. &lt;/p&gt;

&lt;p&gt;At my current company, this has been our approach. It allows us to bite chunks out of this elephant a little bit at a time. It’s a huge challenge considering we’re also growing as an organization and introducing new processes all at the same time. Growth pains of a startup 😬. &lt;/p&gt;

&lt;p&gt;Just wanted to share some of my experience. If you’ve worked with monoliths in the past, I’d love to hear how your company was able to adapt! The more knowledge we can share, the better ❤️.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>tips</category>
      <category>webdev</category>
      <category>testing</category>
    </item>
    <item>
      <title>React Native: Best Practices When Using FlatList or SectionList</title>
      <dc:creator>Marco Ledesma</dc:creator>
      <pubDate>Wed, 25 Sep 2019 17:10:30 +0000</pubDate>
      <link>https://dev.to/m4rcoperuano/react-native-best-practices-when-using-flatlist-or-sectionlist-4j41</link>
      <guid>https://dev.to/m4rcoperuano/react-native-best-practices-when-using-flatlist-or-sectionlist-4j41</guid>
      <description>&lt;p&gt;Have you had any performance issues when using React Native &lt;a href="https://facebook.github.io/react-native/docs/sectionlist" rel="noopener noreferrer"&gt;SectionList&lt;/a&gt; or &lt;a href="https://facebook.github.io/react-native/docs/flatlist" rel="noopener noreferrer"&gt;FlatList&lt;/a&gt;? I know I did. It took me many hours and one time almost an entire week to figure out why performance was so poor in my list views (seriously, I thought I was going to lose it and never use React Native again). So let me save you some headaches (or maybe help you resolve existing headaches 😊) by providing you with a couple of tips on how to use SectionLists and FlatLists in a performant way!&lt;/p&gt;

&lt;p&gt;(This article assumes you have some experience with React Native already).&lt;/p&gt;

&lt;h2&gt;
  
  
  Section List Example
&lt;/h2&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbpfrrwuna192gjre5aub.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbpfrrwuna192gjre5aub.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above is a simple app example where users manage their tasks. The headers represent “categories” for each task, the rows represent a “task” that the user has to do by what date, and the Check is a button that marks tasks as “done” – simple!&lt;/p&gt;

&lt;p&gt;From a frontend perspective, these would be the components I would design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CategoryHeader&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Contains the Title and an arrow icon on the left of it.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;TaskRow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Contains the task’s Title, details, and the Check button that the user can interact with.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;TaskWidget&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Contains the logic that formats my task data.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This also uses React Native’s SectionList component to render those tasks.&lt;br&gt;
And here’s how my &lt;strong&gt;SectionList&lt;/strong&gt; would be written in my &lt;strong&gt;TaskWidget&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SectionList&lt;/span&gt;
    &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ThemeDefaults&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentBackgroundColor&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;contentContainerStyle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;renderSectionHeader&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;renderHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//This function returns my `CategoryHeader` component&lt;/span&gt;
    &lt;span class="p"&gt;}}&lt;/span&gt; 
    &lt;span class="nx"&gt;sections&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{[&lt;/span&gt;
       &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;General Project Management&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt; &lt;span class="p"&gt;]},&lt;/span&gt;
       &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;additional&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="nx"&gt;omitted&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;simplicity&lt;/span&gt;
     &lt;span class="p"&gt;]}&lt;/span&gt;
    &lt;span class="nx"&gt;keyExtractor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty straight forward right? The next thing to focus on is what each component is responsible for (and this is what caused my headaches).&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Issues
&lt;/h2&gt;

&lt;p&gt;If we look at &lt;strong&gt;TaskRow&lt;/strong&gt;, we see that we have several pieces of information that we have to display and calculate:&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9mtvbm9xi57dtr1e9pig.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9mtvbm9xi57dtr1e9pig.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Title&lt;/li&gt;
&lt;li&gt;Description&lt;/li&gt;
&lt;li&gt;Due date formatted&lt;/li&gt;
&lt;li&gt;Due date from now calculated&lt;/li&gt;
&lt;li&gt;“Check” button action&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Previously, I would’ve passed a javascript object as a “prop” to my &lt;strong&gt;TaskRow&lt;/strong&gt; component. Maybe an object that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Contact Joe Bob"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"description:"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Need to talk about project assesment"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"due_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2019-07-20"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then would have my &lt;strong&gt;TaskRow&lt;/strong&gt; display the first two properties without any modification and calculate the due dates on the fly (all this would happen during the component’s “render” function). In a simple task list like above, that would probably be okay. But when your component starts doing more than just displaying data, &lt;strong&gt;following this pattern can significantly impact your list’s performance and lead to antipatterns&lt;/strong&gt;. I would love to spend time describing how SectionLists and FlatLists work, but for the sake of brevity, let me just tell you the better way of doing this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Improvements
&lt;/h2&gt;

&lt;p&gt;Here are some rules to follow that will help you avoid performance issues in your lists:&lt;/p&gt;

&lt;h4&gt;
  
  
  I. Stop doing calculations in your SectionList/FlatList header or row components.
&lt;/h4&gt;

&lt;p&gt;Section List Items will render whenever the user scrolls up or down in your list. As the list recycles your rows, new ones that come into view will execute their &lt;code&gt;render&lt;/code&gt; function. With this in mind, you probably don’t want any expensive calculations during your Section List Item's &lt;code&gt;render&lt;/code&gt; function.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick Story&lt;/p&gt;

&lt;p&gt;I made the mistake on instantiating &lt;code&gt;moment()&lt;/code&gt; during my task component's render function (&lt;code&gt;moment&lt;/code&gt; is a date utility library for javascript). I used this library so I could calculate how many days from "now" my task was due. In another project, I was doing money calculations and date formatting in each of my SectionList row components (also using &lt;code&gt;moment&lt;/code&gt; for date formatting). During these two instances, I saw performance drop significantly on Android devices. Older iPhone models were also affected. I was literally pulling my hair out trying to find out why. I even implemented Pure Components, but (like I’ll describe later) I wasn’t doing this right.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So when should you do these expensive calculations? Do it before you render any rows, like in your parent component’s &lt;code&gt;componentDidMount()&lt;/code&gt; method (do it asynchronously). Create a function that “prepares” your data for your section list components. Rather than “preparing” your data inside that component.&lt;/p&gt;

&lt;h4&gt;
  
  
  II. Make your SectionList’s header and row components REALLY simple.
&lt;/h4&gt;

&lt;p&gt;Now that you removed the computational work from the components, what should the components have as props? Well, these components should just display text on the screen and do very little computational work. Any actions (like API calls or internal state changes that affect your stored data) that happen inside the component should be pushed “up” to the parent component. So, instead of building a component like this (that accepts a javascript object):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TaskRow&lt;/span&gt; &lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write a component that takes in all the values it needs to display:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TaskRow&lt;/span&gt; 
   &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;dueDateFormatted&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dueDateFormatted&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;dueDateFormattedFromNow&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dueDateFormattedFromNow&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;onCheckButtonPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;markTaskAsDone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how the &lt;code&gt;onCheckButtonPress&lt;/code&gt; is just a callback function. This allows the component that is using TaskRow to handle any of the TaskRow functions. &lt;strong&gt;Making your SectionList components simpler like this will increase your Section List’s performance, as well as making your component’s functionality easy to understand&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  III. Make use of Pure Components
&lt;/h4&gt;

&lt;p&gt;This took a while to understand. Most of our React components extend from &lt;code&gt;React.Component&lt;/code&gt;. But using lists, I kept seeing articles about using &lt;code&gt;React.PureComponent&lt;/code&gt;, and they all said the same thing:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When props or state changes, PureComponent will do a shallow comparison on both props and state&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codeburst.io/when-to-use-component-or-purecomponent-a60cfad01a81" rel="noopener noreferrer"&gt;https://codeburst.io/when-to-use-component-or-purecomponent-a60cfad01a81&lt;/a&gt; and many other React Native Posts&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I honestly couldn’t follow what this meant for the longest time. But now that I do understand it, I’d like to explain what this means in my own words.&lt;/p&gt;

&lt;p&gt;Let’s first take a look at our TaskRow component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TaskRow&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PureComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;prop&lt;/span&gt; &lt;span class="nx"&gt;definitions&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
   &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
   &lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TaskRow&lt;/span&gt; 
   &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;dueDateFormatted&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dueDateFormatted&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;dueDateFormattedFromNow&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dueDateFormattedFromNow&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;onCheckButtonPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;markTaskAsDone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;taskObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;TaskRow&lt;/strong&gt; has been given props that are all primitives (with the exception of &lt;code&gt;onCheckButtonPress&lt;/code&gt;). What PureComponent does is that it’s going to look at all the props it’s been given, it’s then going to figure out if any of those props have changed (in the above example: has the &lt;code&gt;description&lt;/code&gt; changed from the previous description it had? Has the &lt;code&gt;title&lt;/code&gt; changed?). If so, it will re-render that row. If not, it won’t! And it won’t care about the onCheckButtonPress function. It only cares about comparing primitives (strings, numbers, etc.).&lt;/p&gt;

&lt;p&gt;My mistake was not understanding what they meant by "shallow comparisons". So even after I extended PureComponent, I still sent my TaskRow an object as a prop, and since an object is not a primitive, it didn’t re-render like I was expecting. At times, it caused my other list row components to rerender even though nothing changed! So don’t make my mistake. &lt;strong&gt;Use Pure Components, and make sure you use primitives for your props so that it can re-render efficiently.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary, TLDR
&lt;/h2&gt;

&lt;p&gt;Removing expensive computations from your list components, simplifying your list components, and using Pure Components went a long way on improving performance in my React Native apps. It seriously felt like night and day differences in terms of performance and renewed my love for React Native.&lt;/p&gt;

&lt;p&gt;I’ve always been a native-first type of mobile dev (coding in Objective C, Swift, or Java). I love creating fluid experiences with cool animations, and because of this, I’ve always been extra critical/cautious of cross-platform mobile solutions. But React Native has been the only one that has been able to change my mind and has me questioning why I would ever want to code in Swift or Java again.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>performance</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
