<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tayyba Adien on Medium]]></title>
        <description><![CDATA[Stories by Tayyba Adien on Medium]]></description>
        <link>https://medium.com/@tayyba-adien?source=rss-9aaf486d0d83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l6xcZvXYpMfF4ZQaOUnPFQ.png</url>
            <title>Stories by Tayyba Adien on Medium</title>
            <link>https://medium.com/@tayyba-adien?source=rss-9aaf486d0d83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:44:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tayyba-adien/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Flutter Flavors: Serving the Right Scoop to the Right Environment]]></title>
            <link>https://tayyba-adien.medium.com/flutter-flavors-serving-the-right-scoop-to-the-right-environment-74625cd6ca57?source=rss-9aaf486d0d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/74625cd6ca57</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Tayyba Adien]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 09:50:35 GMT</pubDate>
            <atom:updated>2026-04-02T09:50:35.019Z</atom:updated>
            <content:encoded><![CDATA[<h4>In production-grade app development, “it works on my machine” isn’t the benchmark — <strong>environment integrity</strong> is. If you aren’t using Flavors, you aren’t just making it harder for yourself; you’re risking your production data. Stop testing in production. Implement Type-Safe Flutter Flavors and Firebase Isolation.</h4><h3>Problem: The “Melted Data” Mess</h3><p>Relying on a single Firebase instance for both testing and production is a recipe for disaster. Without Flavors, your Firebase Analytics becomes a “melted mess” of data where developer test events (like clicking a button 50 times to test a bug) mix with real user insights.</p><p><strong>By implementing Flavors, we achieve:</strong></p><ul><li><strong>Data Integrity:</strong> Analytics and crash reports are strictly isolated. Your production graphs remain clean and actionable.</li><li><strong>Visual Clarity:</strong> Distinct app icons and names allow QA teams and developers to know <em>exactly</em> which environment they are testing at a glance.</li><li><strong>Safety:</strong> You’ll never accidentally wipe a production database while running a local integration test.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*w0xSbgWO_K-bqpV7.jpeg" /></figure><h3>Step 1: Define the Flavorizr Configuration</h3><p>Ensure you have the flutter_flavorizr package added to your dev_dependencies.</p><p>Create a flavorizr.yaml in your root directory. This acts as the &quot;Source of Truth&quot; for your environment hierarchy.</p><pre>flavorizr:<br>  app:<br>    android:<br>      flavorDimensions: &quot;flavor&quot;<br>    ios: {}<br>flavors:<br>  dev:<br>    app:<br>      name: &#39;App Dev&#39;<br>    android:<br>      applicationId: &#39;com.example.app_stater_template.dev&#39;<br>      firebase:<br>        config: &#39;lib/core/database/firebase/options/firebase_options_dev.dart&#39;<br>      icons:<br>        image: &#39;assets/icons/app_icon_dev.png&#39;<br>    ios:<br>      bundleId: &#39;com.example.appStaterTemplate.dev&#39;<br>      firebase:<br>        config: &#39;lib/core/database/firebase/options/firebase_options_dev.dart&#39;<br>      icons:<br>        image: &#39;assets/icons/app_icon_dev.png&#39;<br>  staging:<br>    app:<br>      name: &#39;App Staging&#39;<br>    android:<br>      applicationId: &#39;com.example.app_stater_template.staging&#39;<br>      firebase:<br>        config: &#39;lib/core/database/firebase/options/firebase_options_stg.dart&#39;<br>      icons:<br>        image: &#39;assets/icons/app_icon_staging.png&#39;<br>    ios:<br>      bundleId: &#39;com.example.appStaterTemplate.staging&#39;<br>      firebase:<br>        config: &#39;lib/core/database/firebase/options/firebase_options_stg.dart&#39;<br>      icons:<br>        image: &#39;assets/icons/app_icon_staging.png&#39;<br>  prod:<br>    app:<br>      name: &#39;App&#39;<br>    android:<br>      applicationId: &#39;com.example.app_stater_template&#39;<br>      firebase:<br>        config: &#39;lib/core/database/firebase/options/firebase_options_prod.dart&#39;<br>      icons:<br>        image: &#39;assets/icons/app_icon_prod.png&#39;<br>    ios:<br>      bundleId: &#39;com.example.appStaterTemplate&#39;<br>      firebase:<br>        config: &#39;lib/core/database/firebase/options/firebase_options_prod.dart&#39;<br>      icons:<br>        image: &#39;assets/icons/app_icon_prod.png&#39;</pre><h3>Step 2: Organize Your Assets</h3><p>Visual cues are vital. Ensure your assets/icons/ folder follows the hierarchy defined above. Use <a href="https://icon.kitchen/">Icon Kitchen</a> to generate these quickly!</p><p>🟢 <strong>Dev Icon:</strong> app_icon_dev.png</p><p>🟡 <strong>Staging Icon:</strong> app_icon_staging.png</p><p>🔵 <strong>Production Icon:</strong> app_icon_prod.png</p><h3>Step 3: Architecture — The Flavor Helper Class</h3><p>We use a sealed class and extensions to provide a type-safe way to check the current environment throughout the app.</p><pre>sealed class F {<br>  F._();<br><br>static const String _raw = String.fromEnvironment(&#39;FLAVOR&#39;, defaultValue: &#39;dev&#39;);<br>static Flavor get appFlavor =&gt; Flavor.values.firstWhere(<br>        (f) =&gt; f.name == _raw,<br>        orElse: () =&gt; Flavor.dev,<br>      );<br><br>  static String get name =&gt; appFlavor.name;<br>  static String get title {<br>    return switch (appFlavor) {<br>      Flavor.dev =&gt; &#39;App Dev&#39;,<br>      Flavor.staging =&gt; &#39;App Staging&#39;,<br>      Flavor.prod =&gt; &#39;App&#39;,<br>    };<br>  }<br>}</pre><h3>Step 4: Environment-Specific Entry Points</h3><p>To ensure total separation, we create three distinct main files.</p><pre>//main_prod.dart<br><br>Future&lt;void&gt; main() async {<br>  WidgetsFlutterBinding.ensureInitialized();<br>  await FirebaseInitialization.init(Flavor.prod);<br>  runApp(const MainApp());<br>}</pre><p>(Repeat logic for main_staging.dart and main_dev.dart)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*2HX0Qwf768x3dJ0a.png" /></figure><h3>Step 5: Android &amp; iOS Configuration</h3><p>When you run Flavorizr, it automates the creation of Android Product Flavors and iOS Schemes.</p><ul><li><strong>iOS:</strong> Note that for iOS, you will need to manually add/verify the schemes within Xcode to ensure they point to the correct build configurations.</li></ul><p>Press enter or click to view the image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wYAz49loQa9ZqPl-.gif" /></figure><ul><li><strong>Android Folder Hierarchy:</strong> Notice how the tool creates specific folders under android/app/src/ for each flavor (dev, staging, prod). This allows the OS to pick the correct logo automatically based on the applicationId.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*zLcMPYMLkpJgs-d2.png" /></figure><h3>Step 6: Initializing Firebase by Flavor</h3><p>The magic happens in our FirebaseInitialization class. Instead of hardcoding which configuration to use, we pass the current Flavor as a parameter. This ensures that when the app starts, it connects to the <strong>Dev Project</strong> for developers and the <strong>Prod Project</strong> for real users.</p><pre>class FirebaseInitialization {<br>  static Future&lt;void&gt; init(Flavor flavor) async {<br>    if (Firebase.apps.isNotEmpty) return;<br><br>final firebaseOptions = switch (flavor) {<br>      Flavor.dev =&gt; DefaultFirebaseOptionsDev.currentPlatform,<br>      Flavor.staging =&gt; DefaultFirebaseOptionsStg.currentPlatform,<br>      Flavor.prod =&gt; DefaultFirebaseOptionsProd.currentPlatform,<br>    };<br>    await Firebase.initializeApp(options: firebaseOptions);<br>  }<br>}</pre><p><strong>Note:</strong> Notice that each file (firebase_options_dev.dart, etc.) contains a class named differently (e.g., DefaultFirebaseOptionsDev). When you generate these using the FlutterFire CLI, make sure to rename the class inside the file so they don&#39;t conflict with each other!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*B8_wUzvw3PXmVQ8y.png" /></figure><h3>Conclusion</h3><p>Flavors aren’t just a <strong>“nice to have”;</strong> they are a fundamental requirement for apps that aim to scale. Scalability demands more than just features; it demands <strong>environmental integrity</strong>. Through Flavors, we’ve eliminated the ‘confusing mess’ of the past, delivering a robust pipeline where QA and Production finally function as they should.</p><p><strong>Stay Flavorful!</strong> 🍦✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74625cd6ca57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Write code OneTime But read it 10 Times: Naming Variables]]></title>
            <link>https://tayyba-adien.medium.com/we-write-code-onetime-but-read-it-10-times-naming-variables-bc5bb29ca761?source=rss-9aaf486d0d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc5bb29ca761</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[variables]]></category>
            <category><![CDATA[naming-variable]]></category>
            <dc:creator><![CDATA[Tayyba Adien]]></dc:creator>
            <pubDate>Sun, 31 Dec 2023 19:07:11 GMT</pubDate>
            <atom:updated>2023-12-31T19:16:49.648Z</atom:updated>
            <content:encoded><![CDATA[<h3>We Write code Once But read it 10 Times: Naming Variables</h3><p>Names are everywhere in software. We name our variables, our functions, our arguments, classes, and packages. We name our source files and the directories that contain them. We name our jar files ,war files and ear files. We name and name and name. Because we do<strong> </strong>so much of it, we’d better do it well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UzyazXAk_W5uzmzYW0kXnw.jpeg" /><figcaption>“Be conscious while naming variables, as you are conscious while naming your child.”</figcaption></figure><p>Code efficiency depends upon the code algorithm It is true but making good logic without naming variables, class names, and function names properly, then it will become hard for you to maintain code in the future.</p><blockquote>According to Alex Dix book HCI chapter 1 “The Human”</blockquote><blockquote>Your brain keeps new info in its short-term memory for 7 sec and if you forget to recall it it will discard that info .</blockquote><p>and then it will become harder for you to remember what exactly that variable means.</p><p>so naming variables is as important as writing code with good logic.</p><p>Here are some cool Practical tips by <strong>Uncle Bob</strong> for conscious naming to enhance code readability.</p><ul><li>Use Intention-Revealing Names</li><li>Avoid Disinformation</li><li>Make Meaningful Distinctions</li><li>Use Pronounceable Names</li><li>Use Searchable Names</li><li>Avoid Encodings</li><li>Member Prefixes</li><li>Avoid Mental Mapping</li></ul><h3>Use Intention-Revealing Names:</h3><blockquote><strong><em>Choosing good names takes time but saves more than it takes.</em></strong></blockquote><p>It is easy to say that names should reveal intent. So take care with your names and change them when you find better ones. Everyone who reads your code (including you) will be happier if you do.</p><p>The name of a variable, function, or class, should answer all the big questions. <strong><em>It should tell you why it exists, what it does, and how it is used.</em></strong> If a name requires a comment, then the name does not reveal its intent.</p><pre>int d; // elapsed time in days</pre><p>The name <em>d</em> reveals nothing. It does not evoke a sense of elapsed time nor of days.</p><p>Instead, name it like,</p><pre>int elapsedTimeInDays;<br>int daysSinceCreation; <br>int daysSinceModification; <br>int fileAgeInDays;</pre><h3><strong>Avoid Disinformation :</strong></h3><blockquote>Programmers must avoid leaving false clues that obscure the meaning of code.</blockquote><p>That&#39;s what I&#39;m talking about.</p><h4>1. Use a list when it is stored in a list.</h4><p>Do not refer to a grouping of accounts as an <strong><em>accountList</em> </strong>unless it’s a <strong><em>List</em>.</strong> The word list means something specific to programmers. If the container holding the accounts is not a List, it may lead to false conclusions.</p><p>So <strong><em>accountGroup</em></strong> or <strong><em>bunchOfAccounts</em></strong> or just plain accounts would be better.</p><h4>2. Similar shapes.</h4><p>Beware of using names that vary in small ways.</p><pre>//How long does it take to spot the subtle difference between<br>int XYZControllerForEfficientHandlingOfStrings; <br>int XYZControllerForEfficientStorageOfStrings;</pre><h4>3. Spelling similar concepts similarly is <em>information</em>.</h4><h4>4. Using inconsistent spellings is <em>dis-information.</em></h4><h4>5. Use of lowercase</h4><p>A truly awful example of disinformative names would be the use of lower-case L or uppercase O as variable names, especially in combination. The problem, of course, is that they look almost entirely like the constants one and zero, respectively.</p><pre>int a = l;<br>    if ( O == l )<br>        a=O1; <br>    else<br>        l=01;</pre><h3><strong>Make Meaningful Distinctions</strong></h3><blockquote>If names must be different, then they should also mean something different.</blockquote><p>Programmers create problems for themselves when they write code solely to satisfy a compiler or interpreter.</p><p>Number-series naming (a1, a2, .. aN) is the opposite of intentional naming. Such names are not disinformative — they are noninformative; they provide no clue to the author’s intention.</p><pre>public static void copyChars(char a1[], char a2[]) {<br>        for (int i = 0; i &lt; a1.length; i++) {<br>            a2[i] = a1[i];<br>        }<br>    }</pre><p>This function reads much better when source and destination are used for the argument names.</p><ul><li>Noise words are another meaningless distinction. Imagine that you have a <em>Product class.</em> If you have another called <em>ProductInfo</em> or <em>ProductData</em>, <em>Info </em>and <em>Data</em> are indistinct noise words like<em> a, an,</em> and <em>the</em>.</li><li>Noise words are redundant. The word variable should never appear in a variable name. The word <em>table</em> should never appear in a <em>table name</em>.</li></ul><h3><strong>Use Pronounceable Names</strong></h3><blockquote><em>If you can’t pronounce it, you can’t discuss it without sounding like an idiot.</em></blockquote><p>A company I know has genymdhms (generation date, year, month, day, hour, minute, and second).</p><p>we were tolerating poor naming. New developers had to have the variables explained to them, and then they spoke about it in silly made-up words instead of using proper English terms.</p><p>Compare this</p><pre>class DtaRcrd102 {<br><br>    private Date genymdhms;<br>    private Date modymdhms;<br>    private final String pszqint = &quot;102&quot;;<br>}</pre><p>to</p><pre>class Customer {<br><br>    private Date generationTimestamp;<br>    private Date modificationTimestamp;<br>    private final String recordId = &quot;102&quot;;<br>}</pre><h3><strong>Use Searchable Names</strong></h3><p>Single-letter names and numeric constants have a particular problem in that they are not easy to locate across a body of text.</p><h3><strong>Avoid Encodings</strong></h3><blockquote>It is an unnecessary mental burden when trying to solve a problem.</blockquote><p>Encoding type or scope information into names simply adds an extra burden of deciphering. It hardly seems reasonable to require each new employee to learn yet another encoding</p><h3><strong>Member Prefixes</strong></h3><p>You also don’t need to prefix member variables with <em>m_ </em>anymore. Your classes and functions should be small enough that you don’t need them.</p><pre>public class Part {<br>    private String m_dsc; <br>} <br><br>//instead <br><br>public class Part {<br>    String description;<br>    void setDescription(String description) {<br>    this.description = description; <br>    }<br>}</pre><h3><strong>Avoid Mental Mapping</strong></h3><p>Readers shouldn’t have to mentally translate your names into other names they already know.</p><blockquote>Reference Clean Code by Robert C martin</blockquote><p>Yet, the true efficiency of your code is unlocked not only through elegant algorithms but also through the clarity bestowed by thoughtful and intentional naming.</p><p>Coding is not just about solving problems; it’s about telling a story to both the machine and the humans who follow in your footsteps.</p><p><em>Happy coding, and may your variable names be ever expressive, your functions purposeful, and your classes tell a story of logic and intention.</em></p><p>Tayyba Adien</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc5bb29ca761" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Carnival: Total Cost of Owning a Mess.]]></title>
            <link>https://tayyba-adien.medium.com/code-carnival-total-cost-of-owning-a-mess-4fbcdf01d3b3?source=rss-9aaf486d0d83------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fbcdf01d3b3</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[deadlines]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Tayyba Adien]]></dc:creator>
            <pubDate>Thu, 28 Dec 2023 10:46:23 GMT</pubDate>
            <atom:updated>2023-12-28T16:02:40.157Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Embark on the Code Carnival journey, where the dance between chaos and deadlines unfolds.</em></blockquote><p>All developers with more than a few years of experience know that previous messes slow them down. And yet all developers feel the pressure to make messes to meet deadlines. <em>In short, they don’t take the time to go fast!</em></p><p>True professionals know that the second part of the conundrum is wrong. You will not make the deadline by making the mess. Indeed, the mess will slow you down instantly and will force you to miss the deadline. The only way to make the deadline — the only way to go fast — is to keep the code as clean as possible at all times.</p><blockquote>But true professionals know the secret — messes won’t meet deadlines.</blockquote><p>If you’ve been coding for a few years, chances are you’ve grappled with the headache-inducing challenge of messy code. It’s like stepping into a Tangled web where every attempt to move forward slows you down, and what once felt like a fast-paced project now inches along at a snail’s pace.</p><p>In the coding world, this messiness isn’t just a minor inconvenience; it’s a game-changer. Imagine every change you make to the code breaking two or three other parts. It’s a constant battle where even the smallest tweak demands unraveling a web of tangles, twists, and knots. And guess what? Over time, this mess becomes so massive and tangled that cleaning it up feels impossible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMWDnM1JnXuMGLct2vOKFw.png" /></figure><p>As the mess grows, the productivity of the team starts plummeting. It’s a steep decline, and the more it drops, the more desperate management becomes. Their solution? Bring in more people to the project. Sounds logical, right? But here’s the catch: these recruits don’t get the design of the system. They don’t know the difference between a change that fits the design and one that messes it up. So, instead of saving the day, they unknowingly add to the chaos, dragging productivity even further down.</p><p>but wait do you know Why it happens? 🤔</p><h3>Unraveling the Web of Messy Code: Understanding the Culprits.</h3><p>In the world of coding, the struggle against messy code is real. Let’s deep down at why it happens and explore the common pitfalls that lead us into tangled logic and confusing structures.</p><h4><strong>Repetitive Variables:</strong></h4><p>Creating separate variables for similar tasks can clutter your code. Having variables like x1, x2, x3, and x4 when one variable could suffice.</p><h4>Redundant Functions || Encapsulating Multiple logics in a Single Function :</h4><p>Assigning multiple responsibilities to a function can lead to confusion. <em>Picture this: initializing an object, assigning its values, and then performing operations on it — all within the same function.</em>This conflation of concerns not only blurs the function’s purpose but also introduces a level of complexity that can hinder code readability and maintenance. It’s essential to adhere to the principle of single responsibility, ensuring each function has a clear and distinct purpose in the codebase. Functions like getData() and process() lack clear purposes.</p><h4>Task Steps Without Classes:</h4><p>Avoiding the creation of classes for sequential tasks may result in repetitive code. <em>Create a utility class that uses extension functions within it for versatility across different contexts, like various Activities.</em> Repeatedly using code in an activity instead of encapsulating it into a class.</p><h4>UI-Backend Mixing:</h4><p>Merging UI code with backend logic can blur the lines between concerns. I have seen in product-based apps that UI logic is too tangled in backend logic in a single activity. Performing backend logic directly within an Android Activity or Fragment.</p><h4>No Singleton Objects:</h4><p>Neglecting the use of singleton objects for dependency injection can lead to messy code. It&#39;s something like passing reference rather than passing and creating a value in a memory location. Failing to create a singleton for a globally used component.</p><h4>Excessive use of Preferences variables:</h4><p>Creating too many SharedPreferences variables can clutter the codebase. Unnecessary proliferation of SharedPreferences for different settings.</p><h4>Forgotten Test Code Snippets :</h4><p>Forgetting to remove test logs after completing a module can leave the clutter behind. Writing code snippets for testing purposes and omitting their removal post-module completion.</p><h4>Incorrect Logging Tags:</h4><p>Tagging logs improperly can lead to confusion during debugging.</p><pre>Log.d(&quot;jdhfhhudfh&quot;, &quot;Your debug message here&quot;)<br><br>Using inconsistent or inaccurate tags in log statements.<br></pre><h4>Unnecessary Dependencies:</h4><p>Including dependencies that aren’t essential for the project can bloat the code. More dependencies mean more dex classes that will increase app size and ultimately your app gets heavier. Incorporating libraries that aren’t crucial to the application’s functionality.</p><h4>Disorganized File Structure:</h4><p>A lack of an organized folder and file structure can make code hard to navigate. Scattered and unstructured code files within a project.</p><h4>Module Embedding from GitHub:</h4><p>Embedding entire files for a single feature may lead to code duplication.<br>Copy-pasting entire code files from external sources for a specific functionality.</p><blockquote>Remember that writing code is a skill that improves with practice. Don’t be afraid to experiment with different styles and approaches to find what works best.</blockquote><blockquote>An Interesting blend of my experience with the knowledge gained .</blockquote><blockquote><em>From </em><a href="https://www.goodreads.com/book/show/3735293-clean-code"><em>Clean Code</em></a><em> a book for </em><a href="http://www.goodreads.com/author/show/45372.Robert_C_Martin"><em>Robert C. Martin</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fbcdf01d3b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>