<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by KenanKarakashli on Medium]]></title>
        <description><![CDATA[Stories by KenanKarakashli on Medium]]></description>
        <link>https://medium.com/@kenankarakashli?source=rss-a2473424ac5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Hd3QhQHvFHbUykjp</url>
            <title>Stories by KenanKarakashli on Medium</title>
            <link>https://medium.com/@kenankarakashli?source=rss-a2473424ac5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:20:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kenankarakashli/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CSS Flexbox Cheat Sheet: Every Property Explained]]></title>
            <link>https://medium.com/@kenankarakashli/css-flexbox-cheat-sheet-every-property-explained-visually-209c640256e0?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/209c640256e0</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[flexbox]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 20:09:59 GMT</pubDate>
            <atom:updated>2026-11-13T20:15:38.058Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>The properties you actually use, what each value really does, and the one idea that makes all of them easy to remember.</em></h4><p>Flexbox has a reputation for being confusing, mostly because people try to memorize a long list of properties without the one idea that connects them.</p><p>Here’s that idea, plus every property that matters, with a picture showing what each value does.</p><h3>The one idea: two axes</h3><p>Every flex container has a <strong>main axis</strong> and a <strong>cross axis</strong>. The main axis is the direction items are laid out. The cross axis runs at a right angle to it.</p><p>Withflex-direction: row (the default) the main axis runs left to right. With columns, it runs top to bottom, and the axes swap.</p><p>Why this matters: justify-content always works along the main axis, and align-items always works along the cross axis. If one of them seems to do the “wrong” thing, check which direction you set. Nine times out of ten, that’s the answer.</p><h3>Start here: turn it on.</h3><pre>.container {<br>  display: flex;<br>}</pre><p>That one line turns the element into a flex container and its direct children into flex items. Only direct children are affected, not deeper descendants.</p><h3>flex-direction</h3><p>Set the main axis</p><ul><li><strong>row</strong> (default): items go left to right.</li><li><strong>row-reverse:</strong> items go right to left.</li><li><strong>column</strong>: items go from top to bottom.</li><li><strong>column-reverse</strong>: items go from bottom to top.</li></ul><h3>justify-content: spacing along the main axis</h3><ul><li><strong>flex-start </strong>(default): items bunch at the start.</li><li><strong>flex-end</strong>: items bunch at the end.</li><li><strong>center</strong>: items sit in the middle.</li><li><strong>space-between</strong>: first item at the start, last at the end, equal gaps between.</li><li><strong>space-around</strong>: equal space around each item, so the edge gaps are half the size of the gaps between items.</li><li><strong>space-evenly</strong>: every gap is the same, including the edges.</li></ul><p>Most people use <strong>space-between</strong> for a navbar.</p><h3>align-items: alignment along the cross axis</h3><ul><li><strong>stretch</strong> (default): items stretch to fill the container’s height (when no height is set on them).</li><li><strong>flex-start:</strong> items line up at the start of the cross axis.</li><li><strong>center</strong>: items are centered on the cross axis.</li><li><strong>flex-end</strong>: items line up at the end of the cross axis.</li><li><strong>baseline</strong>: items line up by the baseline of their text.</li></ul><p>Notice that the default is stretch. That’s why flex items in a row often end up the same height without you asking.</p><h3>The famous one: centering anything</h3><pre>.container {<br>  display: flex;<br>  justify-content: center; /* horizontal centering */<br>  align-items: center;     /* vertical centering */<br>  min-height: 100vh;<br>}</pre><p>Center on the main axis and the cross axis, and the item sits dead center. This pair of lines solves one of CSS’s oldest jokes.</p><h3>flex-wrap</h3><p>By default, flex items try to squeeze onto one line, shrinking if they have to. flex-wrap lets them break onto new lines.</p><ul><li><strong>nowrap</strong> (default): everything stays on one line.</li><li><strong>wrap</strong>: items move to the next line when they run out of room.</li><li><strong>wrap-reverse</strong>: same, but new lines stack upward.</li></ul><h3>gap</h3><pre>.container {<br>  display: flex;<br>  gap: 16px;<br>}</pre><p>The simplest way to space items. It adds space between items only, not at the outer edges, so you don’t need margins on every child.</p><h3>Properties for the items</h3><p>Everything above goes on the container. These go on the items themselves.</p><p><strong>flex-grow</strong> says how much of the leftover space an item should take. Give one item flex-grow: 1, and it expands to fill the free space. Give two items, 1 and 2, and the second gets twice the share of the extra room.</p><p><strong>flex-shrink</strong> says how willing an item is to shrink when there isn’t enough space. The default is 1 (it will shrink). Set it to 0 to stop an item from getting squished.</p><p><strong>flex-basis</strong> is the item’s starting size along the main axis before it grows or shrinks.</p><p><strong>The shorthand:</strong> you’ll usually see these three combined.</p><pre>.item {<br>  flex: 1;           /* grow 1, shrink 1, basis 0: share space equally */<br>  flex: 0 0 200px;   /* don&#39;t grow, don&#39;t shrink, stay 200px */<br>}</pre><p><strong>align-self</strong> lets one item override the container’s align-items. For example, align-self: flex-end pushes just that one item to the bottom of a row.</p><p><strong>order</strong> changes the visual order without touching the HTML. The default is 0, and lower numbers come first. Use it sparingly, because screen readers and keyboard users still follow the HTML order.</p><h3>Two handy tricks</h3><p><strong>1. Push one item to the far side with auto margin.</strong></p><pre>.logo { margin-right: auto; }<br>/* in a navbar, everything after the logo moves to the right */</pre><p><strong>2. Equal-width columns with no math.</strong></p><pre>.column { flex: 1; }<br>/* every column shares the space equally */</pre><h3>Common mistakes</h3><ul><li><strong>Forgetting that properties go on the right element.</strong> justify-content goes on the container, not on the items.</li><li><strong>Mixing up the axes.</strong> If you switch to flex-direction: column, justify-content now works vertically.</li><li><strong>Expecting nested items to flex.</strong> Only direct children are flex items.</li><li><strong>Using Flexbox for a full 2D layout.</strong> Flexbox handles one direction at a time. For rows and columns together, Grid is usually the better tool.</li></ul><h3>The cheat sheet</h3><p><strong>On the container:</strong></p><ul><li>display: flex: turn it on.</li><li>flex-direction: which way is the main axis.</li><li>justify-content: space along the main axis.</li><li>align-items: alignment along the cross axis.</li><li>flex-wrap: allows items to wrap.</li><li>gap: space between items.</li></ul><p><strong>On the items:</strong></p><ul><li>flex-grow, flex-shrink, flex-basis (or flex): how items share space.</li><li>align-self: override alignment for one item.</li><li>order: change visual order.</li></ul><p>If you want to know when to reach for Flexbox and when for Grid, I wrote a post on that too: <strong><em>CSS Grid vs Flexbox: When to Use Which.</em></strong></p><p><em>I’m Kenan - a self-taught frontend developer writing honestly about what the learning journey actually looks like. To discover more fascinating articles, follow me!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=209c640256e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS Box Model Explained: Why Your Width Is Never What You Set (With a Diagram)]]></title>
            <link>https://medium.com/@kenankarakashli/css-box-model-explained-why-your-width-is-never-what-you-set-with-a-diagram-4e72d5448df7?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e72d5448df7</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css-box-sizing]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 20:20:54 GMT</pubDate>
            <atom:updated>2026-10-30T20:20:54.604Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Padding, border, margin, and the one line of CSS </em><strong><em>(box-sizing: border-box)</em></strong><em> that solves most “why is this element too wide?” problems.</em></p><p>If you’ve ever wondered why a <strong>width:300px</strong> element ends up wider than 300px, or why there’s a mystery gap between two elements, the answer is almost always the same: <strong>the box model</strong>.</p><p>It’s one of the first things to understand in CSS, and it’s easier than it looks once you picture it.</p><h3>Everything is a box</h3><p>On a web page, every element, whether a paragraph, image, button, or div, is a rectangular box. Each box has four layers, starting from the inside:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*MSCyx8BU20gRBR9FjVvOrw.png" /></figure><ul><li><strong>Content:</strong> the actual text or image.</li><li><strong>Padding:</strong> space inside the box, between the content and the border. The background color shows through it.</li><li><strong>Border:</strong> the line around the padding.</li><li><strong>Margin:</strong> space outside the box that pushes other elements away. It’s always transparent.</li></ul><h3>Seeing it in code</h3><pre>.card {<br>  width: 300px;<br>  padding: 20px;<br>  border: 5px solid #333;<br>  margin: 30px;<br>}</pre><p>How wide is this box?</p><h3>The gotcha: content-box vs. border-box</h3><p>By default, browsers use box-sizing: content-box. That means width applies only to the <strong>content</strong>, and padding and borders are added on top.</p><p>So the box above is<strong> 300px</strong> of content, plus <strong>40px</strong> of padding (20 on each side), plus <strong>10px</strong> of border (5 on each side). That’s <strong>350px</strong> total, not <strong>300px</strong>. This is the mystery that breaks layouts.</p><p>With <strong>box-sizing:border-box</strong>, the <strong>width</strong> includes the padding and border. The content shrinks to fit, and the box stays exactly <strong>300px.</strong></p><p>That’s much more <strong>predictable</strong>, which is why <strong>most developers</strong> start every project with this:</p><pre>*,<br>*::before,<br>*::after {<br>  box-sizing: border-box;<br>}</pre><h3>Padding vs. margin: which one do I use?</h3><p>A simple rule:</p><ul><li><strong>Padding</strong> is the space inside an element. Use it to create space around content or increase a button&#39;s size.</li><li><strong>Margin</strong> is the space outside the element. Use it to push the element away from its neighbors.</li></ul><pre>.button {<br>  padding: 12px 24px;   /* breathing room around the text */<br>  margin-bottom: 16px;  /* gap before the next element */<br>}</pre><p><strong>Quick test:</strong> should the background color extend into this space? If yes, it’s padding. If no, it’s margin.</p><h3>The shorthand, decoded</h3><p>CSS lets you set all four sides at once. The order goes clockwise from the top: top, right, bottom, left.</p><pre>/* top, right, bottom, left */<br>padding: 10px 20px 30px 40px;<br><br>/* top and bottom, then left and right */<br>padding: 10px 20px;<br><br>/* all four sides */<br>padding: 10px;</pre><h3>Margin collapse (the weird one)</h3><p>When two vertical margins touch, they don’t add up. They <em>collapse</em> into the larger one.</p><p>If Box A has <strong>margin-bottom: 30px</strong> and Box B has <strong>margin-top: 20px</strong>, the gap between them is <strong>30px</strong>, the bigger of the two, not <strong>50px</strong>.</p><p>This only happens vertically, and only between block elements. If you ever get less space than you expected between two elements, margin collapse is a likely cause.</p><h3>Cheat sheet</h3><ul><li>Every element is a box: content, then padding, then border, then margin.</li><li>Start every project with <strong>box-sizing: border-box</strong>.</li><li>Padding is the inside space. A margin is outside space.</li><li>Vertical margins between blocks can collapse.</li><li>Use DevTools to see the real box.</li></ul><p><em>I’m Kenan — a self-taught frontend developer writing honestly about what the learning journey actually looks like. To discover more fascinating articles, follow me!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e72d5448df7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Feynman Technique for Developers: Learn Anything by Explaining It]]></title>
            <link>https://medium.com/@kenankarakashli/the-feynman-technique-for-developers-learn-anything-by-explaining-it-4e06faba0643?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e06faba0643</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 20:14:35 GMT</pubDate>
            <atom:updated>2026-10-17T20:14:35.212Z</atom:updated>
            <content:encoded><![CDATA[<p><em>You can read about closures five times and still not explain them. The Feynman Technique is a simple way to find out what you actually understand and fix what you don’t.</em></p><p>Every developer knows a specific kind of false confidence.</p><p>You read an article about how <strong>async/await</strong> works. It makes sense. You nod along. Then someone asks, “So what actually happens when you <strong>await</strong> something?” and you hear yourself say, “Well… it… waits for the promise. And then continues.”</p><p>That’s not understanding. That’s <em>recognition</em>. You recognize the words, but you can’t rebuild the idea.</p><p>The Feynman Technique turns recognition into understanding. It’s named after physicist Richard Feynman, who was famous for explaining complex ideas in plain language.</p><p>His principle: <strong>if you can’t explain something, you don’t understand it yet.</strong></p><h4>The four steps:</h4><h4><strong>Step 1: Pick one concept and write its name at the top of a blank page</strong></h4><p>One concept, not a whole topic. “Promises” is a good size. “JavaScript” is not.</p><h4><strong>Step 2: Explain it as if teaching a beginner</strong></h4><p>Write (or say out loud) an explanation in plain words, as if the listener has never programmed. No jargon, or if you use a term, define it right there.</p><p>Try this question for “What is a function?”:</p><blockquote>A function is a named set of instructions. You write the steps once, name them, and then you can run them whenever you want by calling the name. It’s like a recipe card: you don’t rewrite the recipe every time you cook.</blockquote><p>If you reach for a word and can’t explain it, circle it. That circle is gold.</p><h4><strong>Step 3: Find the gaps and go back to the source.</strong></h4><p>Every place where you got stuck, hand-waved, or used a fancy word as a shield is a gap in your understanding. Go back to the docs, a tutorial, or your code and learn <em>just those parts</em>.</p><p>This is the most valuable step, because it tells you what to study instead of rereading everything.</p><h4><strong>Step 4: Simplify and use analogies</strong></h4><p>Rewrite your explanation to be shorter and simpler. Replace technical terms with everyday comparisons.</p><p>A simple analogy is the real test. For example, a <strong>call stack</strong>:</p><blockquote>Imagine a stack of plates. You can only add a plate to the top, and you can only take one off the top. When your program calls a function, it puts a plate on the stack. The plate comes off when the function finishes. The program always works on the top plate.</blockquote><p>If you can produce an analogy like that, you’ve moved from memorizing to understanding.</p><h4>A worked example: explaining const vs let</h4><p><strong>First attempt (the fake-understanding version):</strong></p><blockquote><strong>const</strong> is a constant that can’t change, and <strong>let</strong> can change.</blockquote><p>That sounds fine until you test it:</p><pre>const user = { name: &quot;Ada&quot; };<br>user.name = &quot;Grace&quot;; // does this work?</pre><p>If you’re not sure, you’ve found a gap. (It <em>does</em> work: <strong>const</strong> stops you from reassigning the variable, not from changing what’s inside the object)</p><p><strong>Second attempt, after filling the gap:</strong></p><blockquote><strong>const</strong> and <strong>let</strong> both create variables, but with <strong>const</strong>, the variable name is locked to one value: you can’t point it at something else. But if that value is an object, you can still change what’s inside the object. Think of <strong>const</strong> as a label glued onto a box. You can’t move the label to a different box, but you can still put new things in the box.</blockquote><p>That explanation is shorter, more accurate, and something you’ll remember.</p><h3>Ways to practice it as a developer</h3><ul><li><strong>Rubber duck debugging.</strong> Explain your code to a duck (or a plant). It’s the Feynman Technique with a captive audience.</li><li><strong>Write a short blog post or note</strong> about something you just learned. Writing forces clear thinking.</li><li><strong>Comment your code in plain English.</strong> If you can’t describe what a function does in one sentence, it may be doing too much.</li><li><strong>Explain it to a friend</strong> who doesn’t code. If they follow, you’ve got it.</li><li><strong>Record a 2-minute voice note</strong> explaining a concept without looking at notes.</li></ul><h3>Why this works</h3><p>Reading feels productive because it’s easy. But easy learning is shallow learning. The Feynman Technique works because it forces <strong><em>retrieval</em></strong> (pulling the idea out of your head) and <strong><em>reconstruction</em></strong> (rebuilding it in your words). Those two efforts are what turn short-term familiarity into long-term memory.</p><p>The uncomfortable moment when you realize you can’t explain something is not a failure. <strong>It’s the technique doing its job.</strong></p><p><em>I’m Kenan — a self-taught frontend developer writing honestly about what the learning journey actually looks like. To discover more fascinating articles, follow me!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e06faba0643" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art of Writing Readable CSS]]></title>
            <link>https://medium.com/@kenankarakashli/the-art-of-writing-readable-css-beec6047ab20?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/beec6047ab20</guid>
            <category><![CDATA[reable-code]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Fri, 09 Oct 2026 18:38:59 GMT</pubDate>
            <atom:updated>2026-10-09T18:38:59.205Z</atom:updated>
            <content:encoded><![CDATA[<p><em>CSS that works is easy. CSS that you can still understand three months later is the real skill. Here are the habits that make the difference.</em></p><p>Most CSS problems aren’t technical. They’re <em>readability</em> problems.</p><p>You open a stylesheet you wrote a few weeks ago and find <strong>.box2, .new-container, !important</strong> scattered everywhere, and a selector so long you need to scroll sideways. Nothing is broken, exactly. Simply put, you dare not touch it.</p><p>Readable CSS isn’t about being clever, after all. It’s about making the next change (yours or someone else’s) safe and boring. These are the habits that take you there.</p><h3>1. Name things by what they are, not how they look</h3><pre>/* ❌ Describes appearance. Breaks the moment the design changes */<br>.red-big-text { color: red; font-size: 32px; }<br><br>/* ✅ Describes purpose. Survives a redesign */<br>.page-title { color: var(--color-danger); font-size: var(--text-xl); }</pre><p>If you redesign and .red-big-text becomes blue and small, the name now lies. A name that describes the <em>role</em> stays true.</p><p><strong>The analogy:</strong> label a moving box “kitchen,” not “heavy brown box.”</p><h3>2. Use custom properties for repeated values</h3><p>Every time you type #3b82f6 for the fifth time, you’ve created five places to change later.</p><pre>:root {<br>  --color-primary: #3b82f6;<br>  --color-text: #1f2937;<br>  --space-sm: 8px;<br>  --space-md: 16px;<br>  --radius: 8px;<br>}<br><br>.button {<br>  background: var(--color-primary);<br>  padding: var(--space-sm) var(--space-md);<br>  border-radius: var(--radius);<br>}</pre><p>Change one line, and the whole site updates. It also makes your CSS read like a design system instead of a pile of numbers.</p><h3>3. Keep selectors short and flat</h3><p>Long selectors are fragile because they tie your styles to the exact HTML structure.</p><pre>/* ❌ Breaks if you add a wrapper div */<br>.main .sidebar ul li a span { color: gray; }<br><br>/* ✅ One class, no structure assumptions */<br>.sidebar-link-label { color: gray; }</pre><p>A good rule: if a selector is longer than about three parts, ask whether a class would be simpler.</p><h3>4. Avoid !important (it’s a sign something else is wrong).</h3><p><strong>!important</strong> doesn’t fix a specificity problem. It hides it, and the next fix needs another important one on top.</p><pre>/* ❌ The start of an arms race */<br>.button { color: white !important; }<br><br>/* ✅ Find out *why* your rule is losing, then fix the selector order or specificity */</pre><p>When your style isn’t applying, open your browser’s DevTools, look at the crossed-out rules, and find which one is winning. That’s almost always faster than reaching for<strong> !important.</strong></p><h3>5. Organize with a consistent order</h3><p>You don’t need a fancy system. You need <em>a</em> system applied every time. One simple order:</p><pre>.card {<br>  /* 1. Layout */<br>  display: flex;<br>  flex-direction: column;<br>  gap: var(--space-md);<br><br>  /* 2. Box model */<br>  padding: var(--space-md);<br>  border-radius: var(--radius);<br><br>  /* 3. Typography */<br>  font-size: var(--text-md);<br><br>  /* 4. Visual */<br>  background: white;<br>  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);<br>}</pre><p>When every rule follows the same order, your eyes learn where to look.</p><h3>6. Group by component, and comment on the sections</h3><pre>/* ===== Buttons ===== */<br>.button { ... }<br>.button--secondary { ... }<br><br>/* ===== Cards ===== */<br>.card { ... }<br>.card__title { ... }</pre><p>Keep everything about one component together. Don’t scatter button styles across the file. A short section comment is the simplest navigation system you can use.</p><h3>7. Pick a naming convention and stick to it</h3><p>You don’t have to use BEM, but its idea helps: <strong>block</strong>, <strong>element, and</strong> <strong>modifier</strong>.</p><pre>.card { }            /* the block */<br>.card__title { }     /* an element inside it */<br>.card--featured { }  /* a variation of it */</pre><p>Even if you invent your style, the point is that someone reading it will know immediately where it belongs <strong>.card__title</strong> knows immediately where it belongs.</p><h3>8. Delete dead CSS</h3><p>Unused styles are noise. Every rule you keep is something you will have to read and wonder about in the future.</p><p>If you’re not sure a rule is used, search the project for its class name. No matches? Delete it. Version control remembers it if you ever need it back.</p><h3>A quick readability checklist</h3><p>Before you commit your CSS, ask:</p><ul><li>Could someone understand this class name without seeing the design?</li><li>Are repeated values in variables?</li><li>Is any selector longer than three parts?</li><li>Did I use <strong>!important</strong>? Why?</li><li>Is the related code grouped?</li><li>Is anything unused?</li></ul><h3>The bottom line</h3><p>Readable CSS is based on one principle: <strong>write for the person who reads it next.</strong> That person is usually you, worn out after three months.</p><p>You don’t have to apply all eight habits today. Pick one (I’d start with custom properties) and use it on your next project. Small habits compound faster than big rewrites.</p><p><em>I’m Kenan — a self-taught frontend developer writing about the things I had to learn the hard way. To discover more fascinating articles, follow me!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=beec6047ab20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Honest Review of Learning React as a Self-Taught Dev]]></title>
            <link>https://medium.com/@kenankarakashli/my-honest-review-of-learning-react-as-a-self-taught-dev-1d77d5fb29b9?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d77d5fb29b9</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 18:16:45 GMT</pubDate>
            <atom:updated>2026-10-02T18:16:45.295Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Not a tutorial. Not a hype piece. Just an honest account of what it actually felt like to learn React without a teacher, a bootcamp, or anyone to tell me I was doing it right.</em></p><p>React has a PR problem.</p><p>Half the internet will tell you it’s the most important skill a frontend developer can have. The other half will tell you it’s overengineered, that you should use vanilla JavaScript, that the ecosystem is a mess, that the docs keep changing, and that you’ll spend more time fighting the tooling than writing actual features.</p><p>Both sides are kind of right. Neither side is particularly useful if you’re a self-taught developer trying to figure out whether to learn it and what to expect when you do.</p><p>So here’s my honest take — as someone who learned React without a course, without a mentor, and without anyone telling me whether I was making progress or just going in circles.</p><h3>First Impressions: Excited and Confused at the Same Time</h3><p>The first time I saw React code, I genuinely didn’t know what I was looking at.</p><pre>function App() {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Hello, world&lt;/h1&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>I knew HTML. I knew JavaScript. But <em>HTML inside a JavaScript function?</em> My brain rejected it. It looked like a typo. It looked like someone had accidentally merged two files.</p><p>JSX is React’s biggest first-impression problem for self-taught developers — because nothing in your prior experience prepares you for it. You don’t learn it gradually. You encounter it all at once, on the first line, and you either make peace with it quickly or you spend a week feeling like you’re missing something everyone else was told.</p><p>Nobody told me. I just had to sit with the discomfort until it became familiar.</p><p>And it did. Eventually JSX stopped feeling weird and started feeling natural — like how a new city feels disorienting for a week and then suddenly you know where everything is without thinking about it.</p><p><strong>Verdict on JSX:</strong> Annoying for about a week. Fine after that. Not worth worrying about.</p><h3>The Learning Curve Is Real, But It’s Not Where You Think</h3><p>Here’s what everyone gets wrong about the React learning curve: it’s not React itself that’s actually the challenge. The core API is genuinely small — components, props, state, and effects. You can learn those concepts in a few focused days.</p><p>The real challenge is everything around React.</p><p><strong>State management.</strong> Do you use useState? useReducer? Context API? Redux? Zustand? Jotai? Every tutorial has a different opinion, and as a beginner, you have no way to evaluate which advice applies to you.</p><p><strong>Project setup.</strong> Do you use Create React App (which most tutorials use but is now semi-deprecated)? Vite? Next.js? What’s the difference? Why does everyone keep mentioning Next.js? Should you learn that first or after?</p><p><strong>The ecosystem.</strong> React Router for routing. React Query or SWR for data fetching. Styled Components or Tailwind or CSS Modules for styling. Each of these is its own thing to learn. Each of them has opinionated communities online. None of them come with React itself.</p><p>As a self-taught developer, I find this ecosystem overwhelming; it’s the real wall. Not hooks. Not the virtual DOM. Just the sheer number of decisions you have to make before you can build anything real.</p><p><strong>My honest advice:</strong> Start with Vite for setup. Use useState and useEffect until they feel boring. Don’t touch state management libraries until you’ve built something real that actually needs them. Ignore Next.js until you understand React first.</p><h3>What Nobody Told Me About Hooks</h3><p>When React introduced hooks in 2019, it was a major change — they replaced the old class-based component model with something cleaner and more composable. By the time I was learning React, hooks were already the standard. Class components were technically still supported but effectively legacy.</p><p><strong>The problem:</strong> a huge portion of tutorials online still use class components. So as a beginner searching for help, you often found code that looked nothing like what you were writing. Same framework, completely different syntax.</p><p>This is a specific self-taught developer tax that people in structured programs don’t pay. If you have an instructor, they tell you which resources to use. If you’re on your own, you waste hours figuring out why the Stack Overflow answer doesn’t match your code — only to realize it was written in 2017.</p><p><strong>Survival tip:</strong> Before following any tutorial or copying any Stack Overflow answer, check the date. If it’s before 2019, be cautious. If it’s before 2017, skip it entirely.</p><h3>The Moment It Clicked</h3><p>I can tell you exactly when React stopped being a set of rules I was following and became a way of thinking.</p><p>I was building a small project — a personal dashboard, nothing fancy. I needed to show a list of items, let the user filter them, and update a count somewhere else on the page when the filter changed.</p><p>In vanilla JavaScript, I would have grabbed DOM elements, attached event listeners, and manually updated the count. I’d done this pattern dozens of times.</p><p>But in React, I realized I didn’t need to think about <em>updating</em> anything. I just needed to describe what the UI should look like <em>given the current state — and</em> React would handle the rest.</p><pre>const filteredItems = items.filter(item =&gt; item.category === selectedCategory);<br>const count = filteredItems.length;<br><br>return (<br>  &lt;div&gt;<br>    &lt;p&gt;{count} items&lt;/p&gt;<br>    &lt;ItemList items={filteredItems} /&gt;<br>  &lt;/div&gt;<br>);</pre><p>No manual DOM manipulation. No “find the element and change its text.” Just: <em>here’s the data, and here’s what the UI should look like based on that data.</em></p><p>That shift — from imperative (“do this, then this, then that”) to declarative (“this is what it should look like”) — is what you’re really learning when you learn React. Once it clicks, you can’t un-click it. And you start wondering how you ever built UIs any other way.</p><h3>The Honest Frustrations</h3><p>I want to be fair to people who find React frustrating — because they’re right to be frustrated.</p><p><strong>useEffect is genuinely confusing.</strong> The dependency array, the cleanup function, the infinite loop you accidentally create when you put the wrong thing in the array — these are legitimately hard concepts, and the error messages React gives you don’t always help. I’ve seen experienced developers get useEffect wrong. If it confuses you, you’re not alone.</p><p><strong>Performance is an afterthought at first and a rabbit hole later.</strong> When you start learning React, you don’t think about re-renders. Then one day you build something slightly complex, and it feels slow, and you go down the useMemo / useCallback / React.memo rabbit hole and come out three hours later more confused than when you started. This is a common experience. Most applications don’t need premature optimization — but nobody tells you that early enough.</p><h3>Who React Is Actually For</h3><p>After all of it — the confusion, the ecosystem overwhelm, the useEffect frustrations, and the eventual clarity — here’s my honest take on who should learn React:</p><p><strong>Learn React if:</strong> You want to build dynamic, interactive web apps. You’re aiming for a frontend developer role (the job market rewards React knowledge significantly). You like thinking in components and want a framework that has a massive community behind it.</p><p><strong>Don’t rush to React if:</strong> You’re still fuzzy on JavaScript fundamentals — async/await, array methods, how this works, and how modules work. React will not teach you JavaScript. It will punish you for not knowing it.</p><p><strong>Consider alternatives if:</strong> You want something with a gentler learning curve (Vue), more built-in opinions (Svelte, Angular), or a full-stack solution from the start (Next.js — though that’s built on React anyway).</p><h3>Would I Do It Again?</h3><p>Yes. Without hesitation.</p><p>Not because React is perfect — it isn’t. Not because the ecosystem isn’t overwhelming — it is. But because learning React taught me how to think about UI in a way that transfers everywhere. The component mindset, the declarative approach, and the separation of data from presentation — these aren’t React-specific ideas. They’re the architecture of modern frontend development.</p><p>Also, as a self-taught developer, the single best thing about React is the size of the community. When you get stuck — and you will — someone on Stack Overflow, GitHub, or Reddit has been stuck in the same place and written about it. That documentation of collective struggle is invaluable when you don’t have a teacher to ask.</p><p>The path isn’t clean. The ecosystem is messy. The learning curve bends in unexpected places.</p><p>But if you stick with it long enough to have your own “wait, I get it” moment — the one where declarative rendering suddenly makes sense — React will change how you see frontend development entirely.</p><p>That’s worth the frustration.</p><p><em>I’m Kenan — a self-taught frontend developer writing honestly about what the learning journey actually looks like. To discover more fascinating articles, follow me!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d77d5fb29b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 React Patterns I Wish I Knew Earlier]]></title>
            <link>https://medium.com/@kenankarakashli/5-react-patterns-i-wish-i-knew-earlier-22676e917647?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/22676e917647</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 19:15:51 GMT</pubDate>
            <atom:updated>2026-09-25T19:15:51.631Z</atom:updated>
            <content:encoded><![CDATA[<p><em>These aren’t advanced concepts for senior engineers. They’re the patterns that make your React code feel like it was written by someone who actually knows what they’re doing — and I wish someone had shown me all five on day one.</em></p><p>When I first learned React, I learned the mechanics.</p><p>Components. Props. State. useEffect. The JSX syntax looks weird until one day it suddenly makes sense. I understood <em>how</em> React worked.</p><p>What I didn’t understand was <em>how to think in React</em>. How to structure components so they don’t become 300-line monsters. How to share logic without copy-pasting it everywhere. How to write code that a future version of me won’t resent in silence.</p><p>That understanding didn’t come from tutorials. It came from building real things, making a mess, and slowly discovering that other developers had already solved the exact problems I was solving — and named the solutions.</p><p>These are the five patterns I kept running into. Now you don’t have to.</p><h3>Pattern 1: Custom Hooks — Give Your Logic a Home</h3><p><strong>The problem:</strong> You’re fetching data in a component. It works. Then you need to fetch similar data somewhere else. So you copy the whole useEffect + useState block and paste it into the new component. Now you have two copies of the same logic. Two places to update when something changes. Two places to break.</p><p><strong>The pattern:</strong> Pull that logic out into a <strong>custom hook — a</strong> regular JavaScript function that starts with use and can call other hooks inside it.</p><p><strong>Here’s the before:</strong></p><pre>// ProductPage.jsx<br>function ProductPage() {<br>  const [product, setProduct] = useState(null);<br>  const [loading, setLoading] = useState(true);<br>  const [error, setError] = useState(null);<br><br>  useEffect(() =&gt; {<br>    fetch(&#39;/api/product/1&#39;)<br>      .then(res =&gt; res.json())<br>      .then(data =&gt; {<br>        setProduct(data);<br>        setLoading(false);<br>      })<br>      .catch(err =&gt; {<br>        setError(err);<br>        setLoading(false);<br>      });<br>  }, []);<br><br>  if (loading) return &lt;p&gt;Loading...&lt;/p&gt;;<br>  if (error) return &lt;p&gt;Something went wrong.&lt;/p&gt;;<br>  return &lt;div&gt;{product.name}&lt;/div&gt;;<br>}</pre><p><strong>And after:</strong></p><pre>// hooks/useFetch.js<br>function useFetch(url) {<br>  const [data, setData] = useState(null);<br>  const [loading, setLoading] = useState(true);<br>  const [error, setError] = useState(null);<br><br>  useEffect(() =&gt; {<br>    fetch(url)<br>      .then(res =&gt; res.json())<br>      .then(data =&gt; {<br>        setData(data);<br>        setLoading(false);<br>      })<br>      .catch(err =&gt; {<br>        setError(err);<br>        setLoading(false);<br>      });<br>  }, [url]);<br><br>  return { data, loading, error };<br>}<br><br>// ProductPage.jsx — now clean and reusable<br>function ProductPage() {<br>  const { data: product, loading, error } = useFetch(&#39;/api/product/1&#39;);<br><br>  if (loading) return &lt;p&gt;Loading...&lt;/p&gt;;<br>  if (error) return &lt;p&gt;Something went wrong.&lt;/p&gt;;<br>  return &lt;div&gt;{product.name}&lt;/div&gt;;<br>}</pre><p>Now useFetch can be used in <em>any</em> component. Change the fetching logic once, and it updates everywhere.</p><p><strong>The mental model:</strong> A custom hook is a backpack. Instead of carrying the same tools in your hands every time you go on a hike, you pack them once and bring the backpack. The tools are the same — you’ve just given them a better home.</p><h3>Pattern 2: Component Composition — Stop Drilling Props</h3><p><strong>The problem:</strong> You build a Card component. It needs a title, a subtitle, an image, some body text, and a footer with two buttons. So you add props for each one. The component signature starts looking like this:</p><pre>&lt;Card<br>  title=&quot;Hello&quot;<br>  subtitle=&quot;World&quot;<br>  imageUrl=&quot;/photo.jpg&quot;<br>  bodyText=&quot;Some content here&quot;<br>  primaryButtonText=&quot;Save&quot;<br>  onPrimaryClick={handleSave}<br>  secondaryButtonText=&quot;Cancel&quot;<br>  onSecondaryClick={handleCancel}<br>  showFooter={true}<br>  footerVariant=&quot;dark&quot;<br>/&gt;</pre><p>This is <strong>prop drilling — and</strong> it makes components rigid, hard to customize, and painful to maintain.</p><p><strong>The pattern:</strong> Use <strong>composition</strong>. Instead of passing everything as props, let the parent component <em>build</em> the structure using children.</p><pre>// Instead of one giant component with 10 props...<br>function Card({ children }) {<br>  return &lt;div className=&quot;card&quot;&gt;{children}&lt;/div&gt;;<br>}<br><br>function CardHeader({ children }) {<br>  return &lt;div className=&quot;card-header&quot;&gt;{children}&lt;/div&gt;;<br>}<br><br>function CardBody({ children }) {<br>  return &lt;div className=&quot;card-body&quot;&gt;{children}&lt;/div&gt;;<br>}<br><br>function CardFooter({ children }) {<br>  return &lt;div className=&quot;card-footer&quot;&gt;{children}&lt;/div&gt;;<br>}<br><br>// Now at the usage site — total control, zero prop gymnastics<br>&lt;Card&gt;<br>  &lt;CardHeader&gt;<br>    &lt;h2&gt;Hello&lt;/h2&gt;<br>    &lt;p&gt;World&lt;/p&gt;<br>  &lt;/CardHeader&gt;<br>  &lt;CardBody&gt;<br>    &lt;img src=&quot;/photo.jpg&quot; alt=&quot;photo&quot; /&gt;<br>    &lt;p&gt;Some content here&lt;/p&gt;<br>  &lt;/CardBody&gt;<br>  &lt;CardFooter&gt;<br>    &lt;button onClick={handleCancel}&gt;Cancel&lt;/button&gt;<br>    &lt;button onClick={handleSave}&gt;Save&lt;/button&gt;<br>  &lt;/CardFooter&gt;<br>&lt;/Card&gt;</pre><p><strong>The mental model:</strong> Think of LEGO bricks. A rigid prop-heavy component is a pre-built LEGO set — you can only build the castle on the box. Composition is a bucket of individual bricks — you can build anything.</p><h3>Pattern 3: Early Returns — Flatten Your JSX</h3><p><strong>The problem:</strong> The more conditions your component handles, the more nested your JSX becomes. Loading state, error state, empty state, authenticated vs. unauthenticated — nest enough of these and you end up with something that looks like a pyramid:</p><pre>function UserProfile({ user, loading, error }) {<br>  return (<br>    &lt;div&gt;<br>      {loading ? (<br>        &lt;p&gt;Loading...&lt;/p&gt;<br>      ) : error ? (<br>        &lt;p&gt;Error!&lt;/p&gt;<br>      ) : user ? (<br>        &lt;div&gt;<br>          {user.isAdmin ? (<br>            &lt;div&gt;<br>              &lt;h1&gt;{user.name}&lt;/h1&gt;<br>              &lt;AdminPanel /&gt;<br>            &lt;/div&gt;<br>          ) : (<br>            &lt;h1&gt;{user.name}&lt;/h1&gt;<br>          )}<br>        &lt;/div&gt;<br>      ) : (<br>        &lt;p&gt;No user found.&lt;/p&gt;<br>      )}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>Reading this is like untangling headphones. Don’t do this to your future self.</p><p><strong>The pattern:</strong> Handle each case early and return immediately, so the main render is only reached when everything is ready.</p><pre>function UserProfile({ user, loading, error }) {<br>  if (loading) return &lt;p&gt;Loading...&lt;/p&gt;;<br>  if (error) return &lt;p&gt;Error!&lt;/p&gt;;<br>  if (!user) return &lt;p&gt;No user found.&lt;/p&gt;;<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{user.name}&lt;/h1&gt;<br>      {user.isAdmin &amp;&amp; &lt;AdminPanel /&gt;}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>Same logic. Half the lines. Infinitely more readable.</p><p><strong>The mental model:</strong> A bouncer at a club doesn’t let everyone in and then sort them out inside. They check each condition at the door — no ID, no entry; too young, go home; on the list, come in. Early returns are your bouncer.</p><h3>Pattern 4: State Colocation — Keep State Close to Where It Lives</h3><p><strong>The problem:</strong> When you first learn React, you’re tempted to lift <em>all</em> state to the top of the component tree. One big parent holds everything, and props rain down to all the children. It seems organized. In fact, it’s chaos.</p><p>Every state update re-renders the whole tree. Passing state through three layers of components for something that only one component actually uses. Debugging requires tracing a prop through four files.</p><p><strong>The pattern:</strong> Keep state as close as possible to the component that actually uses it. Only lift it when two or more components genuinely need to share it.</p><pre>// ❌ Don&#39;t lift state you don&#39;t need to share<br>function App() {<br>  const [isMenuOpen, setIsMenuOpen] = useState(false); // only Navbar uses this<br>  const [searchQuery, setSearchQuery] = useState(&#39;&#39;);   // only SearchBar uses this<br><br>  return (<br>    &lt;&gt;<br>      &lt;Navbar isMenuOpen={isMenuOpen} setIsMenuOpen={setIsMenuOpen} /&gt;<br>      &lt;SearchBar searchQuery={searchQuery} setSearchQuery={setSearchQuery} /&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>// ✅ Let each component own its own state<br>function Navbar() {<br>  const [isMenuOpen, setIsMenuOpen] = useState(false); // lives here, used here<br>  // ...<br>}<br><br>function SearchBar() {<br>  const [searchQuery, setSearchQuery] = useState(&#39;&#39;);  // lives here, used here<br>  // ...<br>}</pre><p><strong>The mental model:</strong> Don’t store your housemate’s keys in <em>your</em> drawer just because it feels tidy. They know where their keys are. Only share storage when you actually need to share access.</p><h3>Pattern 5: Derived State — Don’t Duplicate What You Can Calculate</h3><p><strong>The problem:</strong> You have a list of items in state. You also want to know how many are selected. So you create <em>another</em> piece of state to track the count — and now you have two sources of truth that need to stay in sync.</p><pre>// ❌ Two pieces of state that should be one<br>const [items, setItems] = useState([...]);<br>const [selectedCount, setSelectedCount] = useState(0);<br><br>function handleSelect(id) {<br>  const updated = items.map(item =&gt;<br>    item.id === id ? { ...item, selected: !item.selected } : item<br>  );<br>  setItems(updated);<br>  setSelectedCount(updated.filter(i =&gt; i.selected).length); // easy to forget<br>}</pre><p>If you ever update items without updating selectedCount, your UI lies to your users.</p><p><strong>The pattern:</strong> Derive values from the existing state instead of storing them separately. JavaScript runs fast — calculating a count or a filtered list on every render costs almost nothing.</p><pre>// ✅ One source of truth<br>const [items, setItems] = useState([...]);<br><br>// Derived — calculated fresh every render, always accurate<br>const selectedCount = items.filter(item =&gt; item.selected).length;<br>const selectedItems = items.filter(item =&gt; item.selected);<br><br>function handleSelect(id) {<br>  setItems(items.map(item =&gt;<br>    item.id === id ? { ...item, selected: !item.selected } : item<br>  ));<br>  // selectedCount updates automatically — no extra step, no sync issues<br>}</pre><p><strong>The mental model:</strong> Don’t keep a sticky note on your fridge that says “I have 4 apples.” Just count the apples when you need to know. The sticky note will eventually be wrong. The apples won’t lie.</p><h3>The Common Thread</h3><p>Look at what all five patterns have in common:</p><ul><li><strong>Custom Hooks</strong> — one home for logic</li><li><strong>Composition</strong> — one responsibility per component</li><li><strong>Early Returns</strong> — one level of concern at a time</li><li><strong>State Colocation</strong> — one owner per piece of state</li><li><strong>Derived State</strong> — one source of truth</li></ul><p>React rewards simplicity. At its core, each of these patterns is about <em>not doing more than you need to</em>. Not storing what you can calculate. Not passing what you can colocate. Not nesting what you can flatten.</p><p>The most experienced React developers I’ve come across don’t write the most complex code. They write the least complex code that still does the job — and these patterns are how they do it.</p><h3>Start With One</h3><p>Don’t try to apply all five tomorrow. Pick the one that hurts the most right now in your current codebase and start there.</p><p>For most beginners, that’s <strong>Pattern 1</strong> (Custom Hooks) or <strong>Pattern 3</strong> (Early Returns) — because the gains are immediate and visible.</p><p>Once those feel natural, the others will start to make sense.</p><p><em>I’m Kenan — a self-taught frontend developer writing about the things I had to learn the hard way. To discover more fascinating articles, follow me!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22676e917647" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS Grid vs Flexbox — When to Use Which (With Visual Diagrams)]]></title>
            <link>https://medium.com/@kenankarakashli/css-grid-vs-flexbox-when-to-use-which-with-visual-diagrams-626bff9da94b?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/626bff9da94b</guid>
            <category><![CDATA[css-grid]]></category>
            <category><![CDATA[flexbox]]></category>
            <category><![CDATA[grid]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Tue, 15 Sep 2026 19:35:36 GMT</pubDate>
            <atom:updated>2026-09-15T19:35:36.727Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Two of the most powerful layout tools in CSS. But most developers either use one for everything or spend 20 minutes second-guessing which to pick. Here’s the mental model that makes the decision instant.</em></p><p>If you’ve been writing CSS for more than a week, you’ve met both of these:</p><pre>display: flex;<br>display: grid;</pre><p>And if you’re honest, you’ve probably done what most developers do — pick whichever one you learned first and hammer everything with it until it (kind of) works.</p><p>I did that for a long time. Flexbox was my default. Grid felt intimidating. I’d open a Grid tutorial, see terms like fr, auto-fill, minmax, and quietly close the tab.</p><p>But once I understood the <em>core difference</em> between them — not the syntax, but the <strong>thinking</strong> behind each — everything clicked. And now choosing between them takes about three seconds.</p><p>Let me show you the mental model.</p><h3>The One Sentence That Changes Everything</h3><blockquote><strong><em>Flexbox is for one direction. Grid is for two directions.</em></strong></blockquote><p>That’s it. That’s the whole thing.</p><p>Flexbox operates on a single axis, which can be either a row or a column. Grid, on the other hand, considers both rows and columns simultaneously.</p><p>Everything else — every property, every use case — flows from this one idea.</p><h3>Flexbox: The Line Thinker</h3><p>Imagine you have a line of items and you need to arrange them along that line — spacing them out, aligning them, wrapping them if they overflow. That’s Flexbox’s entire world.</p><pre><br>[Item 1]   [Item 2]   [Item 3]   [Item 4]<br></pre><p>Flexbox asks: <em>“How should these items sit along this one line?”</em></p><p>It can wrap to a second line when items overflow:</p><pre><br>[Item 1]  [Item 2]  [Item 3]<br>[Item 4]  [Item 5]          <br></pre><p>But here’s the catch — <strong>each row is independent</strong>. Flexbox doesn’t know or care what’s happening in the row above or below. The items in row 2 have no relationship to the items in row 1.</p><p>This is Flexbox’s strength <em>and</em> its limitation.</p><h3>Where Flexbox Shines</h3><p><strong>Navigation bars</strong> — a classic. A logo on the left, links in the middle, a button on the right.</p><pre> [Logo]        [Home] [About] [Blog]  [CTA]  <br></pre><pre>nav {<br>  display: flex;<br>  justify-content: space-between;<br>  align-items: center;<br>}</pre><p><strong>Button groups</strong> — a row of actions that need even spacing.</p><pre>[Cancel]    [Save Draft]  [Publish]</pre><p><strong>Card content layout</strong> — the <em>inside</em> of a card, where you want an icon, text, and a link stacked or side by side.</p><pre>🔔 Notification text [Dismiss]  </pre><p><strong>Centering a single item</strong> — the eternal CSS pain, solved forever:</p><pre>.container {<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>}</pre><h3>Grid: The Blueprint Thinker</h3><p>Imagine yourself as an architect carefully creating a floor plan for a building. You carefully describe the rooms, including their size and location. You then carefully arrange the components inside this structure. The content follows the framework, which acts as the foundation. That’s Grid.</p><pre><br>                             <br>  Column 1     Column 2    Column 3 <br>                            <br> ───────────┼───────────┼───────────<br><br>  Column 1     Column 2    Column 3<br>                             <br></pre><p>Grid asks: <em>“What does the whole layout look like, and where does each piece belong?”</em></p><p>The killer feature is that items <strong>share a coordinate system</strong>. Column 1 in row 1 is perfectly aligned with column 1 in row 2 — always. You can even span items across multiple columns or rows.</p><h3>Where Grid Shines</h3><p><strong>Full-page layouts:</strong> the overall design of your website or application.</p><pre>.page {<br>  display: grid;<br>  grid-template-columns: 250px 1fr;<br>  grid-template-rows: 60px 1fr 40px;<br>  grid-template-areas:<br>    &quot;header  header&quot;<br>    &quot;sidebar content&quot;<br>    &quot;footer  footer&quot;;<br>}</pre><p><strong>Card grids</strong> — where you want cards to align in <em>both</em> rows and columns.</p><pre>.card-grid {<br>  display: grid;<br>  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));<br>  gap: 24px;<br>}</pre><p>Notice how every card is the <em>same width</em>, and every row is the <em>same height</em>. That’s Grid enforcing the two-dimensional structure that Flexbox can’t.</p><p><strong>Dashboard layouts</strong> — widgets of different sizes, all snapping to a shared grid.</p><h3>The “Both at Once” Secret</h3><p>Here’s something beginners often miss: <strong>you don’t have to choose globally</strong>.</p><p>The best layouts use both together — Grid for the macro structure, Flexbox for the micro layout inside each piece.</p><p>The page is a Grid. The sidebar links are Flexbox. The card gallery is Grid. The inside of each card is Flexbox. It all works together perfectly.</p><h3>Quick Syntax Cheat Sheet</h3><h3>Flexbox essentials</h3><pre>.container {<br>  display: flex;<br>  flex-direction: row;          /* or column */<br>  justify-content: space-between; /* main axis */<br>  align-items: center;          /* cross axis */<br>  gap: 16px;<br>  flex-wrap: wrap;              /* allow wrapping */<br>}</pre><h3>Grid essentials</h3><pre>.container {<br>  display: grid;<br>  grid-template-columns: 1fr 2fr 1fr; /* 3 columns */<br>  grid-template-rows: auto;<br>  gap: 24px;<br>}</pre><p>If you remember nothing else, <strong>remember this picture</strong>:</p><p><strong>Flexbox = shelf</strong>. You&#39;ve got everything sitting on a single shelf, and you decide how it&#39;s spaced, how it&#39;s aligned on that shelf.</p><p><strong>Spreadsheet = grid.</strong> First you construct rows and columns, and then you add items in the cells. Items can span cells.</p><p>A shelf is good for one row of goods. Spreadsheet is wonderful when you want everything to line up in<strong> 2-d.</strong></p><h3>Wrapping Up</h3><p>The next time you open a new CSS file and start laying out a component, pause for three seconds and ask: <em>“Am I thinking about a line, or a blueprint?”</em></p><ul><li>Line → Flexbox</li><li>Blueprint → Grid</li><li>Both? Use Grid for the outer structure, Flexbox for the inner pieces.</li></ul><p>That’s all the decision-making you actually need.</p><p>The syntax follows once you know what you’re trying to build. And with enough practice, reaching for the right tool starts to feel as natural as choosing a fork over a spoon.</p><p><em>I’m Kenan — a self-taught frontend developer who believes visual thinking is the fastest path to understanding code. If you found this useful, follow for more posts like this.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=626bff9da94b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Most Coding Tutorials Fail You (And What to Do Instead)]]></title>
            <link>https://medium.com/@kenankarakashli/why-most-coding-tutorials-fail-you-and-what-to-do-instead-97dc3fac9783?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/97dc3fac9783</guid>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 19:58:19 GMT</pubDate>
            <atom:updated>2026-09-01T20:53:52.571Z</atom:updated>
            <content:encoded><![CDATA[<p><em>You’ve followed dozens of tutorials. You can copy the code. But the moment you close the tab and open a blank file, your mind goes blank too. Read on to find out why that happens and how to finally break the cycle.</em></p><p>Every self-taught developer knows the special kind of frustration that comes with it.</p><p>You find a tutorial. It’s well-produced, the instructor is clear, and the code works. You follow along step by step, nodding your head, thinking, <em>“Yes! I get this!” — and</em> by the end, you’ve built something real. A to-do app. A weather widget. A landing page.</p><p>Then you close the tab.</p><p>And when you sit down the next day to build something <em>on your own — even something simpler — </em>you feel like you’ve never written a line of code in your life.</p><p>If that sounds familiar, you’re not broken. And you’re definitely not alone.</p><p>The problem isn’t you. <strong>It’s the tutorial format itself.</strong></p><h3>The Illusion of Understanding</h3><p>Cognitive scientists call it “<strong>the fluency illusion</strong>” — the feeling that because something is deceptively simple to follow, you actually understand it.</p><p>Think about it this way: watching someone parallel park a car looks effortless. You can follow every movement—turn the wheel left, reverse slowly, and straighten out. But watching it a hundred times doesn’t mean you can do it yourself the first time you’re behind the wheel.</p><p>Tutorials create the same illusion with code too.</p><p>When an instructor types “useState” and explains what it does, your brain goes <em>“got it” — because</em> in that moment, you do. The explanation makes sense. The example is right in front of you. You’re not struggling, so it <em>feels</em> like learning.</p><p>But struggling is precisely what learning requires.</p><h3>The Real Problem: Passive vs Active Learning</h3><p>Most tutorials are designed to be <strong>watched</strong>, not wrestled with.</p><p>They optimize for ease of use and clarity. Each variable has a pre-name. All edge cases are managed off-screen. Before you even notice it, every bug is captured. The entire route is perfectly level, well-lit, and paved.</p><p>Real coding is the opposite. Real coding is choosing your own variable names, hitting errors you’ve never seen before, Googling things at 11 pm, and slowly figuring out <em>why</em> something works — not just <em>that</em> it works.</p><p>The gap between tutorial land and the real world isn’t a skill gap. It’s an experience gap. And you can only close it by getting off the paved path.</p><h3>What Actually Works: The Three Shifts</h3><h3>1. Stop following. Start breaking.</h3><p>The next time you finish a tutorial project, don’t just move on. Instead, <strong>break it on purpose</strong>.</p><p>Delete a function and rewrite it from scratch. Add a feature that wasn’t in the tutorial. Change how the data flows. Make it do something the instructor never showed you.</p><p>Real learning occurs when you are forced to think independently, and your mental model is put to the test.</p><p>A recipe analogy: following a recipe teaches you the steps. But when you run out of an ingredient and have to substitute, you start to understand cooking.</p><h3>2. Build boring things.</h3><p>There’s a seductive trap in the tutorial world: always chasing the cool project. The AI chatbot. The 3D animation and many others.</p><p>The problem is that impressive projects are complex, and complexity hides the fundamentals.</p><p>Some of the most valuable things I’ve built have been embarrassingly simple:</p><ul><li>A counter with undo/redo</li><li>A form with real validation logic I wrote myself</li></ul><p>Simple projects make you learn the why behind the code because there is nothing flashy to hide behind.</p><h3>3. Teach it before you think you’re prepared.</h3><p>This one sounds backwards, but it’s the most powerful technique I know.</p><p>After learning something new, try to explain it—out loud, in writing, to a friend, or even to a rubber duck on your desk. The moment you try to explain a concept, every gap in your understanding becomes obvious instantly.</p><p>This is the core of the <strong>Feynman Technique</strong>, named after physicist Richard Feynman. His rule was simple: if you can’t explain something simply, you don’t understand it yet.</p><p>Writing a blog post about what you learned. Recording a short video. Sending a voice note to a developer friend. These aren’t just nice-to-haves. They’re the fastest way to turn shaky tutorial knowledge into something that actually sticks.</p><p><em>(Hint: this is literally why you’re reading this post right now.)</em></p><h3>The Bigger Picture</h3><p>I’ve been thinking a lot about <em>why</em> coding education is so often frustrating, and I believe the tutorial format—as useful as it is—was never designed to build independent developers. It was designed to demonstrate. To show. To explain.</p><p>But showing someone how to swim from the poolside will only take them so far.</p><p>What people actually need is a way to get in the water, struggle a little, and have something catch them when they’re about to go under—not do the swimming for them.</p><p>That’s a harder problem to solve. And it’s one I’m genuinely obsessed with solving.</p><p>More on that soon.</p><h3>The Bottom Line</h3><p>If you’ve been stuck in tutorial hell, here’s what you should take away:</p><ul><li><strong>You’re not slow.</strong> Tutorials are designed to feel straightforward—that&#39;s the trap.</li><li><strong>Struggle is the signal.</strong> When something is challenging, that’s where the learning is.</li><li><strong>Build ugly, simple things.</strong> Complexity is the enemy of understanding.</li><li><strong>Teach what you know.</strong> Even before you feel like an expert.</li></ul><p>Close the tutorial. Open a blank file. Build something—anything—without looking it up for the first ten minutes.</p><p>That blank-file panic you feel? That’s the beginning of actually learning to code.</p><p><em>I’m a self-taught developer working on a project to make learning code feel less like following instructions and more like actually thinking. If this resonated with you, follow along. There’s a lot more coming.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97dc3fac9783" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Guessing Your Margins: The UX Math That Fixes Messy CSS]]></title>
            <link>https://medium.com/@kenankarakashli/stop-guessing-your-margins-the-ux-math-that-fixes-messy-css-73ad84857ef3?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/73ad84857ef3</guid>
            <category><![CDATA[ui-spacing-guidelines]]></category>
            <category><![CDATA[grid-system]]></category>
            <category><![CDATA[frontend-design-tokens]]></category>
            <category><![CDATA[css-magic-numbers]]></category>
            <category><![CDATA[ux-design-for-beginners]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 19:12:22 GMT</pubDate>
            <atom:updated>2026-03-05T19:37:58.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NirFEzSkymbn0pKIKzf-vg.jpeg" /></figure><p>If I look back at the CSS I wrote in January 2025, it makes me cringe. My stylesheets were a graveyard of random numbers. I had a button withpadding: 12px, a header withmargin-bottom: 15px, and a card layout with gap: 20px. If something didn&#39;t look right, I would manually nudge the pixel count until it appeared visually correct. I was coding by &quot;vibes.&quot;</p><p>Here is the hard truth: if you are guessing your pixel values, your UI will always look unprofessional. Professional design is not merely<strong> </strong>about having a great “eye” for spacing; it is about applying a strict mathematical system. Today, I am starting a new chapter in my journey by bridging UX design with front-end code. Our first step is eliminating what developers call “magic numbers” using the industry standard: the 8-Point Grid.</p><h3>The Problem: Magic Numbers</h3><p>In programming, a “<strong>magic number</strong>” is a random, hard-coded value that lacks context. In CSS, it looks like margin-top: 13px;. Why 13? Why not 12 or 14? If another developer takes over your code, they will have no idea if 13px is a strict brand guideline or if you just got tired of adjusting it.</p><p>When you use magic numbers across an entire application, the interface loses its “rhythm.” The human brain is a pattern-recognition machine. Even if a user doesn’t know why your site feels slightly off, their brain registers the inconsistent spacing between elements. It destroys trust.</p><h3>The Solution: The 8-Point Rule</h3><p>The secret to a crisp, professional UI is unbelievably simple: every size, margin, and padding value in your app must be a multiple of 8. That’s it. 8, 16, 24, 32, 40, 48, 64, etc.</p><p><strong>Why 8?</strong></p><ul><li><strong>Resolution Compatibility:</strong> Most modern screen resolutions are divisible by 8.</li><li><strong>Consistent Scaling:</strong> Apple’s Retina displays and high-density Android screens scale by 1.5x, 2x, or 3x. If you use a 5px margin, scaling it by 1.5x gives you 7.5px. Browsers hate half-pixels; they blur the edges to compensate. Conversely<strong>,</strong> 8 x 1.5 = 12. Perfect, crisp math.</li><li><strong>Decision Fatigue:</strong> When you restrict your choices, you design faster. You no longer debate between 15px or 18px; you just pick 16.</li></ul><h3>Step-by-Step: Moving from “Vibes” to Variables</h3><p>Here is how I am implementing this system in my code today.</p><p><strong>Step 1: Burn the Hard Codes.</strong> Stop writing margin: 24px directly into your component classes. We are going to turn the 8-point grid into &quot;<strong>design tokens</strong>&quot;.</p><p><strong>Step 2: Set Up Your Root Variables.</strong> I now start every single project by defining my spacing scale in the :root of my CSS.</p><p>CSS</p><pre>:root {<br>  /* The 8-Point Spacing Scale */<br>  --space-2: 2px;  /* For tiny borders */<br>  --space-4: 4px;  /* The half-step for tight icons */<br>  --space-8: 8px;<br>  --space-16: 16px;<br>  --space-24: 24px;<br>  --space-32: 32px;<br>  --space-48: 48px;<br>  --space-64: 64px;<br>}</pre><p><em>(Notice I included 4px. In UI design, 4px is the accepted “half-step” when 8px is slightly too much room for micro-elements like icon text).</em></p><p><strong>Step 3: Apply Religiously.</strong> Now, you connect your UX system directly to your CSS.</p><pre>/* The Hard-Coded Approach (Avoid) */<br>.user-card {<br>  padding: 15px;<br>  margin-bottom: 20px;<br>}<br>/* The Professional Approach (Maintainable) */<br>.user-card {<br>  padding: var(--space-16);<br>  margin-bottom: var(--space-24);<br>}</pre><h3>Conclusion: Good Design is Math</h3><p>I used to think designers were artists. I was wrong. The best UI designers are architects. By adopting the 8-point grid, I am no longer guessing. I am building a structural framework. The next time you open Figma or VS Code, I challenge you to look at your spacing. If the number isn’t divisible by 8, delete it. Stop decorating. Start calculating.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73ad84857ef3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flexbox is Not a Layout Engine (And Other CSS Lies)]]></title>
            <link>https://medium.com/@kenankarakashli/flexbox-is-not-a-layout-engine-and-other-css-lies-23f7a47d3124?source=rss-a2473424ac5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/23f7a47d3124</guid>
            <category><![CDATA[css-grid-vs-flexbox]]></category>
            <category><![CDATA[responsive-design]]></category>
            <category><![CDATA[web-layout-2026]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[KenanKarakashli]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 12:05:04 GMT</pubDate>
            <atom:updated>2026-02-22T12:05:04.399Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started coding in 2025, I perceived CSS as just a series of “guesses.” I’d adddisplay: flex, then align-items: center, and if that didn&#39;t work, I’d just keep adding properties until the box moved to where I wanted it. I called it &quot;development.&quot; In reality, it was just blind luck.</p><p>Most beginners treat Flexbox like a magic wand for every layout problem. But as I enter my second year, I’ve realized that using Flexbox for a full-page layout is like using a hammer to turn a screw. It might work eventually, but you’re going to leave a lot of technical debt behind.</p><h3>The One-Dimensional Trap</h3><p>Here is the hard truth: flexbox was never meant to design entire pages. Flexbox is a <strong>one-dimensional</strong> system. It’s brilliant for a row of buttons, a navigation bar, or a stack of cards. It handles content flow beautifully.</p><p>But the moment you start trying to align items in both rows and columns simultaneously using Flexbox, you’re entering “hack territory”. You start using nested containers, irregular margins, and complex flex-basis calculations that nobody — including your future self — can understand.</p><h3>CSS Grid: The Blueprint, Not the Decoration</h3><p>If Flexbox is for the furniture, CSS Grid is for the house. Grid is <strong>two-dimensional</strong>. It allows you to define the skeleton of your page first, and then simply “place” items into that skeleton.</p><ul><li><strong>Flexbox is Content-Out:</strong> The size of the items dictates the layout.</li><li><strong>Grid is Layout-In:</strong> The layout dictates the size of the items.</li></ul><p>I believe the reason juniors avoid Grid is because the syntax looks “scary” compared to Flexbox. But skipping Grid is a professional mistake. Grid allows you to create responsive layouts that would take 50 lines of Flexbox and media queries in just 5 lines of clean, readable code.</p><h3>The 2026 Reality: Hybrid Layouts</h3><p>In a modern codebase, it’s not Flexbox vs. Grid. It’s Flexbox + Grid. A senior-level developer uses Grid for the “big picture” (header, sidebar, main content, footer) and Flexbox for the “small details” (the text and icons inside a button). When you mix them correctly, your CSS becomes:</p><ul><li><strong>Readable:</strong> Another developer can look at your grid-template-areas and see the page structure instantly.</li><li><strong>Performant:</strong> The browser spends less energy calculating nested flex containers.</li><li><strong>Responsive:</strong> You can rearrange an entire mobile layout by changing one line of <strong>grid</strong> code.</li></ul><h3>Conclusion: Stop Guessing</h3><p>If you find yourself nesting divs inside divs just to get a sidebar to stay put, stop. You are fighting the browser. The web has moved past the era of &quot;hacking&quot; layouts. As a 2026 developer, your job is to use the right tool for the right axis. Use Grid for the structure. Use Flex for the flow. Stop guessing and start architecting. Your future self—and whoever has to read your code—will thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23f7a47d3124" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>