<?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 Nafis Abdullah on Medium]]></title>
        <description><![CDATA[Stories by Nafis Abdullah on Medium]]></description>
        <link>https://medium.com/@iz-ahmad?source=rss-5a16a1eb01e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iptIE7c64_wckiqytOQPRA.jpeg</url>
            <title>Stories by Nafis Abdullah on Medium</title>
            <link>https://medium.com/@iz-ahmad?source=rss-5a16a1eb01e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 15:06:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iz-ahmad/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[The Art of Tradeoffs in Software Engineering]]></title>
            <link>https://medium.com/@iz-ahmad/the-art-of-tradeoffs-in-software-engineering-54ec25b52e69?source=rss-5a16a1eb01e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/54ec25b52e69</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[trade-off]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Nafis Abdullah]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 12:18:35 GMT</pubDate>
            <atom:updated>2026-08-12T12:35:49.235Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RodO_zKGwjX8djsrU-i-dw.png" /><figcaption>Tradeoffs in Software Engineering: Array vs Linked List</figcaption></figure><p>Let’s imagine the product manager saying:</p><p><strong><em>“We need this feature to be FAST.”</em></strong></p><p>Sounds simple, right?</p><p>But.. what does <strong>fast</strong> actually mean here?</p><ul><li>Fast response time?</li><li>Fast database queries?</li><li>Fast under 10,000 users, or it can be 1 million?</li><li>And.. how much complexity are we willing to introduce to achieve it?</li></ul><p>This is where one of the most fundamental skills in software engineering comes in. That is:</p><blockquote><strong><em>Making Tradeoffs.</em></strong></blockquote><p>In engineering, we rarely get <em>everything</em> at once. Improving one thing often means giving something up somewhere else. And today, we’ll explore this concept through something as simple as the <strong>Array vs. Linked List</strong> comparison.</p><h3>What Exactly Is a Tradeoff?</h3><p>In software engineering, <strong>tradeoff</strong> generally means accepting a <em>disadvantage</em> in one area to gain an <em>advantage</em> in another.</p><p>For example:</p><ul><li><strong>Better performance</strong> → More memory or complexity</li><li><strong>Simplicity</strong> → Less flexibility</li><li><strong>Better security</strong> → Less convenience</li><li><strong>Lower infrastructure cost</strong> → Lower performance or scalability</li></ul><p>There is rarely a solution that is universally <strong>“the best.”</strong></p><p>So, the better questions would be:</p><blockquote><strong>Best for what? And does it fit our scenario?</strong></blockquote><p>The answer depends on our <strong>requirements, workload, business constraints, or priorities</strong>.</p><p>Let’s explore this through a classic example.</p><h3>Array vs Linked List</h3><p>Suppose, we need to store some sequential data. We have two possible data structures for this. Can use an array:</p><pre>[10][20][30][40][50]</pre><p><strong>An array stores its elements</strong> <strong>next to each other in a contiguous block of memory</strong>. Each element can be identified by its <strong>index</strong>.</p><p>Or, we can use a linked list:</p><pre>[10 | next] → [20 | next] → [30 | next] → [40 | next] → [50 | null]</pre><p><strong>A linked list stores each value inside a node, along with a reference to the next node</strong>. The nodes <em>don’t</em> necessarily have to be next to each other in memory like the array; rather the <strong>references connect them</strong> together.</p><p>While both structures can store the same data, <strong>they organize and access that data differently</strong>. And that’s where the tradeoffs begin.</p><h3>Fast Access vs Cheap Modification</h3><p>With an array, accessing an element by index is fast:</p><pre>$items = [10, 20, 30, 40, 50];<br><br>echo $items[3]; // 40 - instant access</pre><p>We can <strong>directly jump</strong> to any element without traversing the other elements. Thus, <strong>array access is O(1).</strong></p><p>But, a linked list doesn’t have that luxury.</p><p>To reach 40, we have to follow the links one by one:</p><pre>10 → 20 → 30 → 40</pre><p>So, to access an element at a specific position, we have to <strong>traverse the list</strong> from the beginning, making <strong>linked list access</strong> <strong>O(n)</strong>.</p><p>If our application frequently does things like:</p><pre>items[50000]<br>items[90000]<br>items[120000]</pre><p>an <strong>array-like structure</strong> is usually a better fit.</p><p>But now.. let’s assume the requirement’s been changed.</p><p>What if we now need to frequently <strong>insert and remove</strong> elements from the <em>middle</em>?</p><p>Imagine we have this:</p><pre>10 → 20 → 30 → 40</pre><p>And we want to insert 25 between 20 and 30.</p><p>If we already have a reference to the node containing 20, a linked list can perform the insertion <strong>just by changing the links</strong>:</p><pre>20 → 25 → 30</pre><p>Thus, <strong>insertion/removal at a known position</strong> can be <strong>O(1)</strong> for a linked list.</p><p>But with an array, inserting into the middle may require shifting subsequent elements:</p><pre>Before:<br>[10][20][30][40]<br><br>After:<br>[10][20][25][30][40]<br>          ↑<br>    subsequent elements shifted</pre><p>Now this can take <strong>O(n)</strong> time.</p><p>So.. which one can be called better?</p><p><strong>Neither.</strong></p><p>This is where <strong>tradeoffs</strong> become important.</p><h3><strong>Looking Beyond Big-O</strong></h3><p>Things get interesting here.</p><p>Someone might say: <strong><em>“Linked lists are better, because insertion is O(1)”.</em></strong></p><p>But not necessarily this is always true.</p><p>Suppose, we have:</p><pre>10 → 20 → 30 → 40 → … → 1,000,000</pre><p>And we want to insert something at the position <strong>500,000</strong>.</p><p>If we don’t already have a reference to <em>that</em> position, we <em>first need to find it.</em></p><p>That means <strong>traversing the list from the beginning</strong>:</p><pre>10 → 20 → 30 → … → 500,000</pre><p>That lookup is <strong>O(n).</strong></p><p>Only <em>after finding that position</em>, can we perform the O(1) insertion.</p><p>So the actual operation is closer to - <strong>find position, then insert.</strong></p><p>And the first part may dominate the total cost!</p><p>This gives us a broader engineering lesson:</p><blockquote><strong>Don’t optimize just one operation in isolation. Optimize for the actual workload.</strong></blockquote><h3><strong>There’s More: Memory Locality</strong></h3><p>Big-O isn’t the only story either.</p><p>Arrays store elements <strong>next to each other</strong> in memory:</p><pre>[10][20][30][40][50][60][70]</pre><p>Whereas, linked-list nodes can be <strong>scattered</strong> across the memory:</p><pre>[10] ..... [30] ... [20] ....... [50] .. [40]</pre><p>Modern CPUs benefit from <strong>cache locality</strong>, so <strong>sequentially traversing contiguous memory can be much more efficient</strong> in practice than following scattered pointers; even when <em>both</em> operations are technically O(n).</p><p>That’s another important lesson:</p><blockquote><strong>Complexity tells us a lot, but engineering decisions often require looking beyond the Big-O.</strong></blockquote><h3><strong>The Tradeoff in One Picture</strong></h3><h4><strong>Array</strong></h4><ul><li>Fast random access : O(1) - ✓</li><li>Good cache locality - ✓</li><li>Lower memory overhead - ✓</li><li>Slower middle insertions/deletions : O(n) - ✗</li></ul><h4><strong>Linked List</strong></h4><ul><li>Fast insertion/deletion at a known position : O(1) - ✓</li><li>Stable node references - ✓</li><li>Slow random access : O(n) - ✗</li><li>Higher memory overhead - ✗</li><li>Generally worse cache locality - ✗</li></ul><p>The important point <em>is not</em> to memorize the points.</p><p>Rather, it’s to <strong>understand why the differences exist and what those differences mean</strong> for our application.</p><h3>Tradeoffs in Real-World Systems</h3><p>Suppose, we’re building an <strong>analytics dashboard</strong>, where we have <strong>1,000,000</strong> measurements.</p><p>And our application frequently needs to:</p><ul><li><strong>Access</strong> measurements by index</li><li><strong>Iterate</strong> over all measurements</li><li><strong>Calculate</strong> statistics</li></ul><p>An <strong>array-like structure</strong> is a natural choice.</p><p>Because, we’re <em>prioritizing</em>:</p><ul><li>Fast access</li><li>Efficient sequential processing</li><li>Plus, memory efficiency</li></ul><p>And.. we’re <em>accepting</em>:</p><ul><li>More expensive middle insertion/deletion</li></ul><p>So, <strong>that’s a tradeoff</strong>.</p><p>Now let’s imagine a completely different scenario.</p><p>Imagine we’re building a system where existing elements are <strong>frequently</strong> <strong>inserted, removed, or moved around</strong>, and we already <strong>maintain references</strong> to the relevant positions.</p><p>A <strong>linked structure</strong> might be more appropriate for this case.</p><p>Because, here we’re <em>accepting</em>:</p><ul><li>Higher memory overhead</li><li>Poor random access</li><li>Worse cache locality</li></ul><p>in <em>exchange for</em>:</p><ul><li>Cheap structural modifications</li><li>Stable node references</li></ul><p>Again, <strong>that’s a tradeoff</strong>.</p><h3>The Real Skill: Thinking in Tradeoffs</h3><p>The Array vs Linked List example <em>was not</em> really about choosing between two data structures.</p><p>It’s about <strong>developing the habit of thinking in tradeoffs.</strong></p><p>The same thinking pattern applies to our everyday engineering decisions:</p><ul><li>Choose a <strong>simpler</strong> implementation, or a more <strong>flexible</strong> one?</li><li>Optimize for <strong>performance</strong>, or prioritize <strong>maintainability</strong>?</li><li>Introduce another<strong> dependency</strong>, or keep the solution <strong>self-contained</strong>?</li><li>Spend more on <strong>infrastructure, </strong>or keep the setup <strong>minimal</strong>?</li></ul><p>In each case, choosing one side usually means giving up the other side.</p><blockquote><strong>An option in isolation may sound technically better, </strong>but that<strong> doesn’t necessarily make it the appropriate choice for our situation.</strong></blockquote><p>That’s why good engineers don’t just ask, “Which solution is <strong>better</strong>?”</p><p>Instead, they ask:</p><blockquote>What are we <strong>gaining</strong>, what are we <strong>giving up</strong>, and does this tradeoff <strong>make sense for our scenario?</strong></blockquote><p>Because.. A caching layer can make an API faster, <em>but</em> introduces complexity and consistency concerns.</p><p>A distributed architecture can improve scalability, <em>but</em> increases operational complexity.</p><p>A highly normalized database design can reduce duplication, <em>but</em> may require more joins.</p><blockquote>So, <strong>there is no magic solution, or universally “best” solution.</strong></blockquote><p>There are <strong>only tradeoffs.</strong></p><h3><strong>Final Thought</strong></h3><p>As developers, we often tend to look for the “best” solution. But in software engineering, there’s <em>rarely</em> a single perfect answer.</p><p>Every decision comes with its own <strong>constraints, costs, and compromises</strong>. Good engineering is about understanding them and consciously picking <strong>what to prioritize and what we’re willing to give up.</strong></p><p>Ultimately, understanding tradeoffs and making thoughtful decisions around them - is a fundamental part of engineering judgment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54ec25b52e69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Coding to Engineering: Staying Relevant in the AI Era]]></title>
            <link>https://medium.com/@iz-ahmad/from-coding-to-engineering-staying-relevant-in-the-ai-era-cc8e321f925f?source=rss-5a16a1eb01e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc8e321f925f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Nafis Abdullah]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 07:09:46 GMT</pubDate>
            <atom:updated>2026-08-09T07:09:46.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSZcztfKWwUJz28MBgOrSg.png" /></figure><p>Today, almost all of us use AI tools or AI agents in our day-to-day coding. Some use them occasionally, others rely on them heavily, but almost everyone uses them.</p><p>And if we’re honest, there are times when we are accepting AI-generated code without even reviewing it carefully, because - it’s <strong>fast</strong>.</p><p>So, we must recognize and talk about this massive <strong>shift</strong> in the industry that’s already happening.</p><p>A few years ago, being a better developer often meant <strong><em>writing code faster</em></strong>.</p><p>Today… AI is probably the <em>fastest</em> coder in the world!</p><p>So, the real question is:</p><p>If speed is no longer our advantage…</p><p><strong>then what should we, software engineers now focus on?</strong></p><p>You know, the answer is not to <em>compete</em> with AI. That’s never gonna help actually.</p><p>Rather, the answer is - to <strong>become better engineers</strong>.</p><p>Because…</p><blockquote><strong>AI replaces typing, but doesn’t replace our thinking.</strong></blockquote><p>And I believe this is where our profession is heading.</p><blockquote><strong>The value of software engineers is moving upward -</strong></blockquote><blockquote><strong>From “implementation” to “judgment”.</strong></blockquote><p>If that’s true, then the <em>skills</em> that make us valuable are <em>changing</em> as well.</p><p>So we need to develop the skills, or habits that <strong>AI can’t replace</strong>.</p><p>Let’s discuss about five of them.</p><h3>1. Ask More Before Implementation</h3><p>One thing AI is incredibly good at is - <strong>answering</strong>.</p><p>But..</p><p>It mostly answers the questions <em>we</em> ask.</p><blockquote><strong>The quality of the solution depends on the quality of the questions.</strong></blockquote><p>So, before jumping into implementation…</p><p>Ask:</p><ul><li>What problem are we actually solving?</li><li>Who is exactly the user?</li><li>What are the edge cases?</li><li>Is there any security risks there?</li><li>Is there already a simpler solution?</li></ul><blockquote><strong>The more thoughtful our questions are, the better AI performs</strong>.</blockquote><p>More importantly.. The better engineers we become.</p><p>Because engineering has always been about <strong>understanding problems correctly</strong>, before solving them.</p><h3>2. Judgment Must Be Ours</h3><p>Today AI can <em>easily</em> generate a Laravel action.</p><p>Also controller, migration, tests, even a complete feature.</p><p>But..</p><p>Should we merge it?</p><p>Is it secure?</p><p>Does it follow our team’s conventions?</p><p>Will it still make sense one year later?</p><p>Those aren’t AI questions.</p><p>Rather they’re <strong>engineering questions</strong> and that’s still <strong>our</strong> responsibility.</p><p>We need to read the code.</p><p>Verify the logic.</p><p>Think about UX, Security, Performance, Maintainability, and Architecture.</p><p>And one more thing that’s very difficult to replaced by AI…</p><p><strong>Taste.</strong></p><p>Sometimes two solutions both work.</p><p>But one feels cleaner.</p><p>One is easier to extend.</p><p>And one matches the rest of the codebase.</p><p>AI can suggest.</p><blockquote>But <strong>judgment has to come from us, backed by enough brainstorming.</strong></blockquote><h3>3. Own the Outcome</h3><p>AI generated the code.</p><p>Even deployed successfully.</p><p>Great, isn’t it?</p><p>But..</p><p>when production goes down at 2 AM…</p><p><strong>Who gets the call? Who owns the incident?</strong></p><p>Not ChatGPT, Claude, or Codex.</p><p>Rather us.</p><blockquote><strong>Ownership means caring about the entire outcome.</strong></blockquote><blockquote>Not just whether the code runs.</blockquote><p>Did we properly solve the customer’s problem?</p><p>Can the next developer understand it easily?</p><p>Can we maintain it six months later comfortably?</p><p>We have to think about these things.</p><p><strong>Engineering doesn’t end when the code is generated.</strong></p><p>It ends when the problem is solved well.</p><h3>4. Communicate Clearly</h3><p>Software isn’t built alone.</p><p>We have to work with product managers, designers, QA, stakeholders, and also customers.</p><p>AI definitely can help us write code.</p><p>But…</p><p>The biggest challenge <em>isn’t</em> writing the code.</p><p>Rather it is - understanding what people actually need.</p><blockquote>The <strong>best engineer</strong> isn’t always the one who writes the most code.</blockquote><blockquote>It’s often <strong>the one who communicates well to reduce misunderstandings.</strong></blockquote><p>Clarifies requirements to make better decisions.</p><p>And helps the whole team move faster.</p><p><strong>AI can never understand humans better than humans.</strong></p><h3>5. Keep Your Skills Sharp and Growing</h3><p>As AI gets better,</p><p>we’ll naturally rely on it more and more. And that’s acceptable.</p><p>But..</p><p>we can’t <em>outsource</em> our learning.</p><p>If we <em>stop</em> learning and thinking…</p><p>Eventually we’ll <em>stop</em> improving.</p><p>So, <strong>we should</strong> <strong>still</strong> <strong>practice deliberately.</strong></p><p>Sometimes by solving a problem ourselves.</p><p>Sometimes by building a feature without AI.</p><p>Occasionally by solving algorithms or debugging challenges on our own.</p><p>Not because AI can’t do it.</p><p>But because those exercises <strong>sharpen</strong> <strong>the way we think</strong>.</p><blockquote>Just like calculators didn’t eliminate the need to learn mathematics…</blockquote><blockquote><strong>AI shouldn’t eliminate the need to learn software engineering.</strong></blockquote><p>And we must keep learning new things: databases, system design, architecture, or anything else that can help us grow as better engineers.</p><p>So.. What does the <em>future</em> software engineer look like?</p><p>Someone who <strong>asks better questions</strong>.</p><p><strong>Exercises better judgment</strong>.</p><p><strong>Owns the outcomes</strong>.</p><p><strong>Communicates clearly</strong>.</p><p>And <strong>keeps practicing and learning</strong> deliberately.</p><p>AI will continue getting better.</p><p>Probably much better than we can imagine.</p><p>But that’s okay.</p><p>Because..</p><blockquote>Our goal was never to become faster typists.</blockquote><blockquote>Our goal has always been to <strong>solve meaningful problems..</strong></blockquote><blockquote><strong>By</strong> <strong>knowing</strong> <strong>what to ask, what to accept, and what to reject.</strong></blockquote><p>And I think that’s exactly what great engineers will continue doing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc8e321f925f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speed vs Quality? Finding the Right Balance in Software Delivery]]></title>
            <link>https://medium.com/@iz-ahmad/speed-vs-quality-finding-the-right-balance-in-software-delivery-f684b7f380b5?source=rss-5a16a1eb01e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f684b7f380b5</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Nafis Abdullah]]></dc:creator>
            <pubDate>Wed, 20 May 2026 06:46:11 GMT</pubDate>
            <atom:updated>2026-05-20T06:46:42.027Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Speed vs Quality? Finding the Right Balance in Software Delivery" src="https://cdn-images-1.medium.com/max/1024/1*uYc283geDmf2PkB_b1c-1w.png" /><figcaption><strong>Speed vs Quality? Finding the Right Balance in Software Delivery</strong></figcaption></figure><p>আজকের দিনে engineering leaders-দের দায়িত্ব হলো আগের চেয়ে অনেক দ্রুত গতিতে high-quality software delivery নিশ্চিত করা। সাধারণভাবে speed এবং quality-কে অনেক সময় একে অপরের বিপরীত বিষয় হিসেবে দেখা হয়, কিন্তু successful software delivery-এর জন্য এই দুইটার মধ্যে সঠিক balance খুঁজে বের করাটা খুবই গুরুত্বপূর্ণ।</p><p>এই article-এ আলোচনা করা হয়েছে software delivery-তে speed এবং quality আসলে কী বোঝায়, কেন এই দুইটার মধ্যে balance রাখা জরুরি, এবং কীভাবে আমরা effective tools ব্যবহার করে এই balance ধরে রাখতে পারি।</p><h3>Software Delivery-তে Speed বলতে কী বোঝায়?</h3><p>Speed মানে হলো - একটি development team কত দ্রুত নতুন feature, bug fix বা সম্পূর্ণ product বাজারে আনতে পারছে। এটি সাধারণত কিছু গুরুত্বপূর্ণ metric দিয়ে মাপা হয়, যেমন:</p><ul><li><strong>Deployment Frequency</strong>: কত ঘনঘন নতুন code production-এ deploy হচ্ছে।</li><li><strong>Lead Time for Changes</strong>: code commit থেকে শুরু করে production-এ live হওয়া পর্যন্ত মোট সময়।</li><li><strong>Cycle Time</strong>: development শুরু থেকে feature বা fix deploy হওয়া পর্যন্ত সম্পূর্ণ সময়।</li></ul><p>High speed মানে হলো - বাজারের পরিবর্তনের সাথে দ্রুত মানিয়ে নেওয়া, customer demand দ্রুত পূরণ করা, এবং প্রতিযোগিতায় এগিয়ে থাকা।</p><p>তবে শুধু speed-এ ফোকাস করলে সমস্যা তৈরি হতে পারে। তাড়াহুড়ো সিদ্ধান্ত, অগোছালো architecture, technical debt জমে যাওয়া - এসবের ঝুঁকি বেড়ে যায়। ফলে short-term লাভ হলেও long-term ক্ষতি হতে পারে।</p><h3>Software Delivery-তে Quality বলতে কী বোঝায়?</h3><p>Quality মানে শুধু bug-free code নয়। এর মধ্যে আছে:</p><ul><li>Software-এর stability</li><li>Performance</li><li>Security</li><li>User Experience (UX)</li></ul><p>একটি ভালো মানের software শুধু functional requirement পূরণ করলেই হয় না - এটি হতে হবে নির্ভরযোগ্য, নিরাপদ এবং ব্যবহারকারীর জন্য সহজ ও comfortable।</p><p>Quality-এর গুরুত্বপূর্ণ কিছু দিক হলো:</p><ul><li><strong>Code Quality</strong>: clean, maintainable এবং defect-free code।</li><li><strong>Testing</strong>: unit test, integration test, end-to-end test - combined testing strategy।</li><li><strong>User Experience (UX)</strong>: intuitive ও user-friendly design।</li></ul><p>High-quality software সাধারণত কম bug সৃষ্টি করে, কম security ঝুঁকি তৈরি করে এবং দীর্ঘমেয়াদে business-এর জন্য বেশি লাভজনক হয়।</p><h3>কেন Speed আর Quality-এর Balance জরুরি?</h3><p>Speed বেশি হলে quality ক্ষতিগ্রস্ত হতে পারে। আবার quality নিয়ে অতিরিক্ত perfection চাইলে delivery ধীর হয়ে যায়।</p><p>এই ভারসাম্য না থাকলে যে সমস্যাগুলো হয়:</p><ul><li>দ্রুত delivery কিন্তু ঘনঘন bug</li><li>user dissatisfaction</li><li>slow release cycle</li><li>team burnout</li></ul><p>অন্যদিকে সঠিক balance থাকলে পাওয়া যায়:</p><ul><li><strong>Reduced Technical Debt</strong>: দ্রুত কাজ করলেও quality ঠিক থাকায় ভবিষ্যতে সমস্যা কম হয়।</li><li><strong>Improved Customer Satisfaction</strong>: দ্রুত এবং ভালো মানের feature - দুটোই পাওয়া যায়।</li><li><strong>Sustainable Development Pace</strong>: team steady গতিতে কাজ করতে পারে, অতিরিক্ত pressure ছাড়াই।</li></ul><h3>কীভাবে Speed আর Quality-এর ভারসাম্য রাখা যায়?</h3><h4>1. CI/CD Adoptation</h4><p>Continuous Integration (CI) এবং Continuous Deployment (CD) pipeline test ও deployment automate করে। এতে নিয়মিত code integration হয়, automated test early stage-এ bug ধরতে পারে, আর production-এ defect যাওয়ার ঝুঁকি কমে।</p><h4>2. Implementation of DevOps Practice</h4><p>DevOps development এবং operations team-এর মধ্যে সহযোগিতা বাড়ায়। Deployment frequency, Mean Time To Recovery (MTTR) ইত্যাদি metric ব্যবহার করে performance মাপা যায় এবং improve করা যায়।</p><h4>3. Code Review and Pair Programming</h4><p>Code review multiple চোখে code দেখা নিশ্চিত করে। Pair programming real-time collaboration বাড়ায়। এতে quality বজায় থাকে, অথচ development speed খুব বেশি কমে না।</p><h4>4. Using Feature Flags</h4><p>Feature flag-এর মাধ্যমে production-এ feature deploy করা যায়, কিন্তু সব user-এর জন্য একসাথে activate না করেও। এতে fast release সম্ভব হয়, আবার প্রয়োজনে rollback বা gradual rollout-ও করা যায়।</p><h4>5. Incremental Improvement</h4><p>একবারে perfect কিছু বানানোর চেয়ে ছোট ছোট improvement নিয়মিত করা বেশি effective। এতে fast delivery সম্ভব হয় এবং quality-ও ধীরে ধীরে উন্নত হয়।</p><h3>Speed ও Quality বাড়াতে সহায়ক কিছু Tools</h3><h4>Oobeya</h4><p>Oobeya DevOps metric monitor করতে সাহায্য করে, যেমন deployment frequency বা change failure rate। Real-time insight দিয়ে bottleneck চিহ্নিত করতে সাহায্য করে এবং workflow optimize করতে সহায়তা করে।</p><h4>Jira</h4><p>Jira একটি জনপ্রিয় project management tool। Sprint planning, task tracking এবং team collaboration-এর মাধ্যমে delivery process organized রাখতে সাহায্য করে।</p><h4>SonarQube</h4><p>SonarQube একটি static code analysis tool। এটি code quality issue early stage-এ ধরতে সাহায্য করে। CI/CD pipeline-এর সাথে যুক্ত করলে production-এ যাওয়ার আগেই quality ensure করা যায়।</p><h4>Sentry</h4><p>Sentry একটি error-tracking tool, যা production issue real-time monitor করে। দ্রুত issue detect ও solve করতে সাহায্য করে - ফলে quality বজায় রেখেও development চলতে পারে।</p><h3>Balance রাখতে যেসব চ্যালেঞ্জ আসে</h3><h4>Resource Constraint</h4><p>Time, বাজেট বা দক্ষ resource কম থাকলে speed ও quality - দুটোই একসাথে বজায় রাখা কঠিন হয়ে পড়ে। তখন priority select করা গুরুত্বপূর্ণ হয়ে যায়।</p><h4>Changing Requirement</h4><p>Project requirement বারবার বদলালে timeline ও quality দুটোই প্রভাবিত হয়। Agile mindset ছাড়া এই পরিবর্তন সামলানো কঠিন।</p><h4>Delivery Pressure</h4><p>Deadline-এর চাপ অনেক সময় shortcut নিতে বাধ্য করে। কিন্তু দীর্ঘমেয়াদে এটি quality নষ্ট করে এবং technical debt বাড়ায়।</p><h3>দীর্ঘমেয়াদে Balance ধরে রাখার Best Practice</h3><ul><li><strong>Clear Priority নির্ধারণ করুন</strong>: প্রতিটি project-এ speed ও quality - দুটোর গুরুত্ব clearly define করুন।</li><li><strong>Key Metrics নিয়মিত Monitor করুন</strong>: Deployment frequency, success rate ইত্যাদি দেখে data-driven decision নিন।</li><li><strong>Collaborative Culture তৈরি করুন</strong>: Development, Operations এবং QA team একসাথে কাজ করলে সঠিক সমাধান দ্রুত পাওয়া যায়।</li></ul><h3>উপসংহার</h3><p>Software delivery-তে speed আর quality-এর balance রাখা সহজ কাজ নয়। কিন্তু এটিই long-term এ সফল হওয়ার পথ। সঠিক mindset, সঠিক process এবং effective tools ব্যবহার করলে fast এবং high-quality software deliver করা সম্ভব।</p><p>Industry প্রতিনিয়ত বদলাচ্ছে। যারা speed আর quality - দুটোর মধ্যে balance বজায় রাখতে পারবে, তারাই প্রতিযোগিতায় এগিয়ে থাকবে এবং user-দের আস্থা ধরে রাখতে পারবে।</p><blockquote>This article is based on the concepts presented in another article by <strong>Emre Dündar</strong>. The content here has been rewritten and contextualized for Bengali audience. Source article: <a href="https://oobeya.io/blog/balancing-speed-and-quality-in-software-delivery">https://oobeya.io/blog/balancing-speed-and-quality-in-software-delivery</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f684b7f380b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP কি সত্যিই মারা যাচ্ছে? নাকি পুরোনো অতীত ঝেড়ে নতুন পথে এগোচ্ছে?]]></title>
            <link>https://medium.com/@iz-ahmad/php-%E0%A6%95%E0%A6%BF-%E0%A6%B8%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%87-%E0%A6%AE%E0%A6%BE%E0%A6%B0%E0%A6%BE-%E0%A6%97%E0%A7%87%E0%A6%9B%E0%A7%87-f4c3af2831e3?source=rss-5a16a1eb01e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4c3af2831e3</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Nafis Abdullah]]></dc:creator>
            <pubDate>Fri, 08 May 2026 10:53:24 GMT</pubDate>
            <atom:updated>2026-08-14T09:17:07.270Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VDX-2pRamK4FUHMD.jpeg" /><figcaption>is-php-dead-php-8</figcaption></figure><p>“PHP is dead!” - এই কথাটা আমরা এতবার শুনেছি যে এখন আর অবাক হওয়ার কিছু নেই।<br>মনে হয় যেন কোনো comic-book superhero - মরে, আবার ফিরে আসে, আবার মরে, আবার ফিরে আসে!</p><p>কিন্তু ২০২৫ সালের শেষে দাঁড়িয়ে Actual reality-টা কী?</p><p>PHP 8.x আজ বিশাল production system চালাচ্ছে। API serve করছে, queue handle করছে, background job প্রসেস করছে, data crunch করছে - এমন এক level-এর strictness, clarity, performance এবং developer ergonomics নিয়ে, যা PHP 5 যুগে প্রায় কল্পবিজ্ঞানের মতো শোনাত!</p><p>তাই একটু carefully কথা বলা দরকার।</p><ul><li>PHP 5 is dead- এবং সেটি expected ছিল।</li><li>PHP 7 also can be dead - official at EOL, এবং practical usage-এর দিক থেকেও।</li><li>So, the OLD PHP - সেই loosely-typed, inconsistent, <em>“the working somehow”</em> version - সেটাই dead।</li></ul><p>কিন্তু Modern PHP (8+) পুরোপুরি জীবিত। বরং দ্রুত পরিণত হচ্ছে।</p><p>এই লেখা কোনো nostalgia না। এটা একটি সংক্ষিপ্ত technical post-mortem - তারপর একটি পুনর্জাগরণের গল্প।</p><p>চলুন শুরু করি।</p><blockquote>Note: this article is originally was written in english by this author, later translated into this Bangla version. You can read the original one <a href="https://medium.com/@iz-ahmad/is-php-dying-or-finally-letting-go-of-its-past-65a8f5f55c6b"><strong>here</strong></a>.</blockquote><h3>PHP 5: সমস্যার মূল শিকড়</h3><p>PHP 5 দীর্ঘ সময় ধরে ওয়েবকে বহন করেছে। কিন্তু এর অনেক design decision ছিল ৯০-এর দশকের বাস্তবতা মাথায় রেখে। আধুনিক software engineering-এর চাহিদার সাথে সেই পুরোনো আচরণের অসামঞ্জস্যই ছিল মূল সংকট।</p><h3>১. Weak Typing Everywhere</h3><pre>function add($a, $b) {<br> return $a + $b;<br>}<br><br>add(&quot;10 bottles&quot;, 5); // 15 :&quot;)<br>add([], &quot;heyy&quot;); // fatal or nonsense!</pre><p>এটা flexibility না - এটা ambiguity।</p><p>ভাষার মাধ্যমে intent প্রকাশ করার সুযোগ ছিল না। সবকিছু নির্ভর করত:</p><ul><li>convention</li><li>comment</li><li>এবং ভবিষ্যতের ডেভেলপার যেন কিছু নষ্ট না করেন, সেই আশার উপর</li></ul><p>বড় codebase-এ এর ফল ছিল ভয়ংকর। Refactor ঝুঁকিপূর্ণ, bug সূক্ষ্ম, আর behaviour প্রায়ই অপ্রত্যাশিত।</p><h3>২. Type থাকত comment-এ, language-এ না</h3><pre>/**<br> * @param int $id<br> * @return User|null<br> */<br>function findUser($id) {<br> // nothing enforces this<br>}</pre><p>PHPDoc ছিল language limitation সামাল দেওয়ার উপায়। কিন্তু runtime কিছুই enforce করত না।</p><p>অনেক সময় IDE আপনার কোড সম্পর্কে PHP নিজে যতটা জানত, তার চেয়ে বেশি জানত।</p><h3>৩. Error Handling ছিল অগোছালো</h3><pre>$user-&gt;profile-&gt;name;</pre><p>$user যদি null হয়?</p><ul><li>notice?</li><li>fatal error?</li><li>blank screen?</li><li>production crash at 2 AM?</li></ul><p>Debugging প্রায়ই মানে ছিল var_dump() বসানো আর browser refresh করা।</p><h3>সারাংশ</h3><p>PHP 5 খারাপ উদ্দেশ্যে তৈরি হয়নি। কিন্তু এটি ছিল:</p><ul><li>overly permissive</li><li>under-specified</li><li>এবং scale-এ ঝুঁকিপূর্ণ</li></ul><p>এর সমাপ্তি ছিল প্রয়োজনীয় evolution!</p><h3>PHP 7: পুনরুদ্ধারের ধাপ</h3><p>PHP 7 ছিল পুনর্বাসন - সম্পূর্ণ transformation নয়, কিন্তু big development।</p><h3>১. Performance-এ বাস্তব পরিবর্তন</h3><p>Zend Engine 3 execution model-এ বড় পরিবর্তন আনে।</p><p>বাস্তব ফলাফল:</p><ul><li>~1.8x–2.5x বেশি throughput</li><li>30–50% কম memory usage</li><li>কম CPU cycle প্রতি request</li></ul><p>একই hardware, একই code - শুধু নতুন engine.</p><p>এটাই mass migration-এর প্রধান কারণ ছিল।</p><h3>২. Scalar Type ও Return Type</h3><pre>function add(int $a, int $b): int {<br>   return $a + $b;<br>}</pre><p>প্রথমবারের মতো language-level এ intent enforcement.</p><p>তবে limitation ছিল:</p><pre>function value(): int|float // ❌ not allowed in PHP 7</pre><p>Union type ছিল না। Type system এখনও অসম্পূর্ণ।</p><h3>৩. Annotation-নির্ভর Metadata</h3><pre>/**<br> * @Route(&quot;/users/{id}&quot;)<br> * @Method(&quot;GET&quot;)<br> */<br>public function show($id) {}</pre><p>Framework-কে comment parse করতে হত। Regex দিয়ে annotation পড়তে হত।</p><p>কাজ করত, কিন্তু resilient ছিল না।</p><h3>সারাংশ</h3><p>PHP 7 utility বাড়িয়েছে।<br>কিন্তু পুরোপুরি modern করেনি।</p><h3>PHP 8+: True Transformation</h3><p>PHP 8 কোনো incremental release না। এটি total mindset shift.</p><h3>১. Mature Type System</h3><p>আগে defensive code লিখতে হত:</p><pre>function price($value) {<br>   if (!is_int($value) &amp;&amp; !is_float($value)) {<br>     throw new InvalidArgumentException();<br>   }<br>}</pre><p>এখন:</p><pre>function price(int|float $value): float<br>{<br>   return (float) $value;<br>}</pre><p>So engine নিজেই contract enforce করে।</p><p>ফলাফল:</p><ul><li>কম runtime bug</li><li>পরিষ্কার API</li><li>নিরাপদ refactor</li><li>উন্নত static analysis</li></ul><h3>২. Attributes: First-Class Metadata</h3><p>আগে:</p><pre>/**<br> * @ORM\Column(type=&quot;string&quot;, length=255)<br> */<br>private $email;</pre><p>এখন:</p><pre>#[ORM\Column(type: &quot;string&quot;, length: 255)]<br>private string $email;</pre><p>Attributes এখন:</p><ul><li>structured</li><li>type-checked</li><li>reflection-friendly</li><li>silent typo প্রায় impossible</li></ul><p>Routing, ORM, validation - পুরো ecosystem উপকৃত হয়েছে।</p><h3>৩. Constructor Property Promotion</h3><pre>class Employee {<br>  public function __construct(<br>    private int $id,<br>    private string $role<br>  ) {}<br>}</pre><p>কম boilerplate, একই semantics, কম cognitive load.</p><h3>৪. Nullsafe Operator</h3><pre>$userCompanyEmail = $user?-&gt;profile?-&gt;company?-&gt;email ?? null;</pre><p>Nested object access এখন readable, safe এবং more expressive!</p><h3>৫. Match Expression</h3><pre>$output = match ($statusCode) {<br>   200 =&gt; &#39;OK&#39;,<br>   404 =&gt; &#39;Not Found!&#39;,<br>   default =&gt; &#39;Unknown!&#39;,<br>};</pre><ul><li>strict comparison</li><li>expression-based</li><li>fall-through বা missing break-এর ঝুঁকি নেই</li></ul><h3>৬. Enum</h3><pre>enum BalanceEntryType: string<br>{<br>   case INCOME = &#39;income&#39;;<br>   case EXPENSE = &#39;expense&#39;;<br><br>   public function label(): string<br>   {<br>      return match($this) {<br>          self::INCOME =&gt; &#39;Income&#39;,<br>          self::EXPENSE =&gt; &#39;Expense&#39;,<br>      };<br>   }<br>}</pre><p>Magic string-এর দিন শেষ।<br>Domain model এখন self-documenting এবং safer.</p><h3>Performance Improvement</h3><p>শুধু Syntax নয়, PHP 8 internal optimization-ও এনেছে।</p><ul><li>PHP 7.4 থেকে ~5–15% performance gain সাধারণ web app-এ</li><li>Improved memory handling</li><li>Cleaner opcode execution</li></ul><p>JIT (Just-In-Time compilation) এসেছে PHP 8.0-এ।</p><p>CRUD app-এ dramatic পরিবর্তন না হলেও, CPU-heavy workload (large loop, mathematical computation, image processing) ক্ষেত্রে 2x–10x পর্যন্ত speedup সম্ভব।</p><p>এটা PHP-র সম্ভাবনার পরিধি প্রসারিত করেছে।</p><h3>PHP 8.2–8.5: More signs of Maturity</h3><h3>Readonly Class</h3><pre>readonly class TransactionDTO {<br>   public function __construct(<br>      public int $userId,<br>      public string $description,<br>      public TransactionType $type,<br>      public float $amount<br>   ) {}<br>}</pre><p>Immutability এখন language-level এ guaranteed.</p><h3>Asymmetric Visibility</h3><pre>class Article {<br>   public private(set) string $content;<br>}</pre><p>Public read, controlled write - getter/setter ceremony কমে গেল।</p><h3>Property Hooks</h3><pre>class Product {<br>   public float $cost {<br>      set =&gt; max(0, $value);<br>      get =&gt; round($this-&gt;price, 2);<br>   }<br>}</pre><p>ম্যাজিক মেথডের অপ্রয়োজনীয় ঝামেলা ছাড়াই Encapsulation.</p><h3>Lazy Object</h3><pre>class ExampleObject<br>{<br>    public function __construct(public int $prop)<br>    {<br>        echo &quot;Heavy object initialized&quot;;<br>    }<br>}<br><br>$reflector = new ReflectionClass(ExampleObject::class);<br>$lazyObject = $reflector-&gt;newLazyGhost(function (ExampleObject $object) {<br>    $object-&gt;__construct(1);<br>});<br><br>var_dump($lazyObject);<br>var_dump(get_class($lazyObject));<br>var_dump($lazyObject-&gt;prop);</pre><p>Object initialize হবে তখনই, যখন first use করা হবে।</p><h3>Pipe Operator (PHP 8.5)</h3><pre>$userQuery = &quot;  PHP Died Again!!!   &quot;;<br>$normalizedQuery = $userQuery<br>    |&gt; trim(...)<br>    |&gt; (fn ($str) =&gt; preg_replace(&#39;/\s+/&#39;, &#39; &#39;, $str))<br>    |&gt; strtolower(...)<br>    |&gt; htmlspecialchars(...);</pre><p>Readable transformation pipeline - left-to-right flow।</p><h3>URI Extension (PHP 8.5)</h3><pre>use Uri\Rfc3986\Uri;<br><br>$uri = new Uri(&#39;https://example-domain.com:443/path/to?query=1&#39;);<br>$scheme = strtolower($uri-&gt;getScheme());<br>$host   = strtolower($uri-&gt;getHost());<br>$port   = $uri-&gt;getPort();<br>$path   = $uri-&gt;getPath();<br>$query  = $uri-&gt;getQuery();</pre><p>Spec-compliant, predictable URL handling - fragile parse_url()-এর সীমাবদ্ধতা ছাড়াই।</p><h3>Array Helpers</h3><pre>$last = array_last($events);</pre><p>ছোট change, but this avoids awkward conditionals and improves clarity.</p><h3><strong>Better Debugging &amp; Error Tools (PHP 8.5)</strong></h3><p>PHP 8.5-এ fatal error হলে এখন আরও rich backtrace দেখা যায়, ফলে সমস্যার আসল জায়গা খুঁজে বের করা easier হয়। পাশাপাশি নতুন get_error_handler() এবং get_exception_handler() ফাংশন যোগ হয়েছে, যেগুলোর মাধ্যমে বর্তমানে কোন error বা exception handler active আছে তা জানা যায়। ফলে debugging আরও clean, আর framework বা tooling তৈরি করাও হয় বেশি effective and easier।</p><h3>PHP 9: The Final Cleanup</h3><p>PHP 9 নতুন feature যোগ করার জন্য আসছে না।<br> এটা আসছে পুরনো ঝামেলা, অদ্ভুত আচরণ আর লুকানো bug-এর জায়গাগুলো সরিয়ে ফেলতে।</p><p>মানে, যেসব behavior বছরের পর বছর developer-দের কনফিউজ করেছে - সেগুলো এখন সরাসরি closed. যেমন -</p><pre>&#39;x9&#39;++; // incrementing a string or boolean - TypeError<br><br>false[] = 1; // error - No Autovivification<br><br>echo &quot;Value: &quot; . $flag; // Implicit Bool-to-String Coercion - TypeError<br><br>echo &quot;Hello world ${foo}&quot;; // error (braces after dollar)<br><br>echo $undefinedVar; // fatal error (was a warning in PHP 8.x)<br><br>(float) &quot;12.5heyy&quot;;  // TypeError - No More Fuzzy Casts<br><br>unserialize(&quot;invalid-data&quot;); // throws UnserializationFailedException<br><br>// And more to come..</pre><p>Silent coercion, undefined behavior, legacy oddity - সব ধীরে ধীরে বিদায় নিচ্ছে।</p><p>PHP 9 <strong>completes</strong> the <strong>transition</strong> PHP 8 started: <strong>correctness over convenience.</strong></p><h3>শেষ কথা</h3><p>হ্যাঁ, পুরোনো PHP <strong>dead. </strong>And it <em>should </em>be.</p><p>কিন্তু PHP 8+ হলো:</p><ul><li>fast</li><li>strict</li><li>expressive</li><li>predictable</li><li>এবং ধারাবাহিকভাবে evolving</li></ul><p>This is <em>not</em> a dying language.<br>This is a language that <em>finally</em> grew up.</p><p>তাই কেউ যদি বলে, “PHP is dead!” - <br>প্রশ্ন করুন: “Which one?”</p><p>Cause, the PHP we’re writing today really has a future. And it’s a serious one that no one can deny.</p><p>তবে একটা বিষয় পরিষ্কার করে বলা ভালো - এই লেখায় PHP-এর বর্তমান অবস্থানকে সমর্থন করা হয়েছে, ঠিকই। কিন্তু এর মানে এই নয় যে আমাদের সারা জীবন একটিমাত্র language আঁকড়ে ধরে থাকতে হবে।</p><p>একজন developer হিসেবে আমাদের চিন্তাধারা হওয়া উচিত open। সময়ের সাথে নতুন technology আসবে, নতুন tool আসবে, নতুন approach আসবে। বাস্তব চাহিদা, প্রজেক্টের requirements আর পরিস্থিতি অনুযায়ী যা more effective and feasible, সেটা বেছে নেওয়াই বুদ্ধিমানের কাজ।</p><p>Language নয় - সমস্যার সঠিক সমাধানটাই আসল। এটাই সুস্থ developer mindset।</p><p>ধন্যবাদ!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4c3af2831e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is PHP Dying,  or Finally Letting Go of Its Past?]]></title>
            <link>https://medium.com/@iz-ahmad/is-php-dying-or-finally-letting-go-of-its-past-65a8f5f55c6b?source=rss-5a16a1eb01e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/65a8f5f55c6b</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Nafis Abdullah]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 13:48:40 GMT</pubDate>
            <atom:updated>2025-12-27T19:12:46.234Z</atom:updated>
            <content:encoded><![CDATA[<h3>Is PHP Dying, or Finally Letting Go of Its Past?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sq3eoS0p26CeZjfUobX-yw.jpeg" /></figure><blockquote>PHP is dead!</blockquote><blockquote>No, wait -<br>PHP <em>was</em> dead.<br>Then it died again.<br>And again!</blockquote><p>At this point, it has more death certificates than a comic book superhero!</p><p>And yet… here we are at the end of 2025, when PHP 8.x is running massive production systems, powering APIs, handling queues, crunching data, and doing it with a level of strictness, clarity, performance, and developer ergonomics that would’ve sounded like science fiction back in the PHP 5 era!</p><p>So.. let’s be precise, because precision matters now (finally :D).</p><p><strong>PHP 5 is dead</strong> - and deserved it.<br><strong>PHP 7 is dead</strong> - officially, and morally.<br><strong>So, old PHP is dead</strong> - the loose, inconsistent, shrug-and-pray version. But -<br><strong>Modern PHP (8+) is so much alive - </strong>evolving, and increasingly hard to mock.</p><p>This article isn’t nostalgia. Rather it’s a technical-but-brief post-mortem, followed by a resurrection story. Let’s just jump in.</p><h3>PHP 5: The Original Sin!</h3><p>PHP 5 powered the web for over a decade - and it did so while carrying design decisions from the late ’90s. That <em>mismatch</em> between <strong>modern software expectations</strong> and <strong>legacy language behavior</strong> is what caused most of PHP’s historical <em>pain</em>.</p><h4>1. Weak Typing Everywhere</h4><p><em>(a.k.a. Hope-Driven Development!)</em></p><p>In PHP 5, types were optional in theory and ignored in practice:</p><pre>function add($a, $b) {<br> return $a + $b;<br>}<br><br>add(&quot;10 bottles&quot;, 5); // 15 :&quot;)<br>add([], &quot;heyy&quot;); // fatal or nonsense!</pre><p>This wasn’t flexibility - it was <em>ambiguity</em>.<br>You couldn’t express intent at the language level. Everything relied on:</p><ul><li>convention</li><li>comments</li><li>and <em>blind faith</em> that future maintainers wouldn’t break things!</li></ul><p>This made large codebases <em>fragile</em>, refactors <em>dangerous</em>, and bugs delightfully <em>subtle</em>.</p><h4>2. “Types” Lived in Comments, Not the Language</h4><pre>/**<br> * @param int $id<br> * @return User|null<br> */<br><br>function findUser($id) {<br> // nothing enforces this<br>}</pre><p>PHPDoc became a substitute for language features. Static analysis tools tried their best, but the runtime didn’t care. The result? Your IDE knew more about your code than PHP itself :”)</p><h4>3. Error Handling Was Inconsistent and Often Silent</h4><pre>$user-&gt;profile-&gt;name;</pre><p>If $user was null, what would happen?:</p><ul><li>maybe a notice</li><li>maybe a fatal error</li><li>maybe a white screen</li><li>maybe production goes down at 2-AM!</li></ul><p>Debugging often meant sprinkling var_dump() and refreshing the browser like a <em>caveman!</em></p><h4>Verdict on PHP 5</h4><p>PHP 5 wasn’t malicious. But -<br>It was <strong>under-specified</strong>, <strong>over-permissive</strong>, and <strong>dangerous at scale</strong>.</p><p>Its death was not a loss.<br>It was <em>overdue maintenance</em>.</p><h3>PHP 7: The Recovery Phase</h3><p>PHP 7 was a <strong>necessary rehabilitation</strong>, not a full transformation.</p><h4>1. Performance Finally Became Respectable</h4><p><strong>Zend Engine 3 </strong>(new major version of the core engine)<strong> </strong>fundamentally changed how PHP executed code. The engine was rewritten to reduce <strong>memory usage</strong>, improve <strong>opcode handling</strong>, and eliminate long-standing inefficiencies that PHP 5 carried for years.</p><p>In real-world applications, this wasn’t theoretical.</p><h4><strong>PHP 7 Performance Reality Check:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u78DqxjDI3HZ2EiNJ3x1VA.jpeg" /><figcaption>Performance Comparison between PHP 7 and 5</figcaption></figure><p>Across independent benchmarks published by <strong>Zend</strong> and repeated by the community, PHP 7 consistently demonstrated <strong>dramatic gains over PHP 5.6</strong>:</p><ul><li><strong>~1.8× to 2.5× higher throughput</strong> for typical web workloads</li><li><strong>30–50% lower memory usage</strong> on identical codebases</li><li>Significantly <strong>fewer CPU cycles</strong> per request</li></ul><p>In practical terms, teams observed patterns like:</p><ul><li>PHP <strong>5.6</strong> handling ~100 requests/second</li><li>PHP <strong>7.x</strong> handling ~200+ requests/second</li></ul><p>With same hardware, same code, no refactors. Just a <strong>new engine</strong> doing its job properly. This was enough to justify mass migrations - but.. speed alone does not make a language entirely modern.</p><h4>2. Scalar &amp; Return Types Arrived.. Partially</h4><pre>function add(int $a, int $b): int {<br>   return $a + $b;<br>}</pre><p>This was a major step forward. For the first time, PHP could <strong>enforce intent at runtime</strong>, not just document it.</p><p>But the system was <em>not yet</em> <em>complete</em>:</p><pre>function value(): int|float // ❌ not allowed in PHP 7</pre><p>That’s right, no union types. Nullable types felt bolted on. so complex domain rules still required manual checks.</p><h4>3. Metadata Still Pretending to Be Code</h4><pre>/**<br> * @Route(&quot;/users/{id}&quot;)<br> * @Method(&quot;GET&quot;)<br> */<br>public function show($id) {}</pre><p>Frameworks had to:</p><ul><li>parse comments</li><li>rely on regex</li><li>hope developers didn’t typo annotations</li></ul><p>It worked, I know.. but was breakable and indirect.</p><h4>Verdict on PHP 7</h4><p>PHP 7 made PHP <strong>usable </strong>at<strong> scale</strong>. But -<br>It did not make PHP enough <strong>pleasant</strong>.</p><p>And as PHP 7 had already reached <em>end-of-life</em>, keeping it alive is a <em>no-doubt</em> technical debt.</p><h3>PHP 8+: This Is Where PHP Actually Changes</h3><p>PHP 8 is <em>not</em> an incremental release.</p><p>It is the point where <strong>PHP stops apologizing</strong> for its past and <strong>starts enforcing correctness</strong>.</p><h4>1. Real Type Systems (Union, Nullable, and Intersection)</h4><p><strong>Before:</strong></p><pre>function price($value) {<br>   if (!is_int($value) &amp;&amp; !is_float($value)) {<br>     throw new InvalidArgumentException();<br>   }<br>}</pre><p>Defensive code everywhere. Manual checks. Runtime surprises.</p><p><strong>After (PHP 8+):</strong></p><pre>function price(int|float $value): float <br>{<br>   return (float) $value;<br>}</pre><p>Now the engine <strong>enforces</strong> the contract. Which ensures -</p><ul><li>fewer runtime bugs</li><li>clearer APIs</li><li>safer refactors</li><li>better static analysis</li></ul><p>PHP <em>finally</em> speaks the same language your domain model does.</p><h4>2. Attributes: Metadata Becomes First-Class</h4><p><strong>Before:</strong></p><pre>/**<br> * @ORM\Column(type=&quot;string&quot;, length=255)<br> */<br>private $email;</pre><p><strong>After (PHP 8+):</strong></p><pre>#[ORM\Column(type: &quot;string&quot;, length: 255)]<br>private string $email;</pre><p>So attributes are now -</p><ul><li>structured</li><li>type-checked</li><li>reflection-friendly</li><li>impossible to typo silently</li></ul><p>This single change <strong>modernized </strong>routing systems, ORMs, validators, serializers<strong> -</strong> with which, entire ecosystem benefited.</p><h4>3. Constructor Property Promotion: Boilerplate Removal, Done Right</h4><p><strong>Before:</strong></p><pre>class Employee {<br>  private int $id;<br>  private string $role;<br><br>  public function __construct(int $id, string $role) {<br>    $this-&gt;id = $id;<br>    $this-&gt;role = $role;<br>  }<br>}</pre><p><strong>After (PHP 8+):</strong></p><pre>class Employee {<br>  public function __construct(<br>    private int $id,<br>    private string $role<br>  ) {}<br>}</pre><p>Same semantics.. But -<br>Less noise.<br>No magic.</p><p>This is not syntactic sugar - it’s <strong>cognitive load reduction</strong>.</p><h4>4. Nullsafe Operator: Making Object Graphs Bearable</h4><p><strong>Before:</strong></p><pre>$userCompanyEmail = null;<br><br>if ($user &amp;&amp; $user-&gt;profile &amp;&amp; $user-&gt;profile-&gt;company) {<br>   $userCompanyEmail = $user-&gt;profile-&gt;company-&gt;email;<br>}</pre><p><strong>After (PHP 8+):</strong></p><pre>$userCompanyEmail = $user?-&gt;profile?-&gt;company?-&gt;email ?? null;</pre><p>This solves a real, everyday problem <strong>cleanly</strong>:</p><ul><li>no fatal errors</li><li>no unreadable conditionals</li><li>explicit null propagation</li></ul><h4><strong>5. Match Expression: A “Grown-Up” </strong>switch!</h4><p><strong>Before:</strong></p><pre>switch ($statusCode) {<br>   case 200:<br>     $output = &#39;OK&#39;;<br>     break;<br><br>   case 404:<br>     $output = &#39;Not Found!&#39;;<br>     break;<br><br>   default:<br>     $output = &#39;Unknown!&#39;;<br>}</pre><p><strong>After (PHP 8+):</strong></p><pre>$output = match ($statusCode) {<br>   200 =&gt; &#39;OK&#39;,<br>   404 =&gt; &#39;Not Found!&#39;,<br>   default =&gt; &#39;Unknown!&#39;,<br>};</pre><ul><li>strict comparison</li><li>expression-based</li><li>impossible to forget break</li><li>safer logic by design.</li></ul><h4>6. Enum: Killing Fake Constants Forever</h4><pre>enum BalanceEntryType: string <br>{<br>   case INCOME = &#39;income&#39;;<br>   case EXPENSE = &#39;expense&#39;;<br><br>   public function label(): string<br>   {<br>      return match($this) {<br>          self::INCOME =&gt; &#39;Income&#39;,<br>          self::EXPENSE =&gt; &#39;Expense&#39;,<br>      };<br>   }<br>}</pre><p>Enums give you:</p><ul><li>useful and exhaustive checks</li><li>impossible invalid states</li><li>self-documenting domain models</li></ul><p>No more <em>magic strings</em> slowly rotting your codebase!</p><h4>PHP 8 Performance: Not Just Syntax Sugar</h4><p>PHP 8’s improvements are not limited to language features. Even with<strong> JIT disabled</strong>,<strong> </strong>PHP 8 introduced measurable performance gains due to internal <strong>engine optimizations</strong>.</p><p>Benchmarks across common frameworks and raw PHP workloads show:</p><ul><li><strong>~5–15% performance improvement</strong> over PHP 7.4 in typical request/response applications</li><li><strong>Better opcode execution</strong> and memory handling</li><li><strong>Reduced overhead</strong> thanks to stricter typing and cleaner internals</li></ul><p>The <strong>JIT (Just-In-Time) compilation - </strong>introduced in PHP 8.0 - is a performance-enhancing technique that converts frequently executed parts of PHP’s <em>intermediate</em> code (opcodes) into <em>native</em> machine code at runtime. I think it deserves special clarification:</p><ul><li>JIT <strong>does not </strong>magically speed up CRUD apps</li><li>It <strong>does </strong>significantly improve <strong>CPU-heavy workloads</strong></li></ul><p>In <strong>compute-focused scenarios</strong> (large loops, math-heavy processing, image manipulation etc.), JIT-enabled PHP 8 can demonstrate <strong>2 to 10 times speedups </strong>compared to PHP 7. Huge, no?</p><p>The important part is:</p><p>PHP 8 <strong>improved</strong> everyday applications <em>and</em> opened the door for <strong>workloads</strong> PHP was <em>never</em> competitive at before.</p><p>That’s what we can call a fundamental shift.</p><h3>PHP 8.2–8.5: Stops Making Excuses</h3><h4>Readonly Classes (PHP 8.2)</h4><pre>readonly class TransactionDTO {<br>   public function __construct(<br>      public int $userId,<br>      public string $description,<br>      public TransactionType $type,<br>      public float $amount<br>   ) {}<br>}</pre><p>Now <strong>immutability</strong> <strong>enforced</strong> by the engine.<br>No accidental mutations.<br>Perfect for value objects.</p><h4>Asymmetric Visibility (PHP 8.4)</h4><pre>class Article {<br>   public private(set) string $content;<br>}</pre><p>Public reads.<br>Controlled writes.</p><p>This <em>replaces</em> entire getter/setter patterns with a <strong>single declaration</strong>.</p><h4>Property Hooks (PHP 8.4)</h4><pre>class Product {<br>   public float $cost {<br>      set =&gt; max(0, $value);<br>      get =&gt; round($this-&gt;price, 2);<br>   }<br>}</pre><p><strong>Encapsulation</strong> without boilerplate. No magic methods.</p><h4>Lazy Objects (PHP 8.4)</h4><pre>class ExampleObject<br>{<br>    public function __construct(public int $prop)<br>    {<br>        echo &quot;Heavy object initialized&quot;;<br>    }<br>}<br><br>$reflector = new ReflectionClass(ExampleObject::class);<br>$lazyObject = $reflector-&gt;newLazyGhost(function (ExampleObject $object) {<br>    // Initialize object in-place<br>    $object-&gt;__construct(1);<br>});<br><br>var_dump($lazyObject);<br>var_dump(get_class($lazyObject));<br><br>var_dump($lazyObject-&gt;prop); // triggers initialization now when first used</pre><p>Instead of loading all data and running the constructor immediately, PHP creates a lightweight placeholder object. The real object is <strong>initialized only when </strong>you<strong> first use it</strong>.</p><h4>Pipe Operator (PHP 8.5)</h4><p>PHP 8.5 officially introduces the pipe operator, long anticipated in the ecosystem. It lets you <strong>chain callables</strong> in a <em>left-to-right</em> flow, reducing nested calls and improving readability:</p><pre>$userQuery = &quot;  PHP Died Again!!!   &quot;;<br><br>$normalizedQuery = $userQuery<br>    |&gt; trim(...)<br>    |&gt; (fn ($str) =&gt; preg_replace(&#39;/\s+/&#39;, &#39; &#39;, $str))<br>    |&gt; strtolower(...)<br>    |&gt; htmlspecialchars(...); </pre><p>This style is similar to what you find in functional languages and makes transformation pipelines <strong>far easier</strong> to reason about.</p><h4>URI Extension (PHP 8.5)</h4><p>Prior to 8.5, parsing URLs reliably often required external libraries or careful handling of parse_url(), which historically had edge cases. PHP 8.5 adds a <strong>built-in URI extension</strong> (based on RFC 3986 and WHATWG URL standard) that provides a better effective API for parsing, normalizing, manipulating URIs and URLs.</p><pre>use Uri\Rfc3986\Uri;<br><br>$uri = new Uri(&#39;https://example-domain.com:443/path/to?query=1&#39;);<br><br>$scheme = strtolower($uri-&gt;getScheme());  // &quot;https&quot;<br>$host   = strtolower($uri-&gt;getHost());    // &quot;example-domain.com&quot;<br>$port   = $uri-&gt;getPort();                // 443<br>$path   = $uri-&gt;getPath();                // &quot;/Path/To&quot;<br>$query  = $uri-&gt;getQuery();  </pre><p>This brings <strong>more predictable and spec-compliant</strong> URL handling directly to the language.</p><h4>New Array Helpers (PHP 8.5)</h4><p>PHP 8.5 finally adds array_first() and array_last() to <strong>simplify accessing boundary elements</strong> of an array:</p><pre>$last = array_last($events);</pre><p>This avoids awkward conditionals and improves clarity.</p><h4>Better Debugging &amp; Error Tools (PHP 8.5)</h4><p>PHP 8.5 improves error visibility with <strong>richer backtraces</strong> on fatal errors and introduces <strong>new functions</strong> like get_error_handler() and get_exception_handler() to introspect current handlers, making debugging and framework tooling more effective and easier.</p><h3>PHP 9: The Final Cleanup</h3><p>PHP 9 is <em>not</em> about adding features.</p><p>It’s about <em>removing</em> historical landmines. Just like these -</p><pre>&#39;x9&#39;++; // incrementing a string or boolean - TypeError<br><br>false[] = 1; // error - No Autovivification<br><br>echo &quot;Value: &quot; . $flag; // Implicit Bool-to-String Coercion - TypeError<br><br>echo &quot;Hello world ${foo}&quot;; // error (braces after dollar)<br><br>echo $undefinedVar; // fatal error (was a warning in PHP 8.x)<br><br>(float) &quot;12.5heyy&quot;;  // TypeError - No More Fuzzy Casts<br><br>unserialize(&quot;invalid-data&quot;); // throws UnserializationFailedException<br><br>// And more to come..</pre><p>So, silent coercions, undefined behavior, legacy oddities - <strong>gone</strong>.</p><p>PHP 9 <strong>completes</strong> the <strong>transition</strong> PHP 8 started:<br><strong>correctness over convenience.</strong></p><h3>Final Verdict</h3><p>Yes - old PHP is <strong>dead</strong>.<br>And it <em>should </em>be.</p><p>But.. <strong>PHP 8+</strong> is:</p><ul><li>fast</li><li>strict</li><li>expressive</li><li>predictable</li><li>evolving on a yearly cadence</li></ul><p>This is <em>not</em> a dying language.<br>This is a language that <em>finally</em> grew up.</p><p>So guys.. the next time when someone yields:</p><blockquote>“PHP is dead!”</blockquote><p>Should ask them:</p><blockquote>“Which one?”</blockquote><p>Because, the PHP we’re writing today really has a future. And it’s a serious one that no one can deny.</p><p>But hey, one thing I guess needs to be clear - this article does defend the status of PHP, I agree. But..it doesn’t actually mean that you have to stick with only one language for the life..we should never think like that - rather always be open to explore and embrace new technologies as they come, depending on what we need and what reality we are in.</p><p>That’s all. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65a8f5f55c6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP 8.5 Unlocked: 6 Killer Features That Erase Your Code Debt]]></title>
            <link>https://medium.com/@iz-ahmad/php-8-5-unlocked-6-killer-features-that-erase-your-code-debt-744be0178be0?source=rss-5a16a1eb01e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/744be0178be0</guid>
            <category><![CDATA[new-releases]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Nafis Abdullah]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 06:48:22 GMT</pubDate>
            <atom:updated>2025-12-17T12:43:42.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*NWby1G2YSN6ovGXIJGl6_w.png" /></figure><p>Are you a PHP dev? Cool! Let’s talk about the gifts PHP brought for us in the new release.</p><p>If you’re a mid-level developer, you’re past the basics. You know the pain points: that messy chain of nested functions, the boilerplate needed for immutable objects, and the constant fear of silent bugs!</p><p>Well, get ready to feel excited about PHP, again. PHP 8.5 is here, and to me, it’s a much developer-centric release. It’s not just faster; it fundamentally changes how you approach data flow in many cases, API design, and performance also.</p><p>Forget incremental changes. I’m going to walk you through the six most powerful new features - the ones that can solve your daily frustrations and ease development.</p><h4>1. The Pipe Operator (|&gt;) - End the Nested-Call Nightmare</h4><p>Let’s be honest: nested functions are awful. When you process data - say, sanitizing input - you end up reading the code from the inside-out, like deciphering an ancient scroll. Or you introduce five temporary variables just to break the chain!</p><p><strong>Solution: “Forward” Data Flow</strong><br>The <strong>Pipe Operator (</strong><strong>|&gt;)</strong> changes the game. It takes the result of one expression and seamlessly “pipes” it as the first argument to the next function (sounds interesting no?!), allowing chaining of callables left to right.</p><p>Let’s look at a real-life example (Cleaning User Input):</p><p>PHP 8.4 or older (Nested Hell!):</p><pre>$userQuery = &quot;   Learn PHP 8.5!!!   &quot;;<br><br>// deeply nested transformations<br>$normalizedQuery = htmlspecialchars(<br>    strtolower(<br>        str_replace(<br>            &#39;!!&#39;, &#39;!&#39;,<br>            str_replace(&#39;  &#39;, &#39; &#39;,<br>                trim($userQuery)<br>            )<br>        )<br>    )<br>);<br><br>// it&#39;s very hard to read: must mentally unravel inside-out<br><br>var_dump($normalizedQuery); // string(15) &quot;learn php 8.5&quot;</pre><p>PHP 8.5 (Clean Pipeline):</p><pre>$userQuery = &quot;   Learn PHP 8.5!!!   &quot;;<br><br>$normalizedQuery = $userQuery<br>    |&gt; trim(...)                         // remove surrounding whitespace<br>    |&gt; (fn ($str) =&gt; preg_replace(&#39;/\s+/&#39;, &#39; &#39;, $str)) // normalize multiple spaces to single<br>    |&gt; (fn ($str) =&gt; rtrim($str, &#39;!&#39;))                 // remove trailing exclamation marks<br>    |&gt; strtolower(...)                   // convert to lowercase<br>    |&gt; htmlspecialchars(...);            // escape HTML entities<br><br>// It can be read top-to-bottom, directly following the transformations. <br>// Beautiful, isn&#39;t it?<br><br>var_dump($normalizedQuery); // string(15) &quot;learn php 8.5&quot;</pre><p>This makes the flow of data intuitive, easy to read and modify, and also more maintainable.</p><h4>2. Clone With - Immutability is Finally Painless</h4><p>If you practice modern OOP, you know immutable objects (which never change their state) is key to safety and predictability. Using readonly classes helps - but changing one property used to require writing repetitive “with-er” methods that reconstruct the object manually.</p><p><strong>Solution: Clone and Update in “One Go”</strong><br>PHP 8.5 lets you clone an object <strong>and</strong> override selected properties in a clean syntax using clone($obj, [...]). That brings us straightforward support of the “with-er” pattern in readonly classes.</p><p>Let’s look at a real-life example (Adjusting a Read-only Cart Item):</p><p>PHP 8.4 or older (Verbose Boilerplate):</p><pre>readonly class CartItem<br>{<br>    public function __construct(<br>        public string $name,<br>        public float $price,<br>        public int $quantity,<br>        public string $currency = &#39;USD&#39;,<br>    ) {}<br>    <br>    public function withQuantity(int $quantity): self<br>    {<br>        $values = get_object_vars($this);<br>        $values[&#39;quantity&#39;] = $quantity;<br>        return new self(...$values);<br>    }<br>}<br><br>// Usage<br>$item = new CartItem(<br>    name: &#39;Wireless Mouse&#39;,<br>    price: 29.99,<br>    quantity: 1<br>);<br><br>$updatedItem = $item-&gt;withQuantity(3);</pre><p>PHP 8.5 (Clean Pipeline):</p><pre>readonly class CartItem<br>{<br>    public function __construct(<br>        public string $name,<br>        public float $price,<br>        public int $quantity,<br>        public string $currency = &#39;USD&#39;,<br>    ) {}<br>    <br>    public function withQuantity(int $qty): self<br>    {<br>        // now we can clone and override only the &#39;quantity&#39;<br>        return clone($this, [<br>            &#39;quantity&#39; =&gt; $qty,<br>        ]); // Much cleaner, no?<br>    }<br>}<br><br>// Usage<br>$item = new CartItem(<br>    name: &#39;Wireless Mouse&#39;,<br>    price: 29.99,<br>    quantity: 1<br>);<br><br>$updatedItem = $item-&gt;withQuantity(3);</pre><p>Thus immutability becomes simple and natural.</p><h4>3. Closures and First-Class Callables in Constant Expressions (Attributes, Defaults, Constants)</h4><p>This is a hidden powerhouse for framework authors and advanced API designers. Before PHP 8.5, constant expressions - such as attribute arguments, property/parameter’s default values, or constants - had to be scalar values, no logic allowed.</p><p><strong>The Solution: Code as Configuration</strong><br>Now you can embed static closures or first-class callables in constant expressions directly- for example, inside attribute parameters or default values.</p><p>Let’s look at a real-life example:</p><p>PHP 8.4 or older (Indirect/Magic Strings):</p><pre>#[AuthCheck(<br>    new Expression(&#39;request.user.id === post.author_id&#39;),<br>})]<br>public function updatePost(Request $request, Post $post): Response<br>{<br>    // Controller logic...<br>}</pre><p>PHP 8.5 (Inline Callable Logic):</p><pre>#[AuthCheck(static function (User $user, Post $post): bool {<br>    return $user-&gt;id === $post-&gt;authorId<br>        || in_array(&#39;post_edit&#39;, $user-&gt;permissions, true);<br>})]<br>public function updatePost(Request $request, Post $post): Response<br>{<br>    // authorization logic is defined directly in the attribute above<br>    // Controller logic goes below...<br>}</pre><p>This makes attributes more expressive, turning them into genuine configuration + behavior definitions, strongly typed and aligned with modern practices.</p><h4>4. #[\NoDiscard] Attribute</h4><p>We often face this: calling a method that returns a new value, but forgetting to assign it back to a variable. Sometimes that brings a silent bug: nothing fails, but nothing changes.</p><p><strong>The Solution: Compile-Time Safety</strong><br>PHP 8.5 introduces the #[\NoDiscard] attribute. If a function marked with it returns a value and the caller ignores it, PHP issues a warning - forcing you to handle the return intentionally or consciously discard it casting as (void).</p><p>Let’s look at a real-life example:</p><p>PHP 8.4 or older (Silent Failures):</p><pre>class TokenGenerator<br>{<br>    public function generate(): string<br>    {<br>        return bin2hex(random_bytes(16));<br>    }<br>}<br><br>$gen = new TokenGenerator();<br><br>// ignoring return value<br>$gen-&gt;generate(); <br><br>// return value ignored, no warning, potential bug</pre><p>PHP 8.5 (Warning about Return Value):</p><pre>class TokenGenerator<br>{<br>    #[\NoDiscard]<br>    public function generate(): string<br>    {<br>        return bin2hex(random_bytes(16));<br>    }<br>}<br><br>$gen = new TokenGenerator();<br><br>// ignoring return value<br>$gen-&gt;generate(); <br>// ⚠️ Warning: return value should be used or explicitly cast to (void)<br><br>// Correct usage:<br>$token = $gen-&gt;generate();<br><br>// or, if intentionally ignoring<br>(void) $gen-&gt;generate();</pre><p>This is a small but a powerful guard which can help avoid subtle bugs and enforce better usage discipline.</p><h4>5. Persistent cURL Share Handles - The Hidden Performance Optimization</h4><p>If your app frequently calls external APIs (payment gateways, microservices, third-party REST services), repeated DNS lookups, SSL handshakes, and TCP connection setups add up - hurting performance.</p><p><strong>The Solution: Connection Pooling</strong><br>PHP 8.5 lets you create persistent cURL share handles that survive across multiple PHP requests. When using the same share configuration again, the handle will be reused, cutting down redundant overhead dramatically.</p><p>Let’s look at a real-life example:</p><p>PHP 8.4 or older (Every Request = New Connection):</p><pre>// Every single page load does this from scratch:<br><br>$sh = curl_share_init();<br><br>curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);<br>curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);<br><br>$ch = curl_init(&#39;https://api.weather.com/current&#39;);<br><br>curl_setopt($ch, CURLOPT_SHARE, $sh);<br>curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br><br>$weather = curl_exec($ch);<br><br>// Everything is destroyed after this request<br>// Next user or request? Start from scratch again!</pre><p>PHP 8.5 (Efficient Repeated HTTP Requests):</p><pre>// Create a persistent share handle<br>$sh = curl_share_init_persistent([<br>    CURL_LOCK_DATA_DNS,      <br>    CURL_LOCK_DATA_CONNECT,<br>]); // Share DNS lookups and connection info<br><br>$ch = curl_init(&#39;https://api.weather.com/current&#39;);<br><br>curl_setopt($ch, CURLOPT_SHARE, $sh);<br>curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br><br>$weather = curl_exec($ch);<br><br>// The DNS lookup and connection info are SAVED now<br>// Next request? Reuse connection from earlier SAPI request!</pre><p>For high-throughput systems or long-running PHP processes, this can significantly reduce latency and resource usage.</p><h4>6. The Native URI Extension - Stop Guessing, Start Parsing</h4><p>Historically, PHP developers used parse_url() (and friends) to handle URLs/URIs. But that approach was often inconsistent, edge-case prone, and not strictly standards-compliant.</p><p><strong>The Solution: Standards-Compliant, Object-Oriented URI Handling</strong><br>PHP 8.5 adds a built-in URI extension (based on RFC 3986 and WHATWG URL standard) that provides a better effective API for parsing, normalizing, manipulating URIs and URLs.</p><p><strong>Real-Life Example: Robust URI Parsing and Manipulation</strong></p><p>Let’s look at a real-life example:</p><p>PHP 8.4 or older (parse_url &amp; Manual Work):</p><pre>$url = &#39;https://example.com:443/path/to?query=1&#39;;<br>$parts = parse_url(https://medium.com/$url);<br><br>$host = strtolower($parts[&#39;host&#39;]);<br>$path = $parts[&#39;path&#39;] ?? &#39;/&#39;;<br>$port = $parts[&#39;port&#39;] ?? null;<br>$query = $parts[&#39;query&#39;] ?? &#39;&#39;;<br>// Manual normalization, risk of mistakes for encoding, ports, etc.</pre><p>PHP 8.5 (Using URI Extension):</p><pre>use Uri\Rfc3986\Uri;<br><br>$uri = new Uri(&#39;https://example.com:443/path/to?query=1&#39;);<br><br>$scheme = strtolower($uri-&gt;getScheme());  // &quot;https&quot;<br>$host   = strtolower($uri-&gt;getHost());    // &quot;example.com&quot;<br>$port   = $uri-&gt;getPort();                // 443<br>$path   = $uri-&gt;getPath();                // &quot;/Path/To&quot;<br>$query  = $uri-&gt;getQuery();               // &quot;query=1&quot;<br><br>// immutable modification example<br>$new = $uri<br>    -&gt;withScheme(&#39;http&#39;)<br>    -&gt;withPort(80)<br>    -&gt;withPath(&#39;/new-path&#39;)<br>    -&gt;withQuery(&#39;page=2&#39;);<br><br>echo (string)$new; // &quot;http://example.com:80/new-path?page=2&quot;</pre><p>Compared with parse_url() + manual handling, this offers more clarity, strictness towards standards and safety - especially important when URLs are user input or manipulated programmatically.</p><h4>Final Verdict: It’s Time to Upgrade</h4><p>PHP 8.5 is not a minor tweak, rather it’s a quality-of-life and architecture upgrade built by developers, for developers. It combines <strong>cleaner syntax</strong>, <strong>safer APIs</strong>, <strong>performance gains</strong>, and <strong>modern abstractions </strong>in a beautiful manner.</p><p>The Pipe Operator and Clone With raise the baseline for clean, expressive code. The improved constant expressions with closures and first-class callables turn configuration into first-class citizens. The #[\NoDiscard] attribute safeguards correct API usage. Persistent cURL share handles and the URI extension deliver real performance and security benefits.</p><p>If you value readability, maintainability, and better architecture, your next codebase should be running on PHP 8.5 without any doubt! So let’s go ahead, explore these features more, and enjoy writing PHP again!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=744be0178be0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>