<?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: Amit chakraborty</title>
    <description>The latest articles on DEV Community by Amit chakraborty (@techamit95ch).</description>
    <link>https://dev.to/techamit95ch</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F362727%2F44e6ad7c-ce73-4784-a4e6-965148cf26ee.jpg</url>
      <title>DEV Community: Amit chakraborty</title>
      <link>https://dev.to/techamit95ch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/techamit95ch"/>
    <language>en</language>
    <item>
      <title>SQLite on Device: The Hidden Dangers of Production</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Sun, 22 Nov 2026 05:45:05 +0000</pubDate>
      <link>https://dev.to/techamit95ch/sqlite-on-device-the-hidden-dangers-of-production-54mi</link>
      <guid>https://dev.to/techamit95ch/sqlite-on-device-the-hidden-dangers-of-production-54mi</guid>
      <description>&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;Imagine you're a mobile app developer, and your latest release relies on SQLite for local data storage. The app works flawlessly during testing, but once it hits the production environment, users start reporting intermittent crashes and data corruption issues. Your team is stumped, and the pressure is on to identify and fix the problem. The symptom is a cryptic error message: "database is locked." The cost is a growing number of frustrated users, a rising crash rate, and a looming deadline to resolve the issue before it affects the app's reputation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it Happens
&lt;/h2&gt;

&lt;p&gt;SQLite is a file-based database, and its locking mechanism can lead to issues under concurrent access. When multiple threads or processes try to write to the database simultaneously, SQLite may lock the database file to prevent data corruption. However, if the lock is not released properly, it can lead to a "database is locked" error. This issue is more likely to occur in production, where the app faces real-world traffic and usage patterns. Other failure modes, such as database corruption due to improper journaling or inadequate disk space, can also arise.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix, Step by Step
&lt;/h2&gt;

&lt;p&gt;To detect and resolve these issues, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Implement proper locking mechanisms&lt;/strong&gt;: Ensure that your app uses SQLite's locking mechanism correctly. Use &lt;code&gt;BEGIN TRANSACTION&lt;/code&gt; and &lt;code&gt;COMMIT&lt;/code&gt; statements to wrap database operations, and consider using &lt;code&gt;WAL&lt;/code&gt; (Write-Ahead Logging) journaling mode to reduce lock contention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor database performance&lt;/strong&gt;: Use tools like SQLite's built-in &lt;code&gt;sqlite3&lt;/code&gt; command-line tool or third-party libraries to monitor database performance and detect potential issues. Look for signs of lock contention, such as increased wait times or transaction rollbacks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test under load&lt;/strong&gt;: Simulate real-world traffic and usage patterns to identify potential issues before they reach production. Use tools like Apache JMeter or Gatling to generate load and test your app's database performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify database integrity&lt;/strong&gt;: Regularly run &lt;code&gt;PRAGMA integrity_check&lt;/code&gt; to detect database corruption and take corrective action if necessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize database configuration&lt;/strong&gt;: Adjust SQLite's configuration options, such as &lt;code&gt;cache_size&lt;/code&gt; and &lt;code&gt;journal_mode&lt;/code&gt;, to optimize performance and reduce the likelihood of issues.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What it Costs, and When Not to Do It
&lt;/h2&gt;

&lt;p&gt;While SQLite is a popular choice for local data storage, it may not be the best option for very large datasets or high-traffic applications. The cost of using SQLite can include increased development time to handle concurrency and locking issues, as well as potential performance degradation under heavy load. If your app requires more advanced features, such as data replication or high availability, consider alternative databases like Realm or Core Data. However, for many use cases, SQLite remains a reliable and efficient choice, especially when properly configured and monitored.&lt;/p&gt;

&lt;h2&gt;
  
  
  At Your Level
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Starting out: Focus on understanding SQLite's locking mechanism and implementing proper transaction handling in your app. Experiment with different journaling modes and configuration options to optimize performance.&lt;/li&gt;
&lt;li&gt;Working engineer: Investigate tools and libraries for monitoring database performance and detecting potential issues. Develop a strategy for testing your app under load and simulating real-world usage patterns.&lt;/li&gt;
&lt;li&gt;Senior or staff: Consider the trade-offs between SQLite and alternative databases, and evaluate the scalability and performance implications of your choice. Develop a comprehensive plan for database maintenance and optimization.&lt;/li&gt;
&lt;li&gt;Lead or director: Assess the business implications of database-related issues and prioritize investment in database infrastructure and expertise. Develop a roadmap for database evolution and migration to ensure the app's long-term scalability and reliability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the Interview
&lt;/h2&gt;

&lt;p&gt;When discussing SQLite and database performance in an interview, be prepared to answer questions like: "What are some common failure modes of SQLite in production, and how would you detect them?" A weak answer might focus on general database concepts or theoretical knowledge, while a strong answer would highlight specific failure modes, such as lock contention or database corruption, and describe practical strategies for detection and mitigation. A senior candidate might be expected to discuss the trade-offs between different database options and the implications of their choice for the app's scalability and performance. A follow-up question might ask the candidate to design a test plan for evaluating database performance under load, or to explain how they would optimize database configuration for a specific use case.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Amit Chakraborty is a founding engineer and senior architect — React Native, AI/RAG systems and production architecture. Portfolio: &lt;a href="https://www.amitchakraborty.dev?utm_source=article&amp;amp;utm_medium=content&amp;amp;utm_campaign=sqlite-on-device-what-actually-breaks-in-production" rel="noopener noreferrer"&gt;www.amitchakraborty.dev&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Open to senior and founding engineering roles, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>performance</category>
      <category>sqlite</category>
    </item>
    <item>
      <title>JavaScript from absolute zero · 2. Values, variables and types</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Sat, 21 Nov 2026 14:45:08 +0000</pubDate>
      <link>https://dev.to/techamit95ch/javascript-from-absolute-zero-2-values-variables-and-types-168d</link>
      <guid>https://dev.to/techamit95ch/javascript-from-absolute-zero-2-values-variables-and-types-168d</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;JavaScript from absolute zero&lt;/strong&gt; · Chapter 2 of 14 · Languages · new chapter every Tuesday morning&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Hold the entire value model of the language in your head.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Emma is a marketing assistant who has just been asked to test a tiny piece of JavaScript that a colleague promised would “show the current date on any computer”. She opens the shared folder, double‑clicks the file &lt;code&gt;show-date.js&lt;/code&gt;, and a blank window flashes before disappearing. The file contains the single line&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="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Emma is confused because she expected to see the current date displayed on her screen, but instead, the window disappeared immediately. She doesn't understand what &lt;code&gt;console.log&lt;/code&gt; means or why the window closed so quickly. She also wonders what &lt;code&gt;new Date()&lt;/code&gt; does and why it's not showing her the date.&lt;/p&gt;

&lt;p&gt;Emma's problem is that she doesn't understand the basics of JavaScript values, variables, and types. She needs to learn what these concepts mean and how they work together to produce the desired output. In this chapter, we will explore these fundamental concepts and help Emma understand how to write and run JavaScript code effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you need to have Node.js installed on your machine, and you should have completed the previous chapter, "What a program is, and running your first line today". You should also have a basic understanding of how to use a terminal or command prompt. If you're not sure how to use a terminal, don't worry – we'll cover the basics as we go along.&lt;/p&gt;

&lt;p&gt;To verify that you have Node.js installed, open a terminal and type the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should display the version of Node.js installed on your machine. If you don't see a version number, you'll need to install Node.js before proceeding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding values
&lt;/h2&gt;

&lt;p&gt;In JavaScript, a value is a piece of information that can be stored and used in a program. Values can be numbers, words, dates, or even more complex things like objects and arrays. In Emma's code, &lt;code&gt;new Date()&lt;/code&gt; is an example of a value – it's a way of getting the current date and time.&lt;/p&gt;

&lt;p&gt;Let's try creating some simple values in JavaScript. Open a terminal and type the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will open the Node.js REPL (Read-Evaluate-Print Loop), where you can type JavaScript code and see the results immediately. Try typing the following:&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="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the number 5, the word "hello", and the current date and time printed to the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Variables and assignment
&lt;/h2&gt;

&lt;p&gt;In JavaScript, a variable is a name given to a value. Variables allow you to store and reuse values in your program. To create a variable, you use the &lt;code&gt;let&lt;/code&gt; keyword followed by the name of the variable and the value you want to assign to it.&lt;/p&gt;

&lt;p&gt;Try typing the following in the Node.js REPL:&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;let&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Emma"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the word "Emma" printed to the console. You can also assign a new value to an existing variable using the assignment operator (&lt;code&gt;=&lt;/code&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="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the word "John" printed to the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types
&lt;/h2&gt;

&lt;p&gt;In JavaScript, every value has a type. The type of a value determines what kind of operations you can perform on it. For example, you can add numbers together, but you can't add a number and a word.&lt;/p&gt;

&lt;p&gt;Try typing the following in the Node.js REPL:&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="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hello"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;" world"&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;You should see the result of the addition (&lt;code&gt;8&lt;/code&gt;) and the concatenated string (&lt;code&gt;"hello world"&lt;/code&gt;) printed to the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;Now that we've covered the basics of values, variables, and types, let's build a simple program that demonstrates these concepts. Create a new file called &lt;code&gt;greeting.js&lt;/code&gt; and add the following code:&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;let&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Emma"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Hello, "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&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;Save the file and run it using Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node greeting.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the message "Hello, Emma!" printed to the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;Here are a few common errors you might encounter when working with values, variables, and types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Undefined variable&lt;/strong&gt;: If you try to use a variable that hasn't been declared, you'll get a ReferenceError. For example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;name&lt;/code&gt; hasn't been declared, you'll see an error message like "ReferenceError: name is not defined".&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type mismatch&lt;/strong&gt;: If you try to perform an operation on a value that's not the right type, you'll get a TypeError. For example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hello"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&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 will work, but if you try to add a number to a non-numeric value, you'll get a NaN (Not a Number) result.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Assignment error&lt;/strong&gt;: If you try to assign a value to a variable that's not a valid assignment, you'll get a SyntaxError. For example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&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 will give you a SyntaxError because you can't assign a value to a variable without specifying the value.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Using variables and types in JavaScript has some trade-offs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Memory usage&lt;/strong&gt;: Variables take up memory, so if you have a lot of variables, your program might use more memory than it needs to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Some operations, like type checking, can slow down your program.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readability&lt;/strong&gt;: Using variables and types can make your code more readable, but it can also make it more complex if you're not careful.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;In an interview, you might be asked questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What's the difference between a value and a variable in JavaScript?"&lt;/li&gt;
&lt;li&gt;"How do you declare a variable in JavaScript?"&lt;/li&gt;
&lt;li&gt;"What's the type of the value &lt;code&gt;5&lt;/code&gt; in JavaScript?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A weak answer might be: "Um, I think a value is like a thing, and a variable is like a name for the thing...?"&lt;/p&gt;

&lt;p&gt;A stronger answer would be: "In JavaScript, a value is a piece of information that can be stored and used in a program, like a number or a string. A variable is a name given to a value, so you can store and reuse it. To declare a variable, you use the &lt;code&gt;let&lt;/code&gt; keyword followed by the name of the variable and the value you want to assign to it. The type of the value &lt;code&gt;5&lt;/code&gt; is a number, which is a primitive type in JavaScript."&lt;/p&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new file called &lt;code&gt;calculator.js&lt;/code&gt; and add a variable &lt;code&gt;x&lt;/code&gt; with the value &lt;code&gt;5&lt;/code&gt;. Then, add a variable &lt;code&gt;y&lt;/code&gt; with the value &lt;code&gt;3&lt;/code&gt;. Finally, log the result of &lt;code&gt;x + y&lt;/code&gt; to the console.&lt;/li&gt;
&lt;li&gt;Create a new file called &lt;code&gt;greeting.js&lt;/code&gt; and add a variable &lt;code&gt;name&lt;/code&gt; with the value &lt;code&gt;"John"&lt;/code&gt;. Then, log a greeting message to the console using the &lt;code&gt;name&lt;/code&gt; variable.&lt;/li&gt;
&lt;li&gt;Create a new file called &lt;code&gt;type-check.js&lt;/code&gt; and add a variable &lt;code&gt;x&lt;/code&gt; with the value &lt;code&gt;5&lt;/code&gt;. Then, try to add a string to &lt;code&gt;x&lt;/code&gt; and log the result to the console. What happens?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember to run each file using Node.js and verify the output. If you get stuck, don't hesitate to ask for help!&lt;/p&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/javascript-from-zero#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript from absolute zero
&lt;/h2&gt;

&lt;p&gt;Chapter 2 of 14. New chapter every Tuesday morning.&lt;br&gt;
Next: &lt;strong&gt;Making decisions: conditions and the traps&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/javascript-from-zero" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=javascript-from-zero" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>languages</category>
      <category>javascriptfromabsolutezero</category>
      <category>understandingvalues</category>
    </item>
    <item>
      <title>Migrating to Mobile Accessibility without a Freeze Window</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Sat, 21 Nov 2026 05:45:34 +0000</pubDate>
      <link>https://dev.to/techamit95ch/migrating-to-mobile-accessibility-without-a-freeze-window-920</link>
      <guid>https://dev.to/techamit95ch/migrating-to-mobile-accessibility-without-a-freeze-window-920</guid>
      <description>&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;Say you are a mobile app developer tasked with improving the accessibility of your React Native application. You have been using an older approach to accessibility, but you know it's time to migrate to a more modern and robust solution. However, you cannot afford to introduce a freeze window, where development and releases are put on hold while the migration is taking place. Your team is still receiving feature requests and bug fixes, and you need to ensure that the migration does not disrupt the normal functioning of your app.&lt;/p&gt;

&lt;p&gt;You start by trying to integrate the new accessibility features into your existing codebase, but you quickly realize that it's not as straightforward as you thought. The new features require significant changes to your app's architecture, and you're not sure how to make the transition without introducing bugs or breaking existing functionality. You've already spent several days trying to make it work, but you're still experiencing issues with screen reader support, high contrast mode, and other accessibility features.&lt;/p&gt;

&lt;p&gt;The cost of not migrating to the new accessibility features is clear: your app will not be usable by users with disabilities, and you may even be subject to legal penalties. But the cost of introducing a freeze window is also high: your team will not be able to deliver new features or bug fixes, and your app will fall behind the competition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it Happens
&lt;/h2&gt;

&lt;p&gt;The old approach to accessibility in React Native relied on a set of third-party libraries and workarounds to provide basic accessibility features. However, these libraries are no longer maintained, and the workarounds are not compatible with the latest versions of React Native. The new approach to accessibility in React Native uses a built-in set of APIs and tools to provide robust accessibility features, but it requires significant changes to the app's architecture.&lt;/p&gt;

&lt;p&gt;One of the main reasons why migrating to the new accessibility features is challenging is that it requires a deep understanding of the app's architecture and how it interacts with the accessibility APIs. Additionally, the new features require significant testing and validation to ensure that they are working correctly, which can be time-consuming and resource-intensive.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix, Step by Step
&lt;/h2&gt;

&lt;p&gt;To migrate to the new accessibility features without introducing a freeze window, you can follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a separate branch for the migration&lt;/strong&gt;: Create a new branch in your version control system to isolate the migration work from the rest of the codebase. This will allow you to work on the migration without affecting the main branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update the app's architecture&lt;/strong&gt;: Update the app's architecture to use the new accessibility APIs and tools. This may involve significant changes to the app's codebase, including updating components, screens, and navigation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement accessibility features incrementally&lt;/strong&gt;: Implement the accessibility features incrementally, starting with the most critical ones. For example, you may start by implementing screen reader support, followed by high contrast mode, and then other features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test and validate each feature&lt;/strong&gt;: Test and validate each accessibility feature as you implement it, to ensure that it is working correctly and not introducing bugs or breaking existing functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge the migration branch into the main branch&lt;/strong&gt;: Once you have completed the migration, merge the migration branch into the main branch, and release the updated app to production.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What it Costs, and When Not to Do It
&lt;/h2&gt;

&lt;p&gt;The cost of migrating to the new accessibility features without a freeze window is significant, as it requires a deep understanding of the app's architecture and the accessibility APIs, as well as significant testing and validation. However, the cost of not migrating is also high, as it may result in legal penalties and a loss of users with disabilities.&lt;/p&gt;

&lt;p&gt;You should not attempt to migrate to the new accessibility features without a freeze window if you have a very large and complex codebase, or if you have a very short deadline to complete the migration. In these cases, it may be better to introduce a freeze window to ensure that the migration is done correctly and without introducing bugs or breaking existing functionality.&lt;/p&gt;

&lt;h2&gt;
  
  
  At Your Level
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Starting out&lt;/strong&gt;: If you're new to mobile app development, focus on learning the basics of accessibility and how to implement it in your app. Start by reading the official React Native documentation on accessibility and experimenting with the built-in accessibility APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Working engineer&lt;/strong&gt;: If you're an experienced mobile app developer, focus on understanding the new accessibility features and how to implement them in your app. Start by reviewing the app's architecture and identifying areas where the new accessibility features can be implemented.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Senior or staff&lt;/strong&gt;: If you're a senior or staff engineer, focus on leading the migration effort and ensuring that it is done correctly and without introducing bugs or breaking existing functionality. Start by creating a plan for the migration and assigning tasks to team members.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lead or director&lt;/strong&gt;: If you're a lead or director, focus on prioritizing the migration and allocating resources to ensure its success. Start by reviewing the business case for the migration and identifying the resources needed to complete it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the Interview
&lt;/h2&gt;

&lt;p&gt;When interviewing for a mobile app development position, you may be asked about your experience with accessibility and how you would migrate an app to the new accessibility features. A weak answer might be: "I would just update the app to use the new accessibility APIs and tools." A strong answer would be: "I would start by reviewing the app's architecture and identifying areas where the new accessibility features can be implemented. I would then create a plan for the migration, including testing and validation, and assign tasks to team members. I would also ensure that the migration is done incrementally, without introducing a freeze window, to minimize the impact on the app's functionality and user experience." &lt;/p&gt;

&lt;p&gt;The follow-up question might be: "How would you handle a situation where the migration is taking longer than expected and the app's functionality is being impacted?" A strong answer would be: "I would prioritize the most critical accessibility features and implement them first, while also ensuring that the app's functionality is not impacted. I would also communicate regularly with the team and stakeholders to ensure that everyone is aware of the progress and any issues that arise."&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Amit Chakraborty is a founding engineer and senior architect — React Native, AI/RAG systems and production architecture. Portfolio: &lt;a href="https://www.amitchakraborty.dev?utm_source=article&amp;amp;utm_medium=content&amp;amp;utm_campaign=mobile-accessibility-a-safe-migration-path" rel="noopener noreferrer"&gt;www.amitchakraborty.dev&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Open to senior and founding engineering roles, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>a11y</category>
      <category>migrations</category>
      <category>architecture</category>
    </item>
    <item>
      <title>React, deeply · 3. Effects, honestly</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Fri, 20 Nov 2026 14:45:45 +0000</pubDate>
      <link>https://dev.to/techamit95ch/react-deeply-3-effects-honestly-26cc</link>
      <guid>https://dev.to/techamit95ch/react-deeply-3-effects-honestly-26cc</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;React, deeply&lt;/strong&gt; · Chapter 3 of 12 · Web · new chapter every Monday night&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Identify the small number of cases useEffect is for, and the far larger number where it is the wrong tool.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Emma, a front-end engineer, is working on a real-time analytics dashboard with a two-month sprint deadline. The dashboard updates a table every second with live metrics from a WebSocket. After adding a "filter by region" feature, the dashboard started experiencing issues: the table lags by up to three seconds, the CPU usage on the user's laptop spikes to 90%, and the performance monitoring alert fires every time a user opens the page. The team cannot afford to roll back the feature, and the sprint deadline is only three days away. Emma needs to identify the cause of the problem and fix it quickly.&lt;/p&gt;

&lt;p&gt;The issue seems to be related to the way the state is being updated and the effects that are being run after each update. Emma has been using &lt;code&gt;useEffect&lt;/code&gt; to handle the side effects of updating the table, but she's not sure if she's using it correctly. She's also not sure if there are other factors contributing to the performance issues.&lt;/p&gt;

&lt;p&gt;Emma's current implementation uses &lt;code&gt;useEffect&lt;/code&gt; to fetch new data from the WebSocket and update the table every second. However, she's noticed that the &lt;code&gt;useEffect&lt;/code&gt; hook is being run more frequently than expected, causing the CPU usage to spike. She's tried to optimize the code by using &lt;code&gt;useCallback&lt;/code&gt; and &lt;code&gt;useMemo&lt;/code&gt;, but the issue persists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you should have a good understanding of React's rendering and reconciliation process, as well as the different state mechanisms available in React, such as &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useReducer&lt;/code&gt;. You should also have a basic understanding of how to use &lt;code&gt;useEffect&lt;/code&gt; to handle side effects in your React components.&lt;/p&gt;

&lt;p&gt;Make sure you have the following installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js (version 16 or later)&lt;/li&gt;
&lt;li&gt;npm (version 8 or later)&lt;/li&gt;
&lt;li&gt;React (version 18 or later)&lt;/li&gt;
&lt;li&gt;A code editor or IDE of your choice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can verify that you have the correct versions installed by running the following commands in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node -v
npm -v
npm ls react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Understanding useEffect
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;useEffect&lt;/code&gt; is a powerful hook in React that allows you to run side effects after rendering a component. However, it's often misused or overused, leading to performance issues like the one Emma is experiencing.&lt;/p&gt;

&lt;p&gt;To understand how &lt;code&gt;useEffect&lt;/code&gt; works, let's break down its signature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;effect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;effect&lt;/code&gt; function is the code that will be run after rendering the component, and the &lt;code&gt;dependencies&lt;/code&gt; array specifies which values the effect depends on. If any of the values in the &lt;code&gt;dependencies&lt;/code&gt; array change, the effect will be re-run.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use useEffect
&lt;/h2&gt;

&lt;p&gt;So, when should you use &lt;code&gt;useEffect&lt;/code&gt;? Here are some scenarios where &lt;code&gt;useEffect&lt;/code&gt; is the right tool for the job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching data from an API or WebSocket&lt;/li&gt;
&lt;li&gt;Setting up event listeners or subscriptions&lt;/li&gt;
&lt;li&gt;Updating the DOM directly (although this should be avoided whenever possible)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, there are many cases where &lt;code&gt;useEffect&lt;/code&gt; is not the right tool. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updating state based on user input&lt;/li&gt;
&lt;li&gt;Running computations that don't have side effects&lt;/li&gt;
&lt;li&gt;Handling errors or exceptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In these cases, other hooks like &lt;code&gt;useState&lt;/code&gt;, &lt;code&gt;useReducer&lt;/code&gt;, or &lt;code&gt;useCallback&lt;/code&gt; might be more suitable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;Let's take a look at Emma's code and see where she might be going wrong. Here's an example of her &lt;code&gt;useEffect&lt;/code&gt; hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'react'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Dashboard&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&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="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setFilter&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'all'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&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;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebSocket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'ws://example.com/data'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;onmessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&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="nf"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&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="k"&gt;return&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="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&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="p"&gt;}&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;filter&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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;The problem with this code is that the &lt;code&gt;useEffect&lt;/code&gt; hook is being run every time the &lt;code&gt;filter&lt;/code&gt; state changes, which is causing the WebSocket connection to be reopened and closed repeatedly. This is likely causing the CPU usage to spike and the table to lag.&lt;/p&gt;

&lt;p&gt;To fix this issue, Emma can use the &lt;code&gt;useEffect&lt;/code&gt; hook with an empty &lt;code&gt;dependencies&lt;/code&gt; array, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&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;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebSocket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'ws://example.com/data'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;onmessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&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="nf"&gt;setData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&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="k"&gt;return&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="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&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="p"&gt;}&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="p"&gt;[&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 will ensure that the &lt;code&gt;useEffect&lt;/code&gt; hook is only run once, when the component mounts, and not every time the &lt;code&gt;filter&lt;/code&gt; state changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;There are several ways that the &lt;code&gt;useEffect&lt;/code&gt; hook can break, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running the effect too frequently, causing performance issues&lt;/li&gt;
&lt;li&gt;Failing to clean up after the effect, causing memory leaks&lt;/li&gt;
&lt;li&gt;Not handling errors or exceptions properly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To avoid these issues, make sure to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;useEffect&lt;/code&gt; hook with caution and only when necessary&lt;/li&gt;
&lt;li&gt;Always clean up after the effect by returning a function from the &lt;code&gt;useEffect&lt;/code&gt; hook&lt;/li&gt;
&lt;li&gt;Handle errors and exceptions properly using try-catch blocks and error boundaries&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;useEffect&lt;/code&gt; can come with a cost, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance issues if the effect is run too frequently&lt;/li&gt;
&lt;li&gt;Memory leaks if the effect is not cleaned up properly&lt;/li&gt;
&lt;li&gt;Complexity and debugging issues if the effect is not handled properly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To minimize these costs, make sure to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;useEffect&lt;/code&gt; hook only when necessary&lt;/li&gt;
&lt;li&gt;Optimize the effect to run as infrequently as possible&lt;/li&gt;
&lt;li&gt;Use tools like the React DevTools to debug and optimize the effect&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;When interviewing for a front-end engineering position, you may be asked questions about &lt;code&gt;useEffect&lt;/code&gt; and how to use it properly. Here are some example questions and answers:&lt;/p&gt;

&lt;p&gt;Q: What is &lt;code&gt;useEffect&lt;/code&gt; and how does it work?&lt;br&gt;
A: &lt;code&gt;useEffect&lt;/code&gt; is a hook in React that allows you to run side effects after rendering a component. It takes two arguments: the effect function and the dependencies array. The effect function is run after rendering the component, and the dependencies array specifies which values the effect depends on.&lt;/p&gt;

&lt;p&gt;Q: When should you use &lt;code&gt;useEffect&lt;/code&gt;?&lt;br&gt;
A: You should use &lt;code&gt;useEffect&lt;/code&gt; when you need to run a side effect after rendering a component, such as fetching data from an API or setting up event listeners.&lt;/p&gt;

&lt;p&gt;Q: What are some common mistakes people make when using &lt;code&gt;useEffect&lt;/code&gt;?&lt;br&gt;
A: Some common mistakes people make when using &lt;code&gt;useEffect&lt;/code&gt; include running the effect too frequently, failing to clean up after the effect, and not handling errors or exceptions properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a simple React component that uses &lt;code&gt;useEffect&lt;/code&gt; to fetch data from an API and update the component's state.&lt;/li&gt;
&lt;li&gt;Optimize the component to run the effect as infrequently as possible.&lt;/li&gt;
&lt;li&gt;Use the React DevTools to debug and optimize the component.&lt;/li&gt;
&lt;li&gt;Write a test for the component to ensure it is working correctly.&lt;/li&gt;
&lt;li&gt;Refactor the component to use a different hook, such as &lt;code&gt;useCallback&lt;/code&gt; or &lt;code&gt;useMemo&lt;/code&gt;, to see if it improves performance.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/react-deep-dive#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  React, deeply
&lt;/h2&gt;

&lt;p&gt;Chapter 3 of 12. New chapter every Monday night.&lt;br&gt;
Next: &lt;strong&gt;Data fetching: Suspense, transitions and cache boundaries&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/react-deep-dive" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=react-deep-dive" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>web</category>
      <category>react</category>
      <category>understandinguseeffect</category>
    </item>
    <item>
      <title>Crash Triage and Symbolication: A Performance Budget Approach</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Fri, 20 Nov 2026 05:45:38 +0000</pubDate>
      <link>https://dev.to/techamit95ch/crash-triage-and-symbolication-a-performance-budget-approach-24n4</link>
      <guid>https://dev.to/techamit95ch/crash-triage-and-symbolication-a-performance-budget-approach-24n4</guid>
      <description>&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;Say you are a lead engineer on a mobile app team, tasked with improving the performance of your React Native application. Your team has been receiving vague complaints about the app being "slow" or "crashing frequently". The symptom is a high crash rate, with a metric showing a 20% increase in crashes over the past month. This has cost the team a release, as the crash rate is above the acceptable threshold, and users are starting to complain. The team has been working on optimizing the app's performance, but without a clear understanding of the bottlenecks, it's difficult to prioritize fixes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why It Happens
&lt;/h2&gt;

&lt;p&gt;Crash triage and symbolication are crucial steps in identifying and fixing performance issues. However, without a clear performance budget, it's challenging to determine what constitutes a "slow" or "crashing" app. A performance budget approach sets a measurable ceiling for acceptable performance, allowing the team to defend it and make data-driven decisions. In the case of crash triage, a performance budget approach involves setting a threshold for acceptable crash rates, and then using symbolication to identify the underlying causes of crashes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix, Step by Step
&lt;/h2&gt;

&lt;p&gt;To implement a performance budget approach for crash triage and symbolication:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set a performance budget&lt;/strong&gt;: Determine the acceptable crash rate threshold for your app. This can be based on industry benchmarks, user expectations, or business requirements. For example, a threshold of 1% crash rate per session.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure crash reporting&lt;/strong&gt;: Set up a crash reporting tool, such as Crashlytics or Bugsnag, to collect crash data. Ensure that the tool provides detailed information about each crash, including stack traces and user feedback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement symbolication&lt;/strong&gt;: Use a symbolication tool, such as Firebase Crashlytics' symbolication feature, to translate crash reports into human-readable format. This will help identify the underlying causes of crashes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Triage crashes&lt;/strong&gt;: Regularly review crash reports and triage them based on frequency, user impact, and business criticality. Focus on fixing the most critical crashes first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up performance monitoring&lt;/strong&gt;: Use a performance monitoring tool, such as New Relic or AppDynamics, to track app performance metrics, such as response times, error rates, and resource utilization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analyze performance data&lt;/strong&gt;: Analyze performance data to identify bottlenecks and areas for optimization. Use this data to inform prioritization of fixes and optimizations.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What It Costs, and When Not to Do It
&lt;/h2&gt;

&lt;p&gt;Implementing a performance budget approach for crash triage and symbolication requires an upfront investment of time and resources. The cost of setting up crash reporting and symbolication tools can range from $100 to $1,000 per month, depending on the tool and the size of the app. Additionally, the time required to triage crashes and analyze performance data can range from 1 to 5 hours per week, depending on the frequency and severity of crashes. However, the benefits of a performance budget approach far outweigh the costs, as it allows the team to defend a measurable ceiling for acceptable performance and make data-driven decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  At Your Level
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Starting out: Focus on setting up crash reporting and symbolication tools, and start triaging crashes to understand the underlying causes.&lt;/li&gt;
&lt;li&gt;Working engineer: Analyze performance data to identify bottlenecks and areas for optimization, and prioritize fixes and optimizations based on business criticality and user impact.&lt;/li&gt;
&lt;li&gt;Senior or staff: Develop a comprehensive performance budget approach that sets a measurable ceiling for acceptable performance, and defend it by making data-driven decisions.&lt;/li&gt;
&lt;li&gt;Lead or director: Ensure that the performance budget approach is aligned with business requirements and user expectations, and allocate resources accordingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the Interview
&lt;/h2&gt;

&lt;p&gt;In an interview, a question about crash triage and symbolication might be phrased as: "How would you approach crash triage and symbolication in a React Native app, and what metrics would you use to measure success?" A weak answer might focus on the tools and technologies used, without discussing the underlying approach or metrics. A strong answer would discuss the performance budget approach, including setting a measurable ceiling for acceptable performance, triaging crashes, and analyzing performance data to inform prioritization of fixes and optimizations. For example: "I would set a performance budget that includes a threshold for acceptable crash rates, and then use symbolication to identify the underlying causes of crashes. I would triage crashes based on frequency, user impact, and business criticality, and prioritize fixes and optimizations accordingly. I would measure success based on the crash rate, user satisfaction, and business metrics such as revenue and customer retention." A follow-up question might ask the candidate to discuss the trade-offs between different approaches, such as the cost of setting up crash reporting and symbolication tools versus the benefits of improved app performance.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Amit Chakraborty is a founding engineer and senior architect — React Native, AI/RAG systems and production architecture. Portfolio: &lt;a href="https://www.amitchakraborty.dev?utm_source=article&amp;amp;utm_medium=content&amp;amp;utm_campaign=crash-triage-and-symbolication-a-performance-budget-approach" rel="noopener noreferrer"&gt;www.amitchakraborty.dev&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Open to senior and founding engineering roles, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>performance</category>
    </item>
    <item>
      <title>React Native, from a blank machine to a shipped app · 3. Your first screen: components, props and state</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Thu, 19 Nov 2026 14:45:39 +0000</pubDate>
      <link>https://dev.to/techamit95ch/react-native-from-a-blank-machine-to-a-shipped-app-3-your-first-screen-components-props-and-3e7a</link>
      <guid>https://dev.to/techamit95ch/react-native-from-a-blank-machine-to-a-shipped-app-3-your-first-screen-components-props-and-3e7a</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;React Native, from a blank machine to a shipped app&lt;/strong&gt; · Chapter 3 of 12 · Mobile · new chapter every Monday morning&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Render something real, change it, and understand exactly why the screen updated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Emma, a junior mobile engineer, has just finished the "Hello World" screen of her first React Native project. She wants to add a feature that parses a CSV file on the device and displays a progress bar while the work is being done. To achieve this, she writes a JavaScript &lt;code&gt;for&lt;/code&gt; loop that iterates over the rows, updates a state variable each 100 rows, and expects the UI to stay responsive. However, when she runs the app, the progress bar never moves, the app freezes for several seconds, and the iOS build logs a warning. Emma is unsure why her app is not updating the UI as expected and is looking for a solution to fix this issue.&lt;/p&gt;

&lt;p&gt;The symptom Emma sees is that the app freezes, and the progress bar does not update. This costs her time, as she is unable to deliver the feature as expected, and potentially affects the user experience. The warning in the iOS build logs suggests that there might be an issue with the way the JavaScript code is interacting with the native threads or the renderer.&lt;/p&gt;

&lt;p&gt;Emma's situation is a common one in React Native development, where the JavaScript thread can block the native threads, causing the app to freeze. To fix this issue, Emma needs to understand how React Native components, props, and state work together to update the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you should have a React Native project set up with the latest version of React Native (0.76) and have completed the previous chapters in this series. You should also have Node.js (16.14.2) and JDK (11) installed on your machine. To verify that your setup is correct, run the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx react-native --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should output the version of React Native you are using. If you are using an older version, update to the latest version using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx react-native upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you have the necessary dependencies installed by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;depending on your package manager.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding components, props, and state
&lt;/h2&gt;

&lt;p&gt;To fix Emma's issue, we need to understand how React Native components, props, and state work together to update the UI. A React Native component is a JavaScript function that returns a JSX element. Props are short for "properties" and are used to pass data from a parent component to a child component. State, on the other hand, is used to store data that changes over time.&lt;/p&gt;

&lt;p&gt;In Emma's case, the &lt;code&gt;for&lt;/code&gt; loop is blocking the JavaScript thread, which is preventing the UI from updating. To fix this, we need to use a different approach that allows the JavaScript thread to yield control back to the native threads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using setState to update the UI
&lt;/h2&gt;

&lt;p&gt;To update the UI in React Native, we need to use the &lt;code&gt;setState&lt;/code&gt; method. &lt;code&gt;setState&lt;/code&gt; is a method that updates the state of a component and triggers a re-render of the component. When we call &lt;code&gt;setState&lt;/code&gt;, React Native updates the state and then re-renders the component with the new state.&lt;/p&gt;

&lt;p&gt;However, in Emma's case, the &lt;code&gt;for&lt;/code&gt; loop is blocking the JavaScript thread, which is preventing the &lt;code&gt;setState&lt;/code&gt; method from updating the UI. To fix this, we can use the &lt;code&gt;setTimeout&lt;/code&gt; function to yield control back to the native threads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;To fix Emma's issue, we can use the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new component that displays the progress bar.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;setState&lt;/code&gt; method to update the progress bar.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;setTimeout&lt;/code&gt; function to yield control back to the native threads.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is an example of how we can implement this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'react'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ProgressBarAndroid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'react-native'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;ProgressBar&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="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setProgress&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&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="nf"&gt;useEffect&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;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;intervalId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;setInterval&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;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;setProgress&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prevProgress&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prevProgress&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;intervalId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;prevProgress&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;10&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="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&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="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;intervalId&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="p"&gt;,&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="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;%&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ProgressBarAndroid&lt;/span&gt; &lt;span class="n"&gt;styleAttr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Horizontal"&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nc"&gt;ProgressBar&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we create a new component that displays a progress bar. We use the &lt;code&gt;useState&lt;/code&gt; hook to store the progress state, and the &lt;code&gt;useEffect&lt;/code&gt; hook to update the progress state every second. We use the &lt;code&gt;setInterval&lt;/code&gt; function to schedule the updates, and the &lt;code&gt;clearInterval&lt;/code&gt; function to cancel the updates when the progress reaches 100%.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;There are several ways this code can break. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the &lt;code&gt;setInterval&lt;/code&gt; function is not cleared properly, it can cause a memory leak.&lt;/li&gt;
&lt;li&gt;If the &lt;code&gt;setState&lt;/code&gt; method is not used correctly, it can cause the UI to not update properly.&lt;/li&gt;
&lt;li&gt;If the &lt;code&gt;useEffect&lt;/code&gt; hook is not used correctly, it can cause the component to not re-render properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix these issues, we need to make sure to clear the &lt;code&gt;setInterval&lt;/code&gt; function properly, use the &lt;code&gt;setState&lt;/code&gt; method correctly, and use the &lt;code&gt;useEffect&lt;/code&gt; hook correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;setState&lt;/code&gt; and &lt;code&gt;setTimeout&lt;/code&gt; to update the UI has some costs. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It can cause the UI to update slowly, especially if the updates are frequent.&lt;/li&gt;
&lt;li&gt;It can cause the JavaScript thread to block, especially if the updates are complex.&lt;/li&gt;
&lt;li&gt;It can cause the native threads to block, especially if the updates are not yielded properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To mitigate these costs, we need to make sure to use &lt;code&gt;setState&lt;/code&gt; and &lt;code&gt;setTimeout&lt;/code&gt; judiciously, and to yield control back to the native threads regularly.&lt;/p&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;In an interview, you may be asked to explain how React Native components, props, and state work together to update the UI. You may be asked to write code that updates a progress bar, and to explain how the code works.&lt;/p&gt;

&lt;p&gt;A weak answer might be: "I use &lt;code&gt;setState&lt;/code&gt; to update the UI, and it just works."&lt;/p&gt;

&lt;p&gt;A strong answer would be: "I use &lt;code&gt;setState&lt;/code&gt; to update the UI, but I also need to make sure to yield control back to the native threads using &lt;code&gt;setTimeout&lt;/code&gt;. This is because the JavaScript thread can block the native threads, causing the UI to not update properly. I also need to make sure to clear the &lt;code&gt;setInterval&lt;/code&gt; function properly to avoid memory leaks."&lt;/p&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new React Native project and add a progress bar component that updates every second.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;setState&lt;/code&gt; method to update the progress bar, and the &lt;code&gt;setTimeout&lt;/code&gt; function to yield control back to the native threads.&lt;/li&gt;
&lt;li&gt;Add a button that starts and stops the progress bar.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;useEffect&lt;/code&gt; hook to update the progress bar when the component mounts and unmounts.&lt;/li&gt;
&lt;li&gt;Test the progress bar on a real device to make sure it updates properly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you have completed these tasks, you should have a working progress bar component that updates every second, and you should understand how React Native components, props, and state work together to update the UI.&lt;/p&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/react-native-foundations#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  React Native, from a blank machine to a shipped app
&lt;/h2&gt;

&lt;p&gt;Chapter 3 of 12. New chapter every Monday morning.&lt;br&gt;
Next: &lt;strong&gt;Layout on a phone: the Flexbox rules that cover almost everything&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/react-native-foundations" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=react-native-foundations" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>mobile</category>
      <category>reactnative</category>
      <category>usingsetstatetoupdatetheui</category>
    </item>
    <item>
      <title>Engineering practice: git, code, tests · 3. Code review: what to look for, in what order</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Thu, 19 Nov 2026 05:45:37 +0000</pubDate>
      <link>https://dev.to/techamit95ch/engineering-practice-git-code-tests-3-code-review-what-to-look-for-in-what-order-577c</link>
      <guid>https://dev.to/techamit95ch/engineering-practice-git-code-tests-3-code-review-what-to-look-for-in-what-order-577c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Engineering practice: git, code, tests&lt;/strong&gt; · Chapter 3 of 12 · Craft · new chapter every Sunday night&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Review effectively and receive review without defensiveness.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;You are a junior engineer on a two-week sprint for the payments team. Mid-sprint, you discover a flaky test that fails on the CI runner every night. You open a branch, add a one-line guard clause, and push. The CI pipeline passes, so you think you're done and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit -am &lt;span class="s2"&gt;"fix bug"&lt;/span&gt;
git push origin payment-guard-2024-09-15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, when you submit your pull request, a senior engineer reviews it and points out that your commit message doesn't follow the team's conventions, and your code change, although correct, doesn't include any tests to verify the fix. The reviewer also mentions that the code could be improved for readability and maintainability. You feel defensive about your code and wonder why the reviewer is being so picky. You start to question whether you're cut out for this job.&lt;/p&gt;

&lt;p&gt;The problem is not just about the code change, but about how you receive and respond to feedback. You need to learn how to review code effectively, both as the author and as the reviewer, and understand what to look for in a code review. This will help you improve the quality of your code, learn from others, and become a better engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you should have completed the previous chapters on Git as a thinking tool and branching, rebasing, and conflicts without fear. You should be comfortable with Git basics, including committing, pushing, and pulling changes. You should also have a GitHub account and be familiar with the GitHub interface.&lt;/p&gt;

&lt;p&gt;To verify that you have the necessary setup, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should output the version of Git installed on your system. If you don't have Git installed, you can download it from the official Git website.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to look for in a code review
&lt;/h2&gt;

&lt;p&gt;When reviewing code, there are several things to look for, in a specific order. First, you should check that the code is functional and correct. This includes verifying that the code fixes the intended bug or implements the desired feature. Next, you should look at the code's readability and maintainability. This includes checking for clear and concise variable names, proper commenting, and a consistent coding style.&lt;/p&gt;

&lt;p&gt;You should also check for tests. Are there any tests that verify the code change? Are the tests comprehensive and cover all the possible scenarios? Finally, you should look for any potential performance or security issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to give and receive feedback
&lt;/h2&gt;

&lt;p&gt;When giving feedback, it's essential to be specific, clear, and constructive. Instead of saying "this code is bad," say "this variable name is unclear, consider renaming it to something more descriptive." When receiving feedback, try not to take it personally and focus on the specific points being made. Ask questions if you're unsure about something, and be open to changing your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;Let's go through an example of how to review a code change. Suppose you're reviewing a pull request that adds a new feature to your team's project. The code change includes a new function that implements the feature, but it doesn't include any tests.&lt;/p&gt;

&lt;p&gt;Here are the steps to follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check the commit message&lt;/strong&gt;: Is the commit message clear and descriptive? Does it follow the team's conventions?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify the code change&lt;/strong&gt;: Does the code change implement the desired feature? Are there any obvious bugs or issues?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check for tests&lt;/strong&gt;: Are there any tests that verify the code change? Are the tests comprehensive and cover all the possible scenarios?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review the code's readability and maintainability&lt;/strong&gt;: Are the variable names clear and concise? Is the code well-commented and easy to understand?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check for performance and security issues&lt;/strong&gt;: Are there any potential performance or security issues with the code change?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;There are several ways that a code review can go wrong. Here are a few examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The reviewer is too harsh&lt;/strong&gt;: The reviewer is overly critical and focuses on minor issues, rather than the overall quality of the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The author is too defensive&lt;/strong&gt;: The author takes the feedback personally and becomes defensive, rather than focusing on the specific points being made.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The code change is too complex&lt;/strong&gt;: The code change is too large or complex, making it difficult to review and understand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In each of these cases, the key is to stay focused on the specific issues and avoid taking things personally. As the reviewer, try to be clear and constructive in your feedback. As the author, try to be open to feedback and willing to make changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Code review is not free. It takes time and effort to review code thoroughly, and it can be frustrating to receive feedback on your work. However, the benefits of code review far outweigh the costs. By reviewing code regularly, you can catch bugs and issues early, improve the quality of your code, and learn from others.&lt;/p&gt;

&lt;p&gt;In terms of specific costs, code review can take up to 30% of a team's time, depending on the size and complexity of the codebase. However, this investment can pay off in the long run by reducing the number of bugs and issues that make it to production.&lt;/p&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;In an interview, you may be asked to review a code sample or explain how you approach code review. Here's an example of how you might answer:&lt;/p&gt;

&lt;p&gt;Interviewer: "Can you walk me through your process for reviewing code?"&lt;/p&gt;

&lt;p&gt;You: "Yes, definitely. When I review code, I first check the commit message to make sure it's clear and descriptive. Then, I verify the code change to make sure it implements the desired feature. Next, I check for tests to make sure the code change is verified. Finally, I review the code's readability and maintainability to make sure it's easy to understand and maintain."&lt;/p&gt;

&lt;p&gt;Interviewer: "That's great. Can you give me an example of a time when you received feedback on your code and how you responded to it?"&lt;/p&gt;

&lt;p&gt;You: "Yes, definitely. One time, I received feedback on a code change I made, and the reviewer pointed out that my variable names were unclear. I took the feedback and renamed the variables to make them more descriptive. I also added comments to explain what the code was doing."&lt;/p&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Review a code sample&lt;/strong&gt;: Find a code sample online or in a project you're working on, and review it using the steps outlined above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give and receive feedback&lt;/strong&gt;: Find a partner or colleague and exchange code samples. Give each other feedback and discuss the feedback you receive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement a code review process&lt;/strong&gt;: If you're working on a team, implement a code review process that includes regular reviews and feedback. If you're working alone, find a way to get feedback on your code, such as by joining an online community or finding a mentor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following these tasks and practicing code review regularly, you can improve the quality of your code and become a better engineer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/engineering-practices#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Engineering practice: git, code, tests
&lt;/h2&gt;

&lt;p&gt;Chapter 3 of 12. New chapter every Sunday night.&lt;br&gt;
Next: &lt;strong&gt;Naming, the hard part&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/engineering-practices" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=engineering-practices" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>craft</category>
      <category>engineeringpractice</category>
      <category>whattolookforinacodereview</category>
    </item>
    <item>
      <title>Background Tasks and Push Delivery: A Performance Budget Approach</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Wed, 18 Nov 2026 14:45:05 +0000</pubDate>
      <link>https://dev.to/techamit95ch/background-tasks-and-push-delivery-a-performance-budget-approach-1c24</link>
      <guid>https://dev.to/techamit95ch/background-tasks-and-push-delivery-a-performance-budget-approach-1c24</guid>
      <description>&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;Say you are a mobile app developer tasked with optimizing the performance of your React Native application. Your team has been receiving complaints about slow push notification delivery and sluggish background task execution. The symptom is a significant delay between the time a push notification is sent and the time it is received by the user, resulting in a poor user experience. This delay is costing your team in terms of user engagement and retention, with a measurable impact on key metrics such as daily active users and average session length.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why It Happens
&lt;/h2&gt;

&lt;p&gt;Background tasks and push notifications are critical components of many mobile applications, but they can be resource-intensive and impact application performance. In React Native, background tasks are executed using the &lt;code&gt;react-native-background-timer&lt;/code&gt; library, while push notifications are handled using services like Firebase Cloud Messaging (FCM) or Apple Push Notification service (APNs). However, the underlying architecture of these libraries and services can lead to performance bottlenecks, such as network latency, battery drain, and CPU usage spikes. A vague "make it faster" request from stakeholders is not enough to address these issues; a more structured approach is needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix
&lt;/h2&gt;

&lt;p&gt;To address the performance issues with background tasks and push notifications, a performance budget approach can be applied. This involves setting measurable ceilings for key performance indicators (KPIs) such as latency, CPU usage, and battery drain. Here are the steps to implement this approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Define performance budgets&lt;/strong&gt;: Establish clear, measurable ceilings for key performance indicators such as latency (e.g., 500ms for push notification delivery), CPU usage (e.g., 10% average usage), and battery drain (e.g., 5% per hour). These budgets should be based on industry benchmarks and user expectations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor performance metrics&lt;/strong&gt;: Use tools like React Native's built-in &lt;code&gt;PerformanceMonitor&lt;/code&gt; or third-party libraries like &lt;code&gt;react-native-perf-monitor&lt;/code&gt; to collect data on current performance metrics. This data will help identify areas where the application is exceeding its performance budgets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize background tasks&lt;/strong&gt;: Review the implementation of background tasks and optimize them for performance. This may involve using more efficient algorithms, reducing the frequency of tasks, or using caching mechanisms to minimize network requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure push notification settings&lt;/strong&gt;: Adjust push notification settings to minimize latency and battery drain. This may involve adjusting the frequency of notifications, using more efficient notification protocols (e.g., FCM's &lt;code&gt;high_priority&lt;/code&gt; messages), or implementing notification batching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify performance improvements&lt;/strong&gt;: Use the same monitoring tools to verify that the optimizations have improved performance metrics and brought them within the established budgets.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What It Costs, and When Not to Do It
&lt;/h2&gt;

&lt;p&gt;Implementing a performance budget approach for background tasks and push notifications requires significant upfront investment in monitoring tools, optimization efforts, and testing. However, the long-term benefits of improved user experience, increased engagement, and reduced churn can outweigh these costs. This approach may not be suitable for applications with extremely low traffic or those that do not rely heavily on background tasks and push notifications. In such cases, the costs of implementation may outweigh the potential benefits.&lt;/p&gt;

&lt;h2&gt;
  
  
  At Your Level
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Starting out&lt;/strong&gt;: Focus on understanding the basics of React Native performance optimization and the importance of setting measurable performance budgets. Begin by monitoring your application's performance metrics and identifying areas for improvement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Working engineer&lt;/strong&gt;: Apply the performance budget approach to your current project, starting with small, incremental optimizations and verifying their impact on performance metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Senior or staff&lt;/strong&gt;: Lead the implementation of a performance budget approach across your team or organization, ensuring that all applications are optimized for key performance indicators. Develop and maintain a set of best practices for performance optimization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lead or director&lt;/strong&gt;: Allocate resources and budget for performance optimization efforts, prioritizing applications with high traffic and critical performance requirements. Establish key performance indicators and track the return on investment (ROI) of performance optimization efforts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the Interview
&lt;/h2&gt;

&lt;p&gt;When discussing performance optimization in an interview, the question may be phrased as: "How would you approach optimizing the performance of a React Native application with slow push notification delivery and background task execution?" A weak answer might focus solely on implementing caching or using a faster library, without considering the underlying performance budgets and metrics. A strong answer would outline the steps involved in establishing a performance budget approach, including defining measurable ceilings, monitoring performance metrics, and optimizing background tasks and push notification settings. The interviewer may follow up with questions about trade-offs, such as "What are the potential drawbacks of prioritizing push notification delivery speed over battery life?" or "How would you balance the need for frequent background tasks with the risk of increased CPU usage?" A senior or staff candidate should be able to discuss the implications of performance optimization on application architecture and user experience, while a director or engineering manager should be able to articulate the business case for performance optimization and its impact on key metrics such as user engagement and retention.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Amit Chakraborty is a founding engineer and senior architect — React Native, AI/RAG systems and production architecture. Portfolio: &lt;a href="https://www.amitchakraborty.dev?utm_source=article&amp;amp;utm_medium=content&amp;amp;utm_campaign=background-tasks-and-push-delivery-a-performance-budget-approach" rel="noopener noreferrer"&gt;www.amitchakraborty.dev&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Open to senior and founding engineering roles, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>performance</category>
      <category>pushnotifications</category>
      <category>architecture</category>
    </item>
    <item>
      <title>The AI tools panel · 3. Generated applications and where they stop</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Wed, 18 Nov 2026 05:45:09 +0000</pubDate>
      <link>https://dev.to/techamit95ch/the-ai-tools-panel-3-generated-applications-and-where-they-stop-46o7</link>
      <guid>https://dev.to/techamit95ch/the-ai-tools-panel-3-generated-applications-and-where-they-stop-46o7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The AI tools panel&lt;/strong&gt; · Chapter 3 of 12 · AI Engineering · new chapter every Sunday afternoon&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Understand what app generators do well and where the ceiling is.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Sofia, a senior backend engineer, has been tasked with prototyping an internal tool to parse incoming support tickets, suggest a short response, and optionally generate a code snippet to reproduce a reported bug. She has access to several AI code assistants, including GitHub Copilot (v1.84), Claude 3.5 Sonnet (2024-09), OpenAI GPT-4-Turbo (2024-10), and the open-source Code Llama 2-7B-Chat (2024-07). However, she is unsure which tool to use for this specific task and how to integrate it into her workflow. The prototype needs to be completed quickly, and the team is counting on her to deliver a working solution. &lt;/p&gt;

&lt;p&gt;Sofia's initial attempt to use GitHub Copilot to generate the entire application resulted in a promising start, but she soon realized that the generated code lacked the nuance and customization required for their specific use case. The tool had created a basic CRUD application, but it did not account for the complex business logic and integrations needed for the support ticket parser. Sofia spent several hours trying to modify the generated code, but it became clear that she was fighting the tool rather than working with it.&lt;/p&gt;

&lt;p&gt;The experience left Sofia wondering what app generators like GitHub Copilot are truly capable of and where their limitations lie. She needs to understand how to effectively utilize these tools to accelerate her development process without sacrificing the quality and customization required for her project. The clock is ticking, and Sofia must find a way to leverage the strengths of app generators while avoiding their weaknesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you should have a basic understanding of the AI code assistants mentioned earlier, such as GitHub Copilot, Claude, OpenAI GPT-4-Turbo, and Code Llama. You should also have a Python environment set up with the necessary dependencies installed, including the &lt;code&gt;transformers&lt;/code&gt; library (version 4.24.0 or later) and the &lt;code&gt;pytorch&lt;/code&gt; library (version 2.0.0 or later). You can verify your setup by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install transformers pytorch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then checking the versions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;AutoModelForSeq2SeqLM&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__version__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AutoModelForSeq2SeqLM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__module__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should output the versions of the installed libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding App Generators
&lt;/h2&gt;

&lt;p&gt;App generators like GitHub Copilot are designed to accelerate the development process by generating boilerplate code, suggesting completions, and even creating entire applications. However, they are not a replacement for human judgment and expertise. To effectively utilize these tools, you need to understand their strengths and weaknesses.&lt;/p&gt;

&lt;p&gt;App generators excel at generating repetitive, straightforward code, such as CRUD applications, API clients, or data models. They can also help with code completion, suggesting the next line of code based on the context. However, they struggle with complex business logic, custom integrations, and nuanced requirements. In Sofia's case, the generated code lacked the necessary customization and nuance for their specific use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluating App Generator Output
&lt;/h2&gt;

&lt;p&gt;When working with app generators, it's essential to evaluate the output critically. You should check the generated code for correctness, completeness, and maintainability. Ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does the generated code meet the requirements?&lt;/li&gt;
&lt;li&gt;Is the code readable, maintainable, and efficient?&lt;/li&gt;
&lt;li&gt;Are there any potential security vulnerabilities or performance issues?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To evaluate the output, you can use tools like linters, code formatters, and security scanners. You can also use code review tools to collaborate with your team and ensure the generated code meets your standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;To demonstrate the capabilities and limitations of app generators, let's create a simple support ticket parser using GitHub Copilot. We'll use the &lt;code&gt;transformers&lt;/code&gt; library to fine-tune a pre-trained model for our specific task.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Python file called &lt;code&gt;support_ticket_parser.py&lt;/code&gt; and add the following code:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;AutoModelForSeq2SeqLM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AutoTokenizer&lt;/span&gt;

&lt;span class="c1"&gt;# Load the pre-trained model and tokenizer&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AutoModelForSeq2SeqLM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"t5-base"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AutoTokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"t5-base"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Define a function to parse support tickets&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_support_ticket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticket&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Preprocess the ticket text&lt;/span&gt;
    &lt;span class="n"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode_plus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;ticket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;add_special_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;return_attention_mask&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;return_tensors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"pt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Generate a response using the model&lt;/span&gt;
    &lt;span class="n"&gt;outputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"input_ids"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;attention_mask&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"attention_mask"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Postprocess the response&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outputs&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="n"&gt;skip_special_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;

&lt;span class="c1"&gt;# Test the function&lt;/span&gt;
&lt;span class="n"&gt;ticket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"The user is experiencing issues with the login feature."&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;parse_support_ticket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticket&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 code uses the &lt;code&gt;t5-base&lt;/code&gt; model to generate a response to a support ticket. You can modify the code to fine-tune the model for your specific use case.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the code and evaluate the output. Check if the generated response is accurate, complete, and maintainable.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;App generators can break in several ways, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Overfitting&lt;/strong&gt;: The generated code is too specialized for the training data and fails to generalize to new, unseen inputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Underfitting&lt;/strong&gt;: The generated code is too simplistic and fails to capture the complexity of the problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security vulnerabilities&lt;/strong&gt;: The generated code contains security vulnerabilities, such as SQL injection or cross-site scripting (XSS) attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix these issues, you can try the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fine-tune the model&lt;/strong&gt;: Adjust the hyperparameters, such as the learning rate or batch size, to improve the model's performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add more training data&lt;/strong&gt;: Increase the size and diversity of the training dataset to improve the model's generalizability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use security scanners&lt;/strong&gt;: Integrate security scanners, such as OWASP ZAP or Burp Suite, to identify and fix security vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Using app generators comes with several costs, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time&lt;/strong&gt;: Evaluating and refining the generated code can take significant time and effort.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quality&lt;/strong&gt;: The generated code may not meet the required standards, leading to maintenance and debugging issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: The generated code may contain security vulnerabilities, which can compromise the entire system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To mitigate these costs, you should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Establish clear requirements&lt;/strong&gt;: Define clear, concise requirements for the generated code to ensure it meets the necessary standards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use code review tools&lt;/strong&gt;: Collaborate with your team to review and refine the generated code, ensuring it meets the required quality and security standards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor and maintain&lt;/strong&gt;: Continuously monitor and maintain the generated code, updating it as necessary to ensure it remains secure and efficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;When discussing app generators in an interview, you may be asked questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What are the benefits and limitations of using app generators?"&lt;/li&gt;
&lt;li&gt;"How do you evaluate the output of an app generator?"&lt;/li&gt;
&lt;li&gt;"What are some common issues that can arise when using app generators, and how do you address them?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A weak answer might focus solely on the benefits of app generators, without acknowledging their limitations. A strong answer would discuss the trade-offs, such as the potential for overfitting or underfitting, and explain how to mitigate these issues.&lt;/p&gt;

&lt;p&gt;For example, a strong answer might say:&lt;/p&gt;

&lt;p&gt;"I've used app generators like GitHub Copilot to accelerate my development process, but I'm also aware of their limitations. One of the main issues is overfitting, where the generated code is too specialized for the training data. To address this, I fine-tune the model using additional training data and evaluate the output critically to ensure it meets the required standards."&lt;/p&gt;

&lt;p&gt;As you progress in your career, you may be asked more senior-level questions, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"How do you integrate app generators into your development workflow, and what are the benefits and drawbacks of this approach?"&lt;/li&gt;
&lt;li&gt;"What are some best practices for evaluating and refining the output of app generators, and how do you ensure the generated code meets the required quality and security standards?"&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a simple CRUD application using GitHub Copilot and evaluate the generated code for correctness, completeness, and maintainability.&lt;/li&gt;
&lt;li&gt;Fine-tune a pre-trained model for a specific task, such as sentiment analysis or text classification, and evaluate the performance of the model.&lt;/li&gt;
&lt;li&gt;Integrate an app generator into your development workflow and discuss the benefits and drawbacks of this approach.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Done looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A working CRUD application with a clear, concise evaluation of the generated code.&lt;/li&gt;
&lt;li&gt;A fine-tuned model with a clear, concise evaluation of its performance.&lt;/li&gt;
&lt;li&gt;A written discussion of the benefits and drawbacks of integrating an app generator into your development workflow.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/ai-tools-panel#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The AI tools panel
&lt;/h2&gt;

&lt;p&gt;Chapter 3 of 12. New chapter every Sunday afternoon.&lt;br&gt;
Next: &lt;strong&gt;Editor-native assistance&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/ai-tools-panel" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=ai-tools-panel" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>aiengineering</category>
      <category>theaitoolspanel</category>
      <category>understandingappgenerators</category>
    </item>
    <item>
      <title>App Store Review Rejections: A Performance Budget Approach</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Tue, 17 Nov 2026 14:45:47 +0000</pubDate>
      <link>https://dev.to/techamit95ch/app-store-review-rejections-a-performance-budget-approach-1ln6</link>
      <guid>https://dev.to/techamit95ch/app-store-review-rejections-a-performance-budget-approach-1ln6</guid>
      <description>&lt;h2&gt;
  
  
  The Situation
&lt;/h2&gt;

&lt;p&gt;Say you are a mobile app developer, tasked with improving the performance of your React Native application to meet the App Store's review guidelines. Your team has been receiving vague feedback from reviewers, stating that the app is too slow and needs to be optimized. The symptom is a rejected review, which costs your team time, money, and potential users. Each rejection delays the release of new features and bug fixes, resulting in a loss of revenue and user engagement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why It Happens
&lt;/h2&gt;

&lt;p&gt;The App Store review process is designed to ensure that apps meet certain standards for performance, security, and user experience. However, the review guidelines are often vague, making it difficult for developers to pinpoint the exact issues with their app. The "make it faster" feedback is a common example of this vagueness. Without a clear understanding of what "faster" means, developers are left to guess what changes will satisfy the reviewers. This can lead to a trial-and-error approach, where developers make arbitrary optimizations, hoping to stumble upon a solution that meets the review guidelines.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix, Step by Step
&lt;/h2&gt;

&lt;p&gt;To turn the vague "make it faster" feedback into a measurable ceiling, the team can follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Establish a performance budget&lt;/strong&gt;: Define a set of key performance indicators (KPIs) that measure the app's performance, such as startup time, frame rate, and memory usage. For example, the team can set a budget of 2 seconds for startup time, 60 frames per second for frame rate, and 100 MB for memory usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure the current performance&lt;/strong&gt;: Use tools like the React Native Debugger, Xcode, or Android Studio to measure the app's current performance and identify areas for improvement. For instance, the team can use the React Native Debugger to measure the startup time and identify bottlenecks in the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set a performance ceiling&lt;/strong&gt;: Based on the measured performance and the established budget, set a performance ceiling that the team can defend. For example, the team can set a ceiling of 1.5 seconds for startup time, 50 frames per second for frame rate, and 80 MB for memory usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize the app&lt;/strong&gt;: Use the performance ceiling as a guide to optimize the app's performance. This can involve optimizing images, reducing the number of components, and improving the app's architecture. For instance, the team can use a library like react-native-image-optimizer to compress images and reduce the app's size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor and maintain the performance&lt;/strong&gt;: Continuously monitor the app's performance and make adjustments as needed to maintain the established ceiling. This can involve setting up performance monitoring tools, such as New Relic or Datadog, to track the app's performance in real-time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What It Costs, and When Not to Do It
&lt;/h2&gt;

&lt;p&gt;Establishing a performance budget and defending it can be a time-consuming process, requiring significant resources and effort from the development team. However, the benefits of a performance budget approach far outweigh the costs. By setting a measurable ceiling, the team can ensure that the app meets the App Store's review guidelines, reducing the risk of rejection and the associated costs. Additionally, a performance budget approach can help the team to identify and prioritize performance optimizations, leading to a better user experience and increased user engagement.&lt;/p&gt;

&lt;p&gt;However, there are cases where a performance budget approach may not be suitable. For example, if the app is still in the early stages of development, it may be more important to focus on feature development rather than performance optimization. In such cases, the team can defer the performance budget approach until the app is more mature.&lt;/p&gt;

&lt;h2&gt;
  
  
  At Your Level
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Starting out: Focus on understanding the App Store review guidelines and the importance of performance optimization. Start by measuring the app's current performance and identifying areas for improvement.&lt;/li&gt;
&lt;li&gt;Working engineer: Take ownership of the performance budget and defend it. Use the established ceiling to guide optimization efforts and ensure that the app meets the review guidelines.&lt;/li&gt;
&lt;li&gt;Senior or staff: Develop a comprehensive performance strategy that includes a performance budget, monitoring, and maintenance. Ensure that the team is equipped to defend the performance ceiling and make data-driven decisions.&lt;/li&gt;
&lt;li&gt;Lead or director: Ensure that the performance budget is aligned with the company's goals and objectives. Provide resources and support to the development team to establish and defend the performance ceiling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the Interview
&lt;/h2&gt;

&lt;p&gt;When interviewing for a mobile app development position, the candidate may be asked to explain how they would approach performance optimization for a React Native app. A weak answer might sound like: "I would just use a bunch of optimization tools and try to make the app faster." This answer is weak because it lacks a clear understanding of the App Store review guidelines and the importance of a measurable performance ceiling.&lt;/p&gt;

&lt;p&gt;A strong answer, on the other hand, might sound like: "I would establish a performance budget and defend it. I would measure the app's current performance, set a performance ceiling, and use that ceiling to guide optimization efforts. I would also ensure that the team is equipped to monitor and maintain the performance ceiling, using data-driven decisions to inform optimization efforts."&lt;/p&gt;

&lt;p&gt;The follow-up question might be: "Can you give an example of a performance budget you've established in the past, and how you defended it?" This question separates candidates who have actually implemented a performance budget approach from those who have just read about it. A candidate who can provide a specific example, including the metrics used to measure performance and the optimization strategies employed, demonstrates a deeper understanding of the topic and is more likely to be successful in the role.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Amit Chakraborty is a founding engineer and senior architect — React Native, AI/RAG systems and production architecture. Portfolio: &lt;a href="https://www.amitchakraborty.dev?utm_source=article&amp;amp;utm_medium=content&amp;amp;utm_campaign=app-store-review-rejections-a-performance-budget-approach" rel="noopener noreferrer"&gt;www.amitchakraborty.dev&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Open to senior and founding engineering roles, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>performance</category>
    </item>
    <item>
      <title>Agent engineering: MCP, subagents and agentic systems · 2. Tool definitions as a contract</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Tue, 17 Nov 2026 05:45:09 +0000</pubDate>
      <link>https://dev.to/techamit95ch/agent-engineering-mcp-subagents-and-agentic-systems-2-tool-definitions-as-a-contract-1gek</link>
      <guid>https://dev.to/techamit95ch/agent-engineering-mcp-subagents-and-agentic-systems-2-tool-definitions-as-a-contract-1gek</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Agent engineering: MCP, subagents and agentic systems&lt;/strong&gt; · Chapter 2 of 14 · AI Engineering · new chapter every Sunday morning&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Write tool schemas a model uses correctly on the first attempt.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Say you are a senior backend engineer at a fintech startup. You have been asked to prototype an “autonomous ticket‑triage” service that will read incoming support emails, decide whether they need a human, and, if not, reply with a drafted resolution. You spin up a small Python script that calls the OpenAI &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model, feed it the email body, and print the model’s answer.&lt;/p&gt;

&lt;p&gt;When you run the script against a handful of real tickets you see two symptoms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script prints the same generic apology for every ticket, never reaching the “human‑escalate” branch you coded.
&lt;/li&gt;
&lt;li&gt;After a few minutes the process is killed by the OS with &lt;code&gt;MemoryError&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This costs you several hours of debugging time, and you start to question whether the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model is the right tool for the job. You also wonder if there's a way to define the tools and their interactions more explicitly, to avoid similar issues in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you should have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.9 or later installed on your system&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;openai&lt;/code&gt; library installed (&lt;code&gt;pip install openai&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;A basic understanding of the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model and its limitations (covered in Chapter 1)&lt;/li&gt;
&lt;li&gt;A working knowledge of Python and its ecosystem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can verify that your setup is working by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__version__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should print the version of the &lt;code&gt;openai&lt;/code&gt; library you have installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Defining tool contracts
&lt;/h2&gt;

&lt;p&gt;To write tool schemas that a model uses correctly, we need to define the tools and their interactions more explicitly. This involves creating a contract that specifies the input and output formats, as well as any constraints or assumptions that the tool makes.&lt;/p&gt;

&lt;p&gt;In the case of the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model, we need to define a schema that specifies the input format for the email body, as well as the expected output format for the model's answer. We also need to consider any constraints or assumptions that the model makes, such as the maximum length of the input text or the expected format of the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool schema basics
&lt;/h2&gt;

&lt;p&gt;A tool schema is a JSON object that defines the input and output formats for a tool, as well as any constraints or assumptions that the tool makes. The schema should include the following elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;name&lt;/code&gt;: a unique name for the tool&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;input&lt;/code&gt;: a description of the input format, including any required fields or constraints&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;output&lt;/code&gt;: a description of the output format, including any required fields or constraints&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;constraints&lt;/code&gt;: a list of any constraints or assumptions that the tool makes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a tool schema for the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model might look 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="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"gpt-4o-mini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"max_length"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"max_length"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"constraints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"input text must be in English"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"output text must be in English"&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;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;To write a tool schema for the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new JSON file called &lt;code&gt;tool_schema.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add the following code to the file:
&lt;/li&gt;
&lt;/ol&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="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"gpt-4o-mini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"max_length"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"max_length"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"constraints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"input text must be in English"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"output text must be in English"&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;ol&gt;
&lt;li&gt;Save the file and verify that it is valid JSON by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jq . tool_schema.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should print the contents of the file in a pretty-printed format.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;There are several ways that a tool schema can break, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invalid JSON syntax&lt;/li&gt;
&lt;li&gt;Missing or incorrect fields&lt;/li&gt;
&lt;li&gt;Constraints that are not met&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the tool schema is invalid, the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model may not work as expected, or may produce incorrect results. To debug a broken tool schema, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify that the JSON syntax is valid by running the &lt;code&gt;jq&lt;/code&gt; command&lt;/li&gt;
&lt;li&gt;Check that all required fields are present and correct&lt;/li&gt;
&lt;li&gt;Verify that the constraints are met by checking the input and output formats&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Defining a tool schema for the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model has several costs, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time and effort required to create and validate the schema&lt;/li&gt;
&lt;li&gt;Potential limitations on the flexibility of the model&lt;/li&gt;
&lt;li&gt;Risk of errors or inconsistencies in the schema&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the benefits of defining a tool schema include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improved accuracy and reliability of the model&lt;/li&gt;
&lt;li&gt;Reduced risk of errors or inconsistencies&lt;/li&gt;
&lt;li&gt;Easier debugging and maintenance of the model&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;In an interview, you may be asked to explain the concept of a tool schema and how it is used in agent engineering. A weak answer might sound like this:&lt;br&gt;
"I think a tool schema is like a blueprint for a tool, it defines how the tool works and what it does."&lt;/p&gt;

&lt;p&gt;A stronger answer might sound like this:&lt;br&gt;
"A tool schema is a formal definition of the input and output formats for a tool, as well as any constraints or assumptions that the tool makes. It's used to ensure that the tool is used correctly and consistently, and to reduce the risk of errors or inconsistencies. For example, in the case of the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model, a tool schema would define the input format for the email body and the expected output format for the model's answer."&lt;/p&gt;

&lt;p&gt;A follow-up question might be:&lt;br&gt;
"Can you give an example of how you would define a tool schema for a specific tool, such as the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a tool schema for a different tool, such as a natural language processing library or a computer vision model.&lt;/li&gt;
&lt;li&gt;Write a Python script that uses the &lt;code&gt;gpt‑4o‑mini&lt;/code&gt; model to classify a set of example emails, using the tool schema defined in this chapter.&lt;/li&gt;
&lt;li&gt;Debug a broken tool schema by identifying and fixing errors in the JSON syntax or constraints.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: The tasks are designed to be completed independently, and the solutions will not be provided. The goal is to provide a starting point for further exploration and learning.&lt;/p&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/agent-engineering#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent engineering: MCP, subagents and agentic systems
&lt;/h2&gt;

&lt;p&gt;Chapter 2 of 14. New chapter every Sunday morning.&lt;br&gt;
Next: &lt;strong&gt;The context window as a budget&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/agent-engineering" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=agent-engineering" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>aiengineering</category>
      <category>agentengineering</category>
      <category>definingtoolcontracts</category>
    </item>
    <item>
      <title>The blockchain bootcamp · 3. A chain on your own machine</title>
      <dc:creator>Amit chakraborty</dc:creator>
      <pubDate>Mon, 16 Nov 2026 14:45:10 +0000</pubDate>
      <link>https://dev.to/techamit95ch/the-blockchain-bootcamp-3-a-chain-on-your-own-machine-579o</link>
      <guid>https://dev.to/techamit95ch/the-blockchain-bootcamp-3-a-chain-on-your-own-machine-579o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The blockchain bootcamp&lt;/strong&gt; · Chapter 3 of 18 · Blockchain · new chapter every Saturday evening&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;By the end of this chapter:&lt;/strong&gt; Run a local node and get instant, free, disposable transactions to learn on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Emma is a front‑end engineer who has just been handed a ticket to add a “view latest block” widget to the company’s dashboard. The design mock shows the block number, its hash, the timestamp, and a badge that says “finalised”. Emma has never written blockchain‑related code, but she has a working React codebase and a CI pipeline that already ships daily. She knows that to build this feature, she'll need to understand how to interact with a blockchain, but she's not sure where to start. &lt;/p&gt;

&lt;p&gt;She begins by reading the documentation for various blockchain platforms, but quickly becomes overwhelmed by the complexity of the concepts and the sheer amount of information available. She tries to set up a testnet account, but the process is slow and cumbersome, and she's not sure if she's doing it correctly. After several hours of struggling, Emma realizes that she needs a more hands-on approach to learning about blockchain development. She wants to be able to run a local node and get instant, free, disposable transactions to learn on, but she's not sure how to get started.&lt;/p&gt;

&lt;p&gt;The problem is that Emma needs to get a local blockchain environment up and running, but she's not sure what tools to use or how to configure them. She's tried reading the documentation, but it's not giving her the hands-on experience she needs to build her widget. She's wasting time and getting frustrated, and she's starting to worry that she won't be able to deliver the feature on time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;To follow along with this chapter, you'll need to have Node.js (version 16 or higher) installed on your machine, as well as a code editor or IDE of your choice. You should also have a basic understanding of blockchain concepts, such as blocks, chains, and hashes, which were covered in Chapter 1 of this series. Additionally, you should be familiar with the concepts of wallets, keys, and addresses, which were covered in Chapter 2. You can verify that Node.js is installed by running the command &lt;code&gt;node -v&lt;/code&gt; in your terminal, which should output the version number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up a local node
&lt;/h2&gt;

&lt;p&gt;To get started with running a local node, we'll be using a tool called Ganache. Ganache is a popular development tool for Ethereum and other blockchain platforms that allows you to run a local node and get instant, free, disposable transactions. &lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Ganache
&lt;/h3&gt;

&lt;p&gt;To install Ganache, you can use the following command: &lt;code&gt;npm install -g ganache&lt;/code&gt;. This will install Ganache globally on your machine, so you can use it from any directory. Once the installation is complete, you can verify that Ganache is installed by running the command &lt;code&gt;ganache --version&lt;/code&gt;, which should output the version number.&lt;/p&gt;

&lt;h3&gt;
  
  
  Starting the local node
&lt;/h3&gt;

&lt;p&gt;To start the local node, you can use the following command: &lt;code&gt;ganache&lt;/code&gt;. This will start a new local node and output the node's configuration to the console. You should see output that looks 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;Ganache CLI v6.12.2 (ganache-core: 2.13.2)

Available Accounts
==================
(0) 0x742d35Cc6634C0532925a3b844Bc454e4438f44e (100 ETH)
(1) 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc (100 ETH)
(2) 0x4C0759Ce94624A3616d63B457141d7d51Bf5e7B0 (100 ETH)
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output shows the available accounts on the local node, each with a balance of 100 ETH.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it
&lt;/h2&gt;

&lt;p&gt;Now that we have our local node up and running, let's build a simple script to interact with it. We'll use the Web3.js library to connect to the node and send transactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install Web3.js
&lt;/h3&gt;

&lt;p&gt;To install Web3.js, you can use the following command: &lt;code&gt;npm install web3&lt;/code&gt;. This will install the Web3.js library and its dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Connect to the local node
&lt;/h3&gt;

&lt;p&gt;To connect to the local node, you can use the following code:&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;const&lt;/span&gt; &lt;span class="nc"&gt;Web3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'web3'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;web3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Web3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'http://localhost:8545'&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 code creates a new instance of the Web3.js library and connects to the local node at &lt;code&gt;http://localhost:8545&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Send a transaction
&lt;/h3&gt;

&lt;p&gt;To send a transaction, you can use the following code:&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;const&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;accounts&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;recipient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toWei&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ether'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;web3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendTransaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;amount&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code sends a transaction from the first account to the second account, with a value of 1 ETH.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this breaks
&lt;/h2&gt;

&lt;p&gt;There are several ways that this setup can break. Here are a few common issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ganache doesn't start&lt;/strong&gt;: If Ganache doesn't start, you may need to check that you have the latest version installed, or that there are no other processes using the same port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web3.js can't connect&lt;/strong&gt;: If Web3.js can't connect to the local node, you may need to check that the node is running and that the port is correct.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transactions don't send&lt;/strong&gt;: If transactions don't send, you may need to check that the accounts have sufficient balance, or that the gas price is set correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;p&gt;Running a local node and sending transactions has several costs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time&lt;/strong&gt;: Setting up a local node and writing scripts to interact with it can take several hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resources&lt;/strong&gt;: Running a local node requires significant computational resources, including CPU, memory, and disk space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complexity&lt;/strong&gt;: Interacting with a blockchain can be complex and error-prone, especially for developers without prior experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the interview
&lt;/h2&gt;

&lt;p&gt;In an interview, you may be asked questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How do you set up a local blockchain environment?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;A weak answer might be "I use a cloud provider to set up a testnet account."&lt;/li&gt;
&lt;li&gt;A strong answer would be "I use a tool like Ganache to run a local node, and then use a library like Web3.js to interact with it."&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What are some common issues that can arise when running a local node?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;A weak answer might be "I'm not sure, I've never had any issues."&lt;/li&gt;
&lt;li&gt;A strong answer would be "Some common issues include Ganache not starting, Web3.js not being able to connect, and transactions not sending. I would troubleshoot these issues by checking the node's configuration, the port, and the accounts' balances."&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Your tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Set up a local node using Ganache and send a transaction using Web3.js.&lt;/li&gt;
&lt;li&gt;Experiment with different gas prices and see how they affect the transaction.&lt;/li&gt;
&lt;li&gt;Try to break the setup by changing the port or the accounts' balances, and then troubleshoot the issues.&lt;/li&gt;
&lt;li&gt;Write a script to automate the process of sending transactions and monitoring the node's configuration.&lt;/li&gt;
&lt;li&gt;Research other tools and libraries that can be used to interact with a blockchain, such as Ethers.js or Truffle.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Your tasks this week
&lt;/h2&gt;

&lt;p&gt;Do the exercises above before the next chapter. Reading a tutorial and doing&lt;br&gt;
one are different activities and only one of them changes what you can build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuck on any of them?&lt;/strong&gt; Say so — describe what you tried and what happened:&lt;br&gt;
&lt;a href="https://www.amitchakraborty.dev/learn/blockchain-bootcamp#stuck" rel="noopener noreferrer"&gt;tell me where you got stuck&lt;/a&gt;. I read every one, and the questions&lt;br&gt;
that come back more than twice get answered in the next chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The blockchain bootcamp
&lt;/h2&gt;

&lt;p&gt;Chapter 3 of 18. New chapter every Saturday evening.&lt;br&gt;
Next: &lt;strong&gt;Ethereum: accounts, gas and the life of a transaction&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;· &lt;a href="https://www.amitchakraborty.dev/learn/blockchain-bootcamp" rel="noopener noreferrer"&gt;The full syllabus and every chapter so far&lt;/a&gt;&lt;br&gt;
· Subscribers also get the condensed notes for this chapter, the running&lt;br&gt;
  recap of everything the series has covered, and the extended guidance:&lt;br&gt;
  &lt;a href="https://www.amitchakraborty.dev/#newsletter" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Amit Chakraborty — founding engineer and senior architect: React Native, AI and RAG systems, production architecture. &lt;a href="https://www.amitchakraborty.dev?utm_source=curriculum&amp;amp;utm_medium=content&amp;amp;utm_campaign=blockchain-bootcamp" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://linkedin.com/in/devamitch" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devamitch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need this built, reviewed or taught to your team? &lt;a href="https://www.amitchakraborty.dev/#contact" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; or email &lt;a href="mailto:amit@devamit.co.in"&gt;amit@devamit.co.in&lt;/a&gt;. Available for senior and founding engineering roles, consulting and training, remote worldwide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>blockchain</category>
      <category>theblockchainbootcamp</category>
      <category>settingupalocalnode</category>
    </item>
  </channel>
</rss>
