<?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: nedajahanfar</title>
    <description>The latest articles on DEV Community by nedajahanfar (@nedajahanfar).</description>
    <link>https://dev.to/nedajahanfar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1236051%2F553e2426-4f06-454e-bbf6-d5c76cbff3f5.jpeg</url>
      <title>DEV Community: nedajahanfar</title>
      <link>https://dev.to/nedajahanfar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nedajahanfar"/>
    <language>en</language>
    <item>
      <title>Understanding WordPress Basics Before You Start</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Thu, 08 Jan 2026 21:58:28 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/understanding-wordpress-basics-before-you-start-g08</link>
      <guid>https://dev.to/nedajahanfar/understanding-wordpress-basics-before-you-start-g08</guid>
      <description>&lt;p&gt;So you decided you want to create a website and put it on the internet.&lt;br&gt;
Is the only way to do that by talking code to a computer?&lt;br&gt;
&lt;em&gt;No&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Today we also have GUIs (graphical user interfaces) for this, and WordPress was made exactly for that reason.&lt;/p&gt;

&lt;p&gt;Around 42–48% of all websites in the world are built with WordPress, which already tells you a lot about how powerful and accessible it is.&lt;/p&gt;

&lt;p&gt;Content types in WordPress:&lt;/p&gt;

&lt;p&gt;In WordPress, there are &lt;strong&gt;three&lt;/strong&gt; main types of content you can give to a website:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Blog posts (Posts)
&lt;/h2&gt;

&lt;p&gt;It also has a dedicated button in the WordPress dashboard.&lt;/p&gt;

&lt;p&gt;It’s meant for:&lt;br&gt;
blogs&lt;br&gt;
articles&lt;br&gt;
long text-based content&lt;br&gt;
content that grows over time&lt;/p&gt;

&lt;p&gt;Blog posts are usually managed and enhanced by blog-focused plugins.&lt;br&gt;
One popular plugin used to extend content structures is &lt;strong&gt;JetEngine&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.Pages (what you visually build)
&lt;/h2&gt;

&lt;p&gt;Pages are more similar to what developers imagine when they think about structure.&lt;/p&gt;

&lt;p&gt;They are:&lt;br&gt;
visual layouts&lt;br&gt;
sections + components&lt;br&gt;
built using page builders&lt;/p&gt;

&lt;p&gt;The most famous one is &lt;strong&gt;Elementor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Pages have their own section in the dashboard, and you usually use them for:&lt;br&gt;
Home&lt;br&gt;
About&lt;br&gt;
Services&lt;br&gt;
Contact&lt;br&gt;
Landing pages&lt;/p&gt;

&lt;p&gt;Think of pages as designed layouts, not streams of content.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Custom Content Types (CCT / CPT)
&lt;/h2&gt;

&lt;p&gt;This is where WordPress becomes more powerful.&lt;/p&gt;

&lt;p&gt;Custom Content Types are structured content, similar to data stored in tables:&lt;br&gt;
products&lt;br&gt;
events&lt;br&gt;
courses&lt;br&gt;
team members&lt;br&gt;
portfolio items&lt;/p&gt;

&lt;p&gt;You can compare them to rows in a database table, where each item has fields (title, price, image, date, etc.).&lt;/p&gt;

&lt;p&gt;They are not “pages” and not “blogs”, but reusable structured data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Themes: the foundation of your site
&lt;/h2&gt;

&lt;p&gt;When you create a site, the first thing you choose is a &lt;strong&gt;theme&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A theme decides:&lt;/p&gt;

&lt;p&gt;typography&lt;br&gt;
spacing&lt;br&gt;
base layout&lt;br&gt;
general visual rules&lt;/p&gt;

&lt;p&gt;Some themes are very flexible, like Astra, which means:&lt;/p&gt;

&lt;p&gt;easy to customize&lt;br&gt;
works well with page builders&lt;br&gt;
doesn’t lock you into a rigid structure&lt;/p&gt;

&lt;p&gt;Other themes are more opinionated, meaning:&lt;br&gt;
harder to modify&lt;br&gt;
more constraints&lt;br&gt;
faster setup but less freedom&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Choose your theme wisely, because it affects everything that comes after.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Templates (often confused, very important)
&lt;/h2&gt;

&lt;p&gt;After themes, we arrive at templates.&lt;/p&gt;

&lt;p&gt;There are two types of templates:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Templates you create yourself&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These are templates you build using Elementor (or another page builder).&lt;br&gt;
They are basically reusable layouts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Inserted / imported templates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These come from:&lt;br&gt;
template kits&lt;br&gt;
external libraries...&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important rule:&lt;br&gt;
Once you create a page using a specific template, you can’t just switch the template.&lt;br&gt;
You usually need to create a new page if you want a different structure.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Templates are basically sets of components, reused across pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plugins (extra powers):
&lt;/h2&gt;

&lt;p&gt;Plugins are how you add functionality to WordPress.&lt;/p&gt;

&lt;p&gt;If you come from a coding background:&lt;br&gt;
plugins are like libraries&lt;br&gt;
they extend what WordPress can do&lt;/p&gt;

&lt;p&gt;Too many plugins is not good:&lt;br&gt;
slower site&lt;br&gt;
conflicts&lt;br&gt;
harder maintenance&lt;/p&gt;

&lt;p&gt;Some very famous plugins:&lt;br&gt;
WooCommerce → adds an entire e-commerce system&lt;br&gt;
Elementor → visual page builder&lt;br&gt;
Security plugins → protect your site&lt;br&gt;
SEO plugins → help search engines understand your content&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Each plugin adds power, but also responsibility.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Final thought?&lt;br&gt;
WordPress lets you build websites without writing code, but understanding how it works makes a huge difference.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>programming</category>
      <category>woocommerce</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Episode 1: Arrays — The Hidden Logic Behind How Your Code Remembers</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Sun, 09 Nov 2025 21:45:44 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/episode-1-arrays-the-hidden-logic-behind-how-your-code-remembers-55o7</link>
      <guid>https://dev.to/nedajahanfar/episode-1-arrays-the-hidden-logic-behind-how-your-code-remembers-55o7</guid>
      <description>&lt;p&gt;&lt;strong&gt;What Is an Array?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In short, an array is a sequence of values stored contiguously (back-to-back) in memory.&lt;br&gt;
All values in the array must be of the same data type (e.g., integers, characters, etc.).&lt;/p&gt;

&lt;p&gt;When an array is created, the computer allocates a continuous block of memory large enough for all its elements.&lt;br&gt;
Unlike individual variables — which might be placed randomly in memory — array elements are stored side by side.&lt;/p&gt;

&lt;p&gt;For example, an array of three integers will occupy 12 bytes in total (since an integer is typically 4 bytes), with the four bytes for each integer stored immediately next to the next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Arrays Are Zero-Indexed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When an array is created, the computer:&lt;/p&gt;

&lt;p&gt;Allocates a contiguous block of memory large enough for all elements.&lt;br&gt;
Stores the address of the first element (called the base address).&lt;br&gt;
The variable name (e.g., numbers) doesn’t hold all the elements — it only holds this starting address.&lt;/p&gt;

&lt;p&gt;So when you write:&lt;/p&gt;

&lt;p&gt;let numbers = [10, 20, 30];&lt;/p&gt;

&lt;p&gt;The computer knows:&lt;/p&gt;

&lt;p&gt;The base address (say, 0x1000) points to the first element (10).&lt;/p&gt;

&lt;p&gt;Each integer takes 4 bytes.&lt;/p&gt;

&lt;p&gt;Therefore:&lt;/p&gt;

&lt;p&gt;numbers[0] → address 0x1000&lt;br&gt;&lt;br&gt;
numbers[1] → address 0x1004&lt;br&gt;&lt;br&gt;
numbers[2] → address 0x1008&lt;/p&gt;

&lt;p&gt;This is why arrays start at index 0 —&lt;br&gt;
to access any element, the computer uses the formula:&lt;/p&gt;

&lt;p&gt;address = base_address + (index × size_of_each_element)&lt;/p&gt;

&lt;p&gt;If indexing started at 1, every lookup would require an extra subtraction (index - 1) —&lt;br&gt;
an unnecessary calculation. Zero-based indexing keeps memory access clean and direct.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When and Why to Use Arrays&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Arrays are one of the most common choices for storing data — but when are they actually the best choice?&lt;/p&gt;

&lt;p&gt;In general, there are four main operations you might want to perform on a dataset:&lt;/p&gt;

&lt;p&gt;Insertion (adding a new item)&lt;/p&gt;

&lt;p&gt;Deletion (removing an item)&lt;/p&gt;

&lt;p&gt;Selection / Access (finding or reading an item)&lt;/p&gt;

&lt;p&gt;Sorting (reordering items)&lt;/p&gt;

&lt;p&gt;Let’s see how arrays handle each of these, both in the best and worst cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deletion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It depends on where you delete from:&lt;/p&gt;

&lt;p&gt;From the end: very efficient → O(1)&lt;br&gt;
The computer simply forgets the last item — no need to move anything.&lt;/p&gt;

&lt;p&gt;From the beginning or middle: slower → O(n)&lt;br&gt;
Imagine removing the first book from a shelf — every other book needs to shift one position left to fill the empty spot.&lt;/p&gt;

&lt;p&gt;So deleting the first element is the worst case since the program has to move n–1 items.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insertion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Again, position matters:&lt;/p&gt;

&lt;p&gt;Add to the end: easy → O(1)&lt;br&gt;
The computer just adds one more element to the next empty slot.&lt;/p&gt;

&lt;p&gt;Add to the beginning or middle: expensive → O(n)&lt;br&gt;
All the other items need to shift one index to make room.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Selection (Accessing or Searching)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you already know the index: instant → O(1)&lt;br&gt;
Arrays shine here — the address formula lets you jump directly to any element.&lt;/p&gt;

&lt;p&gt;If you don’t know the index: you must look through all items → O(n)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sorting Is Special..&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While most array operations have fixed theoretical costs defined by the structure itself&lt;br&gt;
(e.g., deletion ≈ O(n), insertion ≈ O(n)), sorting is unique because your algorithm choice can change its Big O class entirely —&lt;br&gt;
from O(n²) with simple methods like Bubble Sort to O(n log n) with smarter ones like Merge Sort.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Sorting an array with Bubble Sort → O(n²)&lt;br&gt;
Sorting the same array with Merge Sort → O(n log n)&lt;br&gt;
Here, the data is the same, but the algorithm changes the efficiency.&lt;/p&gt;

&lt;p&gt;Why?&lt;br&gt;
Because sorting isn’t an inherent feature of arrays — it’s an operation applied externally using an algorithm.&lt;br&gt;
In contrast, operations like “add” or “access” are built into how arrays work.&lt;/p&gt;

&lt;p&gt;LeetCode Example — Insertion in Arrays&lt;/p&gt;

&lt;p&gt;Problem: LeetCode #1389 — Create Target Array in the Given Order&lt;/p&gt;

&lt;p&gt;Task:&lt;br&gt;
Given two arrays of integers, nums and index, create a target array following these rules:&lt;/p&gt;

&lt;p&gt;Start with an empty array.&lt;/p&gt;

&lt;p&gt;For each i, insert nums[i] at position index[i] inside the target array.&lt;/p&gt;

&lt;p&gt;Repeat until all elements are processed.&lt;/p&gt;

&lt;p&gt;It is guaranteed that all insertions will be valid.&lt;/p&gt;

&lt;p&gt;As mentioned earlier, adding to the end of an array (like using .push() in JavaScript) is fast — O(1).&lt;br&gt;
But inserting elements at random positions forces the computer to shift all other elements, which costs O(n) per insertion.&lt;/p&gt;

&lt;p&gt;Since this problem requires doing that n times, the total cost becomes O(n²).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step-by-Step Logic&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When thinking through the solution:&lt;/p&gt;

&lt;p&gt;Loop through the index array from start to end.&lt;/p&gt;

&lt;p&gt;For each index i, find the corresponding number nums[i].&lt;/p&gt;

&lt;p&gt;Insert nums[i] into the target array at position index[i].&lt;/p&gt;

&lt;p&gt;If that position is already occupied, shift all following elements right.&lt;/p&gt;

&lt;p&gt;Translating That Into Code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function arrayMaker(index, nums) {&lt;br&gt;
  let target = [];&lt;br&gt;
  for (let i = 0; i &amp;lt; index.length; i++) {&lt;br&gt;
    target.splice(index[i], 0, nums[i]);&lt;br&gt;
  }&lt;br&gt;
  return target;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The .splice() method in JavaScript handles insertion directly.&lt;/p&gt;

&lt;p&gt;It takes three arguments:&lt;/p&gt;

&lt;p&gt;The index where to insert.&lt;/p&gt;

&lt;p&gt;How many elements to delete (here, 0).&lt;/p&gt;

&lt;p&gt;The new element to insert.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;target.splice(2, 0, 5);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Inserts 5 at position 2, shifting everything after it to the right.&lt;/p&gt;

&lt;p&gt;What We Learned&lt;/p&gt;

&lt;p&gt;Inserting at the end of an array → O(1)&lt;/p&gt;

&lt;p&gt;Inserting in the middle or beginning → O(n)&lt;/p&gt;

&lt;p&gt;Doing this repeatedly → O(n²)&lt;/p&gt;

&lt;p&gt;Arrays are great for reading and appending data,&lt;br&gt;
but repeated insertions at random positions make them inefficient —&lt;br&gt;
that’s where other data structures like linked lists come in.&lt;/p&gt;

&lt;p&gt;Deletion Example — LeetCode #27&lt;/p&gt;

&lt;p&gt;Problem: Remove Element&lt;/p&gt;

&lt;p&gt;Given an integer array nums and a value val,&lt;br&gt;
remove all occurrences of val in-place and return the new length of the array.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function removeElement(nums, val) {&lt;br&gt;
  let k = 0;&lt;br&gt;
  for (let i = 0; i &amp;lt; nums.length; i++) {&lt;br&gt;
    if (nums[i] != val) {&lt;br&gt;
      nums[k] = nums[i];&lt;br&gt;
      k++;&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
  return k;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Explanation&lt;/p&gt;

&lt;p&gt;We use two pointers:&lt;/p&gt;

&lt;p&gt;i → reads each element&lt;/p&gt;

&lt;p&gt;k → marks the position where the next valid element should go&lt;/p&gt;

&lt;p&gt;If the current value isn’t equal to val, we copy it to nums[k] and move k forward.&lt;br&gt;
This overwrites unwanted values as we go — deleting in-place without creating a new array.&lt;/p&gt;

&lt;p&gt;Physical deletion (using .splice() or .slice() repeatedly) is not optimal,&lt;br&gt;
because each deletion shifts all following elements one step left —&lt;br&gt;
making it O(n²) when done multiple times.&lt;/p&gt;

&lt;p&gt;Instead, overwriting valid elements keeps it O(n) and efficient.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;LeetCode #1365 — Counting Smaller Numbers&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Problem: How Many Numbers Are Smaller Than the Current Number&lt;/p&gt;

&lt;p&gt;We return, for each number, how many others are smaller than it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var smallerNumbersThanCurrent = function(nums) {&lt;br&gt;
  let output = [];&lt;br&gt;
  for (let i = 0; i &amp;lt; nums.length; i++) {&lt;br&gt;
    let count = 0;&lt;br&gt;
    for (let j = 0; j &amp;lt; nums.length; j++) {&lt;br&gt;
      if (nums[i] &amp;gt; nums[j]) count++;&lt;br&gt;
    }&lt;br&gt;
    output[i] = count;&lt;br&gt;
  }&lt;br&gt;
  return output;&lt;br&gt;
};&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Explanation&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This approach compares each element with every other element.&lt;br&gt;
If nums[i] &amp;gt; nums[j], we increase the counter.&lt;br&gt;
The result shows how many numbers are smaller than each one.&lt;/p&gt;

&lt;p&gt;This works fine for small arrays but is O(n²) in complexity.&lt;/p&gt;

&lt;p&gt;We can reduce it to O(n log n) using sorting and mapping —&lt;/p&gt;

&lt;p&gt;Now, let’s move to a different array problem that highlights another concept: selection.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;LeetCode #448 — Find All Numbers Disappeared in an Array&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Step 1 — Brute Force&lt;/p&gt;

&lt;p&gt;Compare each number against all possible values 1..n.&lt;br&gt;
Works, but too slow → O(n²).&lt;/p&gt;

&lt;p&gt;Step 2 — Smarter (Using a Set)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function missingNums(nums) {&lt;br&gt;
  let max = nums.length;&lt;br&gt;
  let fullArray = Array.from({ length: max }, (_, i) =&amp;gt; i + 1);&lt;br&gt;
  let set = new Set(nums);&lt;br&gt;
  let missing = fullArray.filter(num =&amp;gt; !set.has(num));&lt;br&gt;
  return missing;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
How it works:&lt;/p&gt;

&lt;p&gt;Array.from({ length: max }, (_, i) =&amp;gt; i + 1) creates [1, 2, 3, ..., n].&lt;/p&gt;

&lt;p&gt;new Set(nums) removes duplicates and enables O(1) lookups.&lt;/p&gt;

&lt;p&gt;.filter() keeps only numbers missing from the Set.&lt;/p&gt;

&lt;p&gt;Time: O(n)&lt;br&gt;
Space: O(n)&lt;/p&gt;

&lt;p&gt;Step 3 — Can You Still Do It Better?&lt;/p&gt;

&lt;p&gt;Well, yes — you can make this even more efficient,&lt;br&gt;
reduce the time complexity, and avoid using extra space.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Let’s see how&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;`function DisappearedNums(nums) {&lt;br&gt;
  let target = [];&lt;/p&gt;

&lt;p&gt;for (let i = 0; i &amp;lt; nums.length; i++) {&lt;br&gt;
    let index = Math.abs(nums[i]) - 1;&lt;br&gt;
    if (nums[index] &amp;gt; 0) {&lt;br&gt;
      nums[index] = -nums[index];&lt;br&gt;
    }&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;for (let i = 0; i &amp;lt; nums.length; i++) {&lt;br&gt;
    if (nums[i] &amp;gt; 0) {&lt;br&gt;
      target.push(i + 1);&lt;br&gt;
    }&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;return target;&lt;br&gt;
}`&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s Happening Here?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you have a classroom full of students and want to see who’s absent.&lt;br&gt;
Each student goes and marks their seat to show they attended.&lt;br&gt;
Because arrays are zero-based, each student marks the seat at value - 1.&lt;/p&gt;

&lt;p&gt;At the end, we check which seats remain unmarked (still positive) —&lt;br&gt;
those correspond to the absent students.&lt;/p&gt;

&lt;p&gt;This approach cleverly uses the same array as its own tracker,&lt;br&gt;
so no extra arrays or Sets are needed.&lt;/p&gt;

&lt;p&gt;Time Complexity: O(n)&lt;br&gt;
Space Complexity: O(1)&lt;/p&gt;

&lt;p&gt;This is one of the most efficient ways to solve the problem.&lt;br&gt;
It shows how the right data structure, combined with the right algorithm,&lt;br&gt;
can dramatically improve performance :)&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>javascript</category>
      <category>algorithms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Everything You Need to Know to Start Your Way as a Programmer</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Wed, 05 Nov 2025 18:10:44 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/everything-you-need-to-know-to-start-your-way-as-a-programmer-1p01</link>
      <guid>https://dev.to/nedajahanfar/everything-you-need-to-know-to-start-your-way-as-a-programmer-1p01</guid>
      <description>&lt;p&gt;&lt;strong&gt;Finding Your Starting Point:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding a solid way to start programming can feel overwhelming.&lt;br&gt;
You get lost in definitions, frameworks, and tutorials — and it’s hard to know where to begin.&lt;/p&gt;

&lt;p&gt;But if we strip everything down to the most important foundation, one concept stands above all others: the &lt;strong&gt;algorithm&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What Is an Algorithm?&lt;/p&gt;

&lt;p&gt;An algorithm is simply a set of steps used to solve a problem or create something.&lt;br&gt;
It’s the sequence of actions you take to reach a result.&lt;/p&gt;

&lt;p&gt;You use algorithms every day — even outside coding.&lt;/p&gt;

&lt;p&gt;Making coffee: boil water → add coffee → pour → stir &lt;br&gt;
Sorting your books: compare titles → arrange alphabetically&lt;/p&gt;

&lt;p&gt;That’s all an algorithm is — a structured way to reach a goal.&lt;/p&gt;

&lt;p&gt;What Makes a “Good” Algorithm?&lt;/p&gt;

&lt;p&gt;_Not all algorithms are equal.&lt;br&gt;
_Some take more time or use more memory than others.&lt;/p&gt;

&lt;p&gt;A good algorithm is one that:&lt;/p&gt;

&lt;p&gt;Solves the problem correctly &lt;br&gt;
Uses the least possible time &lt;br&gt;
Uses the least possible space &lt;/p&gt;

&lt;p&gt;So how can we measure that?&lt;br&gt;
That’s where Big O Notation comes in.&lt;/p&gt;

&lt;p&gt;Big O Notation — Measuring Efficiency:&lt;/p&gt;

&lt;p&gt;Big O tells us how the performance of an algorithm changes as the input grows.&lt;br&gt;
It focuses on the worst-case scenario: how long (or how much memory) your code might take for n elements.&lt;/p&gt;

&lt;p&gt;Here are the most common types:&lt;/p&gt;

&lt;p&gt;O(1) =&amp;gt; Constant =&amp;gt; Always takes the same time, no matter the input size. (Best case!)&lt;/p&gt;

&lt;p&gt;O(log n) =&amp;gt; Logarithmic =&amp;gt;Still very efficient — time increases slowly as input grows.&lt;/p&gt;

&lt;p&gt;O(n) =&amp;gt; Linear =&amp;gt; Time grows in proportion to input size.&lt;/p&gt;

&lt;p&gt;O(n²) =&amp;gt; Quadratic =&amp;gt; Much slower — time grows dramatically as input increases.&lt;/p&gt;

&lt;p&gt;Think of it like this:&lt;/p&gt;

&lt;p&gt;Searching in a sorted list (binary search) → O(log n)&lt;br&gt;
Looping through every item once → O(n)&lt;br&gt;
Double nested loops → O(n²)&lt;/p&gt;

&lt;p&gt;Algorithms and Data Structures:&lt;/p&gt;

&lt;p&gt;Algorithms work on data — but the way we store and organize that data matters too.&lt;br&gt;
That’s where data structures come in.&lt;/p&gt;

&lt;p&gt;Different data structures (arrays, stacks, queues, linked lists, trees, etc.) are optimized for different operations.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;Searching through an array might take O(n)&lt;br&gt;
Searching through a hash table can be O(1)&lt;/p&gt;

&lt;p&gt;Choosing the right structure can dramatically change performance.&lt;/p&gt;

&lt;p&gt;What’s Next?&lt;/p&gt;

&lt;p&gt;In this series, we’ll explore:&lt;br&gt;
The most important data structures&lt;br&gt;
Their time and space complexities (Big O)&lt;br&gt;
Real LeetCode problems related to each topic&lt;br&gt;
Pseudocode examples to understand how they work&lt;/p&gt;

&lt;p&gt;By the end, you’ll not only know what each structure does — you’ll know when and why to use it.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>newbie</category>
      <category>frontendchallenge</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>What Is a Memory Leak?</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Tue, 04 Nov 2025 09:41:29 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/what-is-a-memory-leak-5epo</link>
      <guid>https://dev.to/nedajahanfar/what-is-a-memory-leak-5epo</guid>
      <description>&lt;p&gt;Anything that runs on your computer or phone needs memory to work.&lt;br&gt;
On a computer, we have two main types of memory:&lt;/p&gt;

&lt;p&gt;RAM (Random Access Memory) – temporary, fast, used while apps are running.&lt;br&gt;
Hard drive (or SSD) – permanent storage for files and apps.&lt;/p&gt;

&lt;p&gt;When your RAM gets full, your system may start using the hard drive as slower “virtual memory.”&lt;br&gt;
On mobile devices, it’s similar — there’s RAM (for running apps) and internal storage or memory card (for saving files).&lt;/p&gt;

&lt;p&gt;How Memory Works in Apps:&lt;/p&gt;

&lt;p&gt;When you open an app, it loads images, data, and resources into RAM so it can run quickly.&lt;br&gt;
In an ideal world, when you close the app — or move from one screen to another — it should free up the memory it used, since it no longer needs that data.&lt;/p&gt;

&lt;p&gt;But that’s not always the case...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is a Memory Leak?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you invite a friend to stay at your house for one night — but she decides to live in your room forever.&lt;br&gt;
That’s what a memory leak is.&lt;/p&gt;

&lt;p&gt;The app borrowed some memory temporarily, but instead of letting it go, it keeps holding onto it even when it’s no longer needed.&lt;/p&gt;

&lt;p&gt;Over time, the app’s memory usage keeps growing.&lt;br&gt;
Eventually:&lt;/p&gt;

&lt;p&gt;The app becomes slower&lt;/p&gt;

&lt;p&gt;The phone heats up&lt;/p&gt;

&lt;p&gt;Or it crashes with “out of memory” errors&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why It Happens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Memory leaks usually occur when developers forget to:&lt;/p&gt;

&lt;p&gt;Remove event listeners&lt;/p&gt;

&lt;p&gt;Clear timers or intervals&lt;/p&gt;

&lt;p&gt;Release references to images, arrays, or objects no longer needed&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;useEffect(() =&amp;gt; {&lt;br&gt;
  const interval = setInterval(fetchData, 5000);&lt;br&gt;
  return () =&amp;gt; clearInterval(interval); // cleanup to prevent leaks&lt;br&gt;
}, []);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Or when large objects are kept in memory:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const bigImage = loadImage('banner.png');&lt;br&gt;
// ... app closes, but bigImage is still referenced somewhere&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How Developers Prevent It:&lt;/p&gt;

&lt;p&gt;Developers use profiling tools to detect leaks — like:&lt;/p&gt;

&lt;p&gt;Android Studio Profiler&lt;/p&gt;

&lt;p&gt;LeakCanary&lt;/p&gt;

&lt;p&gt;Flipper (React Native)&lt;/p&gt;

&lt;p&gt;They also:&lt;/p&gt;

&lt;p&gt;Clean up listeners and intervals in useEffect&lt;/p&gt;

&lt;p&gt;Release images and cache data properly&lt;/p&gt;

&lt;p&gt;Move heavy data to the server, not the client app&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In Short:&lt;br&gt;
A memory leak is when an app refuses to let go of the memory it once borrowed.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>ram</category>
      <category>performance</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Astro: A Different Kind of Web Framework</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Fri, 22 Aug 2025 19:46:05 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/astro-a-different-kind-of-web-framework-125k</link>
      <guid>https://dev.to/nedajahanfar/astro-a-different-kind-of-web-framework-125k</guid>
      <description>&lt;p&gt;Astro first appeared in 2021 as a new kind of frontend framework, built with a very specific goal: giving developers complete control over how their websites are rendered.&lt;/p&gt;

&lt;p&gt;Unlike many frameworks that push you into either SSR (server-side rendering) or CSR (client-side rendering / SPA), Astro lets you mix and match. This flexibility makes it especially powerful for content-heavy sites—think blogs, documentation, e-commerce catalogs—where most of the page is static but certain parts (like search bars, filters, or comments) still need to be dynamic.&lt;/p&gt;

&lt;p&gt;The Island Architecture:&lt;br&gt;
Astro’s secret sauce is what it calls “Island Architecture.”&lt;br&gt;
Most of your site is rendered on the server by default (fast, SEO-friendly, lightweight).&lt;/p&gt;

&lt;p&gt;But individual “islands” (small, interactive components) can be hydrated on the client only when needed.&lt;/p&gt;

&lt;p&gt;This means you can have a mostly static site with a React search bar, a Vue shopping cart, and maybe a SolidJS widget—all living together on the same page.&lt;/p&gt;

&lt;p&gt;Framework Flexibility:&lt;br&gt;
Astro is framework-agnostic. You can use React, Vue, Svelte, Solid, Preact, Lit, or just plain HTML/JS. Or mix them all. That’s why Astro is often called a flexible framework: it doesn’t lock you in.&lt;br&gt;
Each component you write can be given a client: directive to control when (and if) it loads on the browser:&lt;/p&gt;

&lt;p&gt;client:load → load immediately.&lt;/p&gt;

&lt;p&gt;client:visible → load only when it comes into view.&lt;/p&gt;

&lt;p&gt;client:idle → wait until the browser is idle.&lt;/p&gt;

&lt;p&gt;client:only="react" → load only in React, ignoring server-side rendering.&lt;/p&gt;

&lt;p&gt;If you don’t specify anything, Astro takes a server-first approach—it behaves like SSR, sending down plain HTML without extra JavaScript.&lt;/p&gt;

&lt;p&gt;File-Based Routing:&lt;/p&gt;

&lt;p&gt;Astro also keeps things simple with file-based routing:&lt;br&gt;
Put your pages inside the src/pages folder.&lt;br&gt;
A file like about.astro becomes /about.&lt;br&gt;
A folder with index.astro maps to /foldername.&lt;br&gt;
Bracketed names (like [slug].astro) handle dynamic routes.&lt;/p&gt;

&lt;p&gt;Inside each .astro file, the structure is straightforward:&lt;br&gt;
Frontmatter (the top script block) → where you do imports and API calls.&lt;br&gt;
Markup (HTML) → the actual page structure.&lt;br&gt;
Style → scoped to that page or component.&lt;br&gt;
Script → optional client-side JavaScript.&lt;/p&gt;

&lt;p&gt;This encourages clean separation of logic and design.&lt;/p&gt;

&lt;p&gt;Analogy :))&lt;/p&gt;

&lt;p&gt;Think of Astro like building a theme park:&lt;/p&gt;

&lt;p&gt;Most rides (pages) are already built and ready (static content rendered on the server).&lt;br&gt;
But a few attractions (interactive islands) only start running when visitors walk up to them (hydrated when needed).&lt;br&gt;
You, the architect, decide which rides are permanent and which ones only spin up when someone presses the button.&lt;/p&gt;

</description>
      <category>astro</category>
      <category>development</category>
      <category>webdev</category>
      <category>newbie</category>
    </item>
    <item>
      <title>Everything You Need to Know About Web Rendering</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Sun, 29 Jun 2025 07:30:39 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/everything-you-need-to-know-about-web-rendering-1h1c</link>
      <guid>https://dev.to/nedajahanfar/everything-you-need-to-know-about-web-rendering-1h1c</guid>
      <description>&lt;p&gt;How do we see the code we write show up on our screens?&lt;br&gt;
What turns raw data and logic into buttons we can tap, pages we can scroll, and animations we can feel?&lt;/p&gt;

&lt;p&gt;This process is called rendering, rendering is the process of transforming data and code into HTML that an end-user can see and interact with. This crucial step can happen in a few different places:&lt;/p&gt;

&lt;p&gt;On the server: Where the website's data and logic live.&lt;br&gt;
In the browser: On the user's device.&lt;/p&gt;

&lt;p&gt;It can also be done all at once or partially, and each approach comes with its own trade-offs concerning user experience, performance, and developer experience.Now, let's explore the 10 rendering patterns for web apps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static Website:&lt;/strong&gt;&lt;br&gt;
Imagine you're preparing for a big event and need to send out invitations. With a static website, you create all your invitations (web pages) in advance, print them out, and then have them ready to hand over whenever someone asks for one. These pre-made pages are then uploaded as simple files to a storage space in the cloud, and a domain name points to them.&lt;br&gt;
•&lt;br&gt;
How it works: All web pages are put together upfront and uploaded as fixed, static files.&lt;br&gt;
•&lt;br&gt;
Analogy: It's like having a stack of pre-printed brochures for your business. When a customer walks in, you just hand them a brochure. You don't print a new one every time someone asks; it's already done.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Works great, even today.&lt;br&gt;
Simple to manage.&lt;br&gt;
Low-cost hosting.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
Not ideal for websites where data changes frequently.&lt;br&gt;
Only suitable for very basic websites without a lot of interactivity or dynamic content.&lt;br&gt;
Frameworks: Hugo, 11t, and Jekyll.&lt;/p&gt;

&lt;p&gt;Best for: Personal blogs, portfolios, documentation sites, marketing landing pages that rarely change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-Page Applications (MPA):&lt;/strong&gt;&lt;br&gt;
Think of a bustling custom bakery. Every time a customer places an order for a cake (representing a page request), the baker (the server) dynamically bakes a fresh cake from scratch based on that specific order, putting together the ingredients (HTML and data) right then and there. If you click on a new link, it's like ordering a completely new, freshly baked cake, leading to a full-page reload.&lt;br&gt;
•&lt;br&gt;
How it works: HTML and data are assembled dynamically on a server whenever a browser sends a request. The appearance of the website can change as the underlying data changes.&lt;br&gt;
•&lt;br&gt;
Analogy: Visiting amazon.com is a classic example. Every time you click a link, you get a new, dynamically generated page from their servers, like ordering a completely new dish at a restaurant where each order is prepared fresh.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Handles dynamic data effectively.&lt;br&gt;
Many of the biggest web apps still use this approach.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
The "full page reload" on every URL can feel "clunky" compared to smoother app experiences.&lt;br&gt;
Can take at least a few hundred milliseconds or more for the page to render.&lt;br&gt;
•&lt;br&gt;
Frameworks/CMS: Ruby on Rails, Django, Laravel, and WordPress.&lt;/p&gt;

&lt;p&gt;Best for: Large traditional websites like e-commerce (Amazon), forums, corporate portals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single Page Application (SPA):&lt;/strong&gt;&lt;br&gt;
Imagine an art studio with a single, large, blank canvas. When you enter, the artist (JavaScript) immediately starts painting the entire scene directly onto that one canvas, pulling in details and colors as needed. If you want to see a different scene, the artist doesn't get a new canvas; they simply paint over or adjust the existing one, making the transitions feel very smooth and instantaneous, all happening within that one "page" in the studio.&lt;br&gt;
•&lt;br&gt;
How it works: All user interface (UI) rendering occurs within the user's browser. It starts with one basic HTML page as a "shell," then JavaScript executes to render the UI and fetch any necessary data. Even with multiple "routes" or sections, these are updated by JavaScript in the browser, not by pointing to a new server page.&lt;br&gt;
•&lt;br&gt;
Analogy: Think of an interactive map application. You open it once, and then you can zoom, pan, search for locations, and get directions—all without the page ever reloading. All interactions happen seamlessly within that single map view.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Feels instantaneous to the end user.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
Requires a large JavaScript bundle, which can make the initial page load quite slow.&lt;br&gt;
Search engines, even today, struggle to understand content on dynamic routes, which is bad for SEO (Search Engine Optimization) or sharing content on social media.&lt;br&gt;
•&lt;br&gt;
Frameworks: AngularJS and React.&lt;/p&gt;

&lt;p&gt;Best for: Web apps with rich interactivity—dashboards, chats, to-do apps, calendars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server-Side Rendering (SSR):&lt;/strong&gt;&lt;br&gt;
This is like a hybrid newspaper delivery service. The very first time you request the newspaper (the initial page load), a complete physical paper is printed and delivered directly to your door (the server renders everything dynamically). After that initial delivery, any subsequent updates, interactive elements, or navigation within the digital version of the newspaper are handled by a small, interactive app on your phone (client-side JavaScript takes over), giving you a smooth, app-like experience without needing a new physical paper for every small change.&lt;br&gt;
•&lt;br&gt;
How it works: HTML and data are rendered on the server for the initial page load. After this, client-side JavaScript "hydrates" the page, allowing it to function like a Single Page Application (SPA). It's a "best of both worlds" approach aiming for good initial load performance and a smooth interactive experience afterward.&lt;br&gt;
•&lt;br&gt;
Analogy: Imagine a restaurant that pre-cooks the main dish for efficiency (server-side render) so it's ready quickly when you sit down. But once it's served, you can add sauces, garnishes, and interact with the meal yourself (client-side JavaScript takes over) without sending it back to the kitchen.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Offers the "best of both worlds" by providing a fast initial page load from the server while still enabling an app-like SPA experience afterward.&lt;br&gt;
Likely the most popular rendering strategy today.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
Requires an actual server to run, which costs money.&lt;br&gt;
On the initial page load, the app might feel "frozen" while the JavaScript is still executing to "take over" the rendering process (hydration).&lt;br&gt;
•&lt;br&gt;
Frameworks: Next.js, Nuxt, and SvelteKit (often called meta frameworks).&lt;/p&gt;

&lt;p&gt;Best for: News sites, blogs, SaaS apps that need fast first paint + dynamic content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Static Site Generation (SSG):&lt;/strong&gt;&lt;br&gt;
Think of a highly organized, pre-made meal service. All your meals (web pages) are cooked and perfectly packaged (rendered as HTML) in advance at a central kitchen (during the "build" process). When you order one, it's just delivered directly to you from this pre-made stock. But once you have it, you can heat it up, add sauces, or customize it within your own kitchen (JavaScript hydrates after the initial page load to add interactivity).&lt;br&gt;
•&lt;br&gt;
How it works: All HTML is rendered in advance, similar to static websites. However, like SSR, it then "hydrates" to JavaScript after the initial page load to provide an app-like experience. Websites using this approach are often called Jamstack sites.&lt;br&gt;
•&lt;br&gt;
Analogy: Building a LEGO set. All the pieces (HTML) are manufactured and sorted beforehand. When you get the box, everything is ready. You assemble the basic structure (initial static page), and then you can add motors or interactive elements to make parts move (hydration with JavaScript).&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Combines the simplicity and low-cost hosting of a static site with the app-like experience of an SPA.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
You have to redeploy your entire site whenever the underlying data changes.&lt;br&gt;
Similar to SSR, the app might feel "frozen" during the initial page load while JavaScript executes for hydration.&lt;br&gt;
•&lt;br&gt;
Frameworks: Typically built by the same meta frameworks as SSR, such as Next.js, Nuxt, and SvelteKit.&lt;/p&gt;

&lt;p&gt;Best for: Blogs, documentation, small e-commerce catalogs with infrequent updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incremental Static Regeneration (ISR):&lt;/strong&gt;&lt;br&gt;
Imagine a very popular coffee shop that pre-brews large batches of coffee (like a static site). Most of the time, they just pour from what's already made (the cached content), which is incredibly fast. But, if a certain amount of time passes, or a specific ingredient runs out (cache invalidation rules), they don't shut down the whole shop; they automatically brew a new fresh batch for just that specific type of coffee (rebuild individual pages on the fly). This allows them to handle new data without a full "shop closure" (server deployment).&lt;br&gt;
•&lt;br&gt;
How it works: You deploy a static site, but individual pages can be rebuilt on the fly on your server when their cache is invalidated based on specific rules (e.g., after a certain amount of time). This provides a way to handle dynamic data without needing a full server deployment like SSR.&lt;br&gt;
•&lt;br&gt;
Analogy: A library with a main collection (static site) that's mostly unchanging. But for popular new releases or books with frequent updates, the librarian (the server process) can automatically get and update just those specific books periodically or when new editions are released, without having to reorganize the entire library.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Offers the "best of both worlds" between SSG and SSR.&lt;br&gt;
Allows handling dynamic data without a full server deployment.&lt;br&gt;
Extremely fast due to permanent caching on a CDN (Content Delivery Network) for most requests.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
More complex to set up on your own.&lt;br&gt;
You'll likely need a hosting provider that supports it out-of-the-box, like Vercel.&lt;br&gt;
Still involves hydration, which can make the app feel "frozen" initially.&lt;br&gt;
•&lt;br&gt;
Frameworks: Started in Next.js.&lt;/p&gt;

&lt;p&gt;Best for: Sites with lots of pages that need periodic updates, like blogs with comments or product catalogs with occasional price updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Partial Hydration:&lt;/strong&gt;&lt;br&gt;
Consider a vast, interactive museum exhibition. Instead of powering up every single exhibit at once when you walk in, which would take ages, the museum powers up the main entrance and the most important, visible exhibits first (components at the top of the page). Then, as you walk deeper into the museum or approach a new section, only those specific exhibits are powered up and made interactive (JavaScript is executed for those components as they become visible or needed).&lt;br&gt;
•&lt;br&gt;
How it works: Aims to solve the problem of an app feeling "frozen" on initial load due to large JavaScript execution. Instead of hydrating the entire page, it might render components at the top first, then wait until the user scrolls down before making other components interactive.&lt;br&gt;
•&lt;br&gt;
Analogy: A complex digital magazine. When you open it, you can immediately read the headlines and the top of the first article. The interactive elements like image carousels or video players further down the page only load and become active as you scroll to them.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Improves the perceived performance and responsiveness of the app on initial load by making the top of the page interactive faster.&lt;br&gt;
Reduces the initial JavaScript load and execution time.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
While not explicitly stated as a "con" in the source, it inherently adds complexity to the development process as you need to manage which parts hydrate when.&lt;br&gt;
•&lt;br&gt;
Supporting concepts: This pattern is facilitated by tools that support code splitting and lazy loading.&lt;/p&gt;

&lt;p&gt;Best for: Long content pages with few interactive widgets (e.g., media articles, marketing pages).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Islands Architecture:&lt;/strong&gt;&lt;br&gt;
Imagine a vast, calm ocean (representing your static HTML) with several small, bustling islands scattered across it. The entire ocean is always there, providing the main content. However, only on these specific "islands" (interactive components) do you find active life and movement (JavaScript). Many parts of the ocean (static components) remain just water, meaning no boats (JavaScript) are ever sent there, making it very efficient.&lt;br&gt;
•&lt;br&gt;
How it works: The page starts with static HTML. JavaScript is only used to hydrate (make interactive) specific, isolated "islands" of interactivity. This is highly efficient because many components are often static and don't need JavaScript.&lt;br&gt;
•&lt;br&gt;
Analogy: A public bulletin board. The board itself and most of the notices tacked to it are static. But then there are a few QR codes or small digital screens embedded in the board that are interactive. You only need a battery (JavaScript) for those specific interactive parts, not the entire board.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Extremely efficient: if a page is not interactive at all, no JavaScript is ever shipped to the client.&lt;br&gt;
More efficient than hydrating the entire page.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
Requires a different way of thinking about component architecture.&lt;br&gt;
•&lt;br&gt;
Frameworks: Astro.&lt;/p&gt;

&lt;p&gt;Best for: Mostly-static content sites with isolated interactive parts—think news sites with "like" buttons or comment forms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming SSR:&lt;/strong&gt;&lt;br&gt;
Think of receiving a long, important document. Instead of waiting for the entire document to be printed and bound before it's given to you, the printer starts sending you pages as soon as they are ready, in multiple chunks. You can start reading and interacting with the first pages while the printer is still working on the later ones, making the whole process feel much faster and more responsive.&lt;br&gt;
•&lt;br&gt;
How it works: This method allows the server to render content concurrently in multiple chunks rather than delivering everything all at once. It's a way to address inefficient hydration by making the UI interactive faster.&lt;br&gt;
•&lt;br&gt;
Analogy: Watching a video stream online. The video doesn't download entirely before it starts playing; it streams in chunks, allowing you to start watching almost immediately while the rest loads in the background.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
The UI becomes interactive faster.&lt;br&gt;
Feels more performant to the end user.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
Not explicitly listed, but it adds complexity to the server-side setup.&lt;br&gt;
•&lt;br&gt;
Frameworks/Building Blocks: Supported in frameworks like Next.js 13 with the app directory, thanks to building blocks like React Server Components&lt;/p&gt;

&lt;p&gt;Best for: Complex, data-heavy pages (e.g., dashboards, social media feeds) where rendering partial content ASAP improves UX.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resumability:&lt;/strong&gt;&lt;br&gt;
Imagine a super-intelligent robot factory where robots are built in a unique way. When you "power on" a robot (load the website), all its blueprints, internal data, and even instructions for specific movements (like waving its arm or turning its head) are serialized and embedded directly into its physical structure (HTML). The actual "code" for those movements is then broken into tons of tiny, independent chips. When you tell the robot to wave, it doesn't need a huge "start-up" program; it just activates the tiny, specific chip needed for that exact wave, loading it only when required. No large initial power-up (hydration) is needed.&lt;br&gt;
•&lt;br&gt;
How it works: This is a new rendering paradigm. The website and all its data, including JavaScript event listeners, are serialized directly into the HTML. The actual JavaScript code is broken into many tiny chunks. This means the initial page load is always static HTML, and no hydration is needed. Any JavaScript required for interactivity is lazy-loaded only when specifically needed in the background.&lt;br&gt;
•&lt;br&gt;
Analogy: A self-sufficient modular home. Everything needed for the house to function is pre-built and embedded within its structure. If you want to turn on a light, the specific tiny wiring for that light switch is activated instantly, without needing to power up the entire house's electrical system first.&lt;br&gt;
•&lt;br&gt;
Pros:&lt;br&gt;
Gets rid of hydration altogether, which is often a source of performance problems.&lt;br&gt;
The initial page load is always static HTML.&lt;br&gt;
JavaScript is lazy-loaded only when required for interactivity.&lt;br&gt;
•&lt;br&gt;
Cons:&lt;br&gt;
It's a new and emerging paradigm, currently being pioneered by the Qwik framework. This means less community support or established best practices compared to more mature methods.&lt;br&gt;
•&lt;br&gt;
Frameworks: Qwik&lt;/p&gt;

&lt;p&gt;Best for: Performance-critical apps with a need for almost instant load on mobile and slow networks.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>mobile</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>SSR + RSC: Best of Both Worlds</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Thu, 26 Jun 2025 20:22:21 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/ssr-rsc-best-of-both-worlds-2fbc</link>
      <guid>https://dev.to/nedajahanfar/ssr-rsc-best-of-both-worlds-2fbc</guid>
      <description>&lt;p&gt;When building web apps with React, two powerful rendering strategies are Server-Side Rendering (SSR) and React Server Components (RSC). Both aim to improve performance and user experience, but they do so in different ways. Let’s break them down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is SSR (Server-Side Rendering)?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With SSR, your app runs on the server first, and the server sends HTML to the browser. This means users see the content almost instantly—especially useful for content-heavy apps like blogs or news websites.&lt;/p&gt;

&lt;p&gt;So when a user visits your site:&lt;/p&gt;

&lt;p&gt;The server builds the page.&lt;/p&gt;

&lt;p&gt;The HTML is sent immediately.&lt;/p&gt;

&lt;p&gt;The browser renders the static page quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Downside?&lt;/strong&gt;&lt;br&gt;
While the page looks ready, it’s not fully interactive yet.&lt;/p&gt;

&lt;p&gt;That’s because the JavaScript bundle—which handles interactivity (like clicking buttons, submitting forms, etc.)—still needs to download and run on the client. This process is called &lt;em&gt;hydration&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Until hydration completes, your app might look alive but feel dead—buttons won’t respond, dropdowns won’t open, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are React Server Components (RSC)?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React Server Components are a newer model introduced by the React team. They allow parts of your component tree to be rendered entirely on the server, without being sent to the browser as JavaScript.&lt;/p&gt;

&lt;p&gt;Here’s how they help:&lt;/p&gt;

&lt;p&gt;You can keep logic securely on the server (e.g., API keys, database queries).&lt;/p&gt;

&lt;p&gt;You send only the minimal necessary JavaScript to the client.&lt;/p&gt;

&lt;p&gt;The client only hydrates the parts that actually need interactivity.&lt;/p&gt;

&lt;p&gt;So what’s the benefit?&lt;br&gt;
RSC gives you:&lt;/p&gt;

&lt;p&gt;The fast initial load time of SSR.&lt;/p&gt;

&lt;p&gt;The security of keeping sensitive logic hidden.&lt;/p&gt;

&lt;p&gt;The efficiency of only sending JS to the components that need it.&lt;/p&gt;

&lt;p&gt;This makes your app faster, more secure, and less bloated.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;SSR + RSC: *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When combined:&lt;/p&gt;

&lt;p&gt;SSR handles the initial HTML rendering, making pages load fast.&lt;/p&gt;

&lt;p&gt;RSC takes care of server-side logic and keeps sensitive data away from the client.&lt;/p&gt;

&lt;p&gt;Client components handle interactivity, and hydration is smarter and more efficient.&lt;/p&gt;

&lt;p&gt;_React Server Components are a game-changer for building modern apps. They help keep things snappy, reduce unnecessary JavaScript, and allow developers to write more secure and scalable applications.&lt;/p&gt;

&lt;p&gt;So next time you're building an app that needs both speed and interactivity, consider combining SSR and RSC—you might just get the best of both worlds._&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ssr</category>
      <category>rsc</category>
      <category>react</category>
    </item>
    <item>
      <title>PHP Simplified: So, What Exactly Is PHP?</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Tue, 24 Jun 2025 14:15:29 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/php-simplified-so-what-exactly-is-php-3jb6</link>
      <guid>https://dev.to/nedajahanfar/php-simplified-so-what-exactly-is-php-3jb6</guid>
      <description>&lt;p&gt;&lt;strong&gt;What Does “PHP” Mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PHP stands for “Hypertext Preprocessor” — a bit confusing, since the acronym is recursive. It’s a widely-used, open-source scripting language that’s especially popular for building websites.&lt;br&gt;
But what does “scripting language” mean?&lt;br&gt;
A programming language is a broader term that refers to any language used to write software, including desktop, mobile, and web apps. A scripting language is a type of programming language designed for automating tasks, often within another environment (like a web browser or server).So yes — PHP is a programming language, and specifically a scripting language, because it runs on the server to automate the generation of web content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PHP in Action:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s a very basic example of PHP in an HTML page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;?php echo "Hi, I'm a PHP thing!"; ?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;br&gt;
You see regular HTML.&lt;br&gt;
Inside it, there’s a special block that begins with &lt;code&gt;&amp;lt;?php&lt;/code&gt; and ends with &lt;code&gt;?&amp;gt;&lt;/code&gt;.&lt;br&gt;
Inside that block is the PHP code — in this case, echo is used to output a message.&lt;br&gt;
Rather than writing lots of commands to output HTML (like in C or Perl), you just embed the PHP directly into your HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Does PHP Actually Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When someone visits a webpage written in PHP, here’s what happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The visitor’s browser sends a request to the website.&lt;/li&gt;
&lt;li&gt;The server executes the PHP code on the backend (the visitor doesn’t see this).&lt;/li&gt;
&lt;li&gt;The PHP code generates output, usually HTML.&lt;/li&gt;
&lt;li&gt;The server sends the resulting HTML to the browser.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;The user never sees the PHP code — they only see the final result.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This makes PHP great for creating dynamic content, like blog posts, user dashboards, or forms that save data.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What Can PHP Do?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;PHP is mainly used in two ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Server-Side Scripting:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;This is the most common use. PHP works with a:&lt;/p&gt;

&lt;p&gt;PHP parser (a program that runs your PHP code)&lt;/p&gt;

&lt;p&gt;Web server (like Apache)&lt;/p&gt;

&lt;p&gt;Web browser&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Command-Line Scripting:&lt;/strong&gt;&lt;br&gt;
You can also run PHP in your terminal or command prompt, with no browser needed. This is useful for:&lt;/p&gt;

&lt;p&gt;Background tasks (like cron jobs on macOS/Linux)&lt;/p&gt;

&lt;p&gt;Simple data processing&lt;/p&gt;

&lt;p&gt;Script automation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-Platform Freedom&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PHP runs on all major operating systems (Windows, macOS, Linux). You can choose your preferred :&lt;/p&gt;

&lt;p&gt;Operating system&lt;/p&gt;

&lt;p&gt;Web server (Apache, Nginx, etc.)&lt;/p&gt;

&lt;p&gt;Programming style (Procedural or Object-Oriented)&lt;/p&gt;

&lt;p&gt;_Procedural vs. Object-Oriented:&lt;br&gt;
Procedural programming: You write code as a sequence of instructions (step by step).&lt;/p&gt;

&lt;p&gt;Object-Oriented programming (OOP): You structure your code around objects (like reusable templates for things).&lt;br&gt;
PHP supports both, and you can even mix them if needed._&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Tools Do You Need to Use PHP?&lt;/strong&gt;&lt;br&gt;
 That depends on how you’re using it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Command-Line PHP:&lt;/strong&gt;&lt;br&gt;
  You only need to install PHP. That’s it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Web Development:&lt;/strong&gt;&lt;br&gt;
  You’ll need a bit more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  PHP&lt;/li&gt;
&lt;li&gt;  A web server&lt;/li&gt;
&lt;li&gt;  A database&lt;/li&gt;
&lt;li&gt;  A browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;To make your life easier, use a tool like XAMPP.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is XAMPP?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;X (cross-platform): Works on Windows, macOS, Linux&lt;/p&gt;

&lt;p&gt;Apache: A web server that delivers your site to the browser&lt;/p&gt;

&lt;p&gt;MySQL: A database system (used to store information — kind of like localStorage in JS, but much more powerful and persistent)&lt;/p&gt;

&lt;p&gt;PHP: Already included!&lt;/p&gt;

&lt;p&gt;Perl: Another scripting language (optional)&lt;/p&gt;

&lt;p&gt;Once installed, XAMPP lets you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Host websites on localhost&lt;/li&gt;
&lt;li&gt;Manage databases with phpMyAdmin (a user-friendly dashboard)&lt;/li&gt;
&lt;li&gt;Run and test PHP code easily.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>backend</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Deal with APIs in a Cool Way</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Mon, 23 Jun 2025 08:55:42 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/how-to-deal-with-apis-in-a-cool-way-4hdd</link>
      <guid>https://dev.to/nedajahanfar/how-to-deal-with-apis-in-a-cool-way-4hdd</guid>
      <description>&lt;p&gt;Imagine you’ve built something amazing — a backend, filled with valuable data (like the list of classic poets, maybe?). You’ve stored it somewhere on a server, and now you want the world to access it.&lt;br&gt;
You’ve finished step one: building and hosting your backend.&lt;/p&gt;

&lt;p&gt;But here comes step two:&lt;/p&gt;

&lt;p&gt;How do people know how to talk to your API?&lt;br&gt;
How do they know what endpoints exist, what data to send, or what they’ll receive back?&lt;br&gt;
That’s where Swagger comes in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Swagger?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Swagger is your API’s guidebook. It’s actually a set of tools built around a format called OpenAPI — a standard way to describe RESTful APIs(explained below).&lt;/p&gt;

&lt;p&gt;With Swagger, you get:&lt;br&gt;
A visual, interactive documentation of your API (you’ve seen those websites where you can test the endpoints live? That’s Swagger UI)&lt;br&gt;
A way to describe all the endpoints, input parameters, and response shapes.&lt;br&gt;
Tools to test and simulate API calls.&lt;/p&gt;

&lt;p&gt;Basically, Swagger helps you answer:&lt;br&gt;
“How do I interact with this API?”&lt;br&gt;
...without guessing or asking the backend team every five minutes.&lt;/p&gt;

&lt;p&gt;What are REST APIs?&lt;br&gt;
APIs (Application Programming Interfaces) let two software pieces talk to each other.&lt;/p&gt;

&lt;p&gt;REST APIs (REpresentational State Transfer) are the most common kind. They work using HTTP verbs like:&lt;/p&gt;

&lt;p&gt;GET – retrieve data&lt;/p&gt;

&lt;p&gt;POST – send new data&lt;/p&gt;

&lt;p&gt;PUT – update existing data&lt;/p&gt;

&lt;p&gt;DELETE – remove data&lt;/p&gt;

&lt;p&gt;So when Swagger documents a REST API, it's just showing:&lt;br&gt;
Here's how to GET /poets,&lt;br&gt;
Here's how to POST /users,&lt;br&gt;
And here’s what the response looks like.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is Orval?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Okay, now imagine you're building the frontend app — like a React Native app with Expo.&lt;/p&gt;

&lt;p&gt;You read the Swagger doc and think, “Cool, now I know how to call the API.”&lt;br&gt;
But wouldn't it be better if someone just wrote the code for calling the API for you?&lt;/p&gt;

&lt;p&gt;That someone is Orval.&lt;br&gt;
Orval:&lt;br&gt;
Takes the Swagger/OpenAPI file&lt;br&gt;
Understands all the endpoints&lt;br&gt;
Generates perfect TypeScript code&lt;br&gt;
Even gives you ready-made React Query hooks like useGetPoets()&lt;/p&gt;

&lt;p&gt;So instead of writing boilerplate fetch or Axios calls, you get clean, type-safe, reusable functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus: Zod&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When using Orval, you can also enable Zod, a TypeScript-first schema validation library.&lt;br&gt;
Zod acts like a gatekeeper at your app’s entrance:&lt;br&gt;
It checks incoming data&lt;br&gt;
If it doesn’t match your expected shape, it blocks it&lt;br&gt;
Prevents bugs and crashes from unexpected responses.&lt;/p&gt;

&lt;p&gt;Ps: Why use Zod?&lt;/p&gt;

&lt;p&gt;Because TypeScript is only a compile-time tool.&lt;/p&gt;

&lt;p&gt;It helps catch errors while you're writing code&lt;/p&gt;

&lt;p&gt;But it doesn’t run in your final app&lt;/p&gt;

&lt;p&gt;It can’t protect you at runtime&lt;/p&gt;

&lt;p&gt;So if you call an API and the server sends broken or unexpected data, TypeScript won’t help.&lt;/p&gt;

</description>
      <category>api</category>
      <category>development</category>
      <category>frontend</category>
      <category>apigateway</category>
    </item>
    <item>
      <title>From React to React Native</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Fri, 06 Jun 2025 17:30:24 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/from-react-to-react-native-2f78</link>
      <guid>https://dev.to/nedajahanfar/from-react-to-react-native-2f78</guid>
      <description>&lt;p&gt;If you visit the React Native documentation, you'll see the following definition:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“React Native is an open-source framework for building Android and iOS applications using React and the app platform’s native capabilities.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simple terms, React Native is a JavaScript framework that allows us to build mobile applications for both ios and Android using the same codebase, similar to how we use React to build web applications.&lt;br&gt;
Back in web development, we had to write code with different browsers in mind, but over time, tools like transpilers (e.g., Babel) helped bridge the gap between different environments. React Native does something similar for mobile: it lets developers write JavaScript that runs across different mobile platforms while rendering native components under the hood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Evolution:&lt;/strong&gt;&lt;br&gt;
In its early days, React Native had limitations — it was relatively slow and couldn’t communicate directly with the native (machine-level) code. However, newer technologies have significantly improved its performance:&lt;/p&gt;

&lt;p&gt;JSI (JavaScript Interface): Allows direct communication between JavaScript and native code. This gives better performance and unlocks access to native features.&lt;/p&gt;

&lt;p&gt;Fabric Renderer: Optimizes rendering to make the UI faster and closer in performance to true native apps.&lt;/p&gt;

&lt;p&gt;Hot Reloading: Automatically updates code changes in real-time without rebuilding the app, improving development speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Expo: The Toolchain for React Native&lt;/strong&gt;&lt;br&gt;
Expo is the recommended tool for working with React Native. It acts like Vite or Create React App, but for mobile. It simplifies setup and offers built-in access to APIs like camera, location, and notifications — without needing native code configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React vs. React Native&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Similarities:&lt;/em&gt;&lt;br&gt;
React Native shares many concepts with React:&lt;/p&gt;

&lt;p&gt;JSX Syntax: You still write UI components using JSX.&lt;/p&gt;

&lt;p&gt;Component-Based Architecture: You build your UI with reusable components.&lt;/p&gt;

&lt;p&gt;JavaScript &amp;amp; Hooks: Logic and state management are the same.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Differences:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The key difference lies in core components. Instead of HTML elements like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`&amp;lt;div&amp;gt;`
&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 plaintext"&gt;&lt;code&gt;`&amp;lt;button&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;, you use mobile-native components such as:&lt;/p&gt;

&lt;p&gt;Common React Native Core Components&lt;br&gt;
View: Basic container, similar to &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;br&gt;
Text: Displays text, like &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;&lt;br&gt;
Image: Display an image&lt;br&gt;
ImageBackground: A container with a background image&lt;br&gt;
TextInput: User input field&lt;br&gt;
ScrollView: Scrollable container(renders all children)-(which can cause performance issues for long lists)&lt;br&gt;
FlatList: Optimized list for large data sets (renders lazily)-(For large lists, use FlatList — it renders only visible items.)&lt;br&gt;
Switch: Toggle switch(boolean on/off)&lt;br&gt;
TouchableOpacity: A pressable component that reduces opacity on touch.&lt;br&gt;
SafeAreaView: Ensures content fits within the safe area boundaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Styling in React Native&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React Native does not use CSS files. Instead, styles are written in JavaScript using a special syntax:&lt;/p&gt;

&lt;p&gt;Two main ways to style:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inline styles:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`&amp;lt;View style={{ backgroundColor: 'blue', padding: 10 }} /&amp;gt;`

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.StyleSheet API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`const styles = StyleSheet.create({
  box: { backgroundColor: 'blue', padding: 10 }
});`

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use libraries like nativewind to write Tailwind-like utility classes in React Native(NativeWind is a library that brings Tailwind CSS utility classes to React Native. It lets you style your components using class names (e.g., className="bg-blue-500 p-4"). It's built on top of the [StyleSheet API] and works well with Expo.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Routing in React Native:&lt;/strong&gt;&lt;br&gt;
React Native does not use traditional HTML routing (). Instead, it uses a library called react-navigation, which lets you manage navigation stacks like screens or tabs.&lt;br&gt;
react-navigation, lets you define screen stacks (like web routes) using Stack.Navigator, Tab.Navigator, etc. Each screen is a component, and you use navigation.navigate('ScreenName') to move between them.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>mobile</category>
      <category>programming</category>
    </item>
    <item>
      <title>CSS in React - What Really Happens When You Import Styles And How to Keep Them Scoped-</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Mon, 26 May 2025 09:02:15 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/css-in-react-2omi</link>
      <guid>https://dev.to/nedajahanfar/css-in-react-2omi</guid>
      <description>&lt;p&gt;Default CSS Behavior in React (Global CSS):&lt;br&gt;
When you import a .css file like this (anywhere in your code)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './App.css';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That CSS is applied globally across your React application.&lt;br&gt;
Why? because CSS files are simply stylesheets , once they are loaded the browser applies them globally to all matching selectors in the DOM , ( even if you import ComponentA.css inside ComponentA, the styles can still "leak" into ComponentB if they share class names or tag selectors.) &lt;/p&gt;

&lt;p&gt;Then Why Import CSS at the Component Level?&lt;br&gt;
Purely for organization and developer clarity.(This makes it easier to find and manage styles related to each component, even though technically the styles are still global.)&lt;/p&gt;

&lt;p&gt;Isolated CSS: How to Prevent Style Leakage&lt;/p&gt;

&lt;p&gt;But can we scope css to a specific component , so it does not affect the rest of the app?? The answer is YES.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CSS Modules (Recommended &amp;amp; Simple):
CSS Modules allow you to write CSS that’s scoped to the component where it's imported. Instead of global class names, they generate unique class names automatically — so there are no naming conflicts or style leaks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You rename your file to :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Button.module.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in your React component:&lt;br&gt;
`&lt;br&gt;
import styles from './Button.module.css';&lt;/p&gt;

&lt;p&gt;function Button() {&lt;br&gt;
  return Click Me;&lt;br&gt;
}`&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Now, styles.primary is a unique, scoped class name (e.g., _Button_primary_abc12388) generated automatically.&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Styled Components / Emotion (CSS-in-JS):&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Styled Components is a popular CSS-in-JS library. It lets you write CSS inside your JavaScript and attach it directly to components. Styles are scoped automatically and can dynamically change based on props, themes, etc.&lt;/p&gt;

&lt;p&gt;import styled from 'styled-components';&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Button = styled.button`
  background-color: blue;
  color: white;
`;

function App() {
  return &amp;lt;Button&amp;gt;Click Me&amp;lt;/Button&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Key Insight:&lt;br&gt;
In default React setup, all imported CSS is global, even if you import it inside a component. Use CSS Modules or CSS-in-JS to isolate styles.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>react</category>
      <category>frontend</category>
      <category>programming</category>
    </item>
    <item>
      <title>Event Handler Behavior in React vs HTML</title>
      <dc:creator>nedajahanfar</dc:creator>
      <pubDate>Sat, 24 May 2025 13:23:35 +0000</pubDate>
      <link>https://dev.to/nedajahanfar/event-handler-behavior-in-react-vs-html-8k9</link>
      <guid>https://dev.to/nedajahanfar/event-handler-behavior-in-react-vs-html-8k9</guid>
      <description>&lt;p&gt;In HTML , when you write this : &lt;br&gt;
&lt;code&gt;&amp;lt;button onclick="handleClick()"&amp;gt;Click me&amp;lt;/button&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The browser sees the string "handleClick()" and stores it as text inside the element.&lt;/p&gt;

&lt;p&gt;It does not run it immediately — it waits for the user to click.&lt;/p&gt;

&lt;p&gt;When the click happens, the browser reads the string and executes it like code.&lt;br&gt;
So:&lt;/p&gt;

&lt;p&gt;** The function call is stored as a string, not as an actual JavaScript command.&lt;/p&gt;

&lt;p&gt;It’s only run when the event occurs.&lt;br&gt;
**&lt;/p&gt;

&lt;p&gt;In React when you write this : &lt;br&gt;
&lt;code&gt;&amp;lt;button onClick={handleClick}&amp;gt;Click me&amp;lt;/button&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;**React sees handleClick as a real function reference, not a string.&lt;/p&gt;

&lt;p&gt;You are telling React:&lt;/p&gt;

&lt;p&gt;“When this button is clicked, call this function.”&lt;br&gt;
**&lt;/p&gt;

&lt;p&gt;If you write :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;onClick={handleClick()}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You're calling the function immediately during render .&lt;br&gt;
Because the () makes it run now, not later.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In HTML, event handlers are written as strings that are stored inside the element and only run when the event happens.&lt;br&gt;
In React, event handlers are real functions that React keeps track of — so you don’t use () because you don’t want the function to run right away.&lt;br&gt;
If you do need to pass arguments (which requires ()), you wrap the call inside an arrow function so it waits for the event to trigger.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;onClick={() =&amp;gt; handleClick("hi")}&lt;/code&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>frontend</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
