<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saami abbas Khan</title>
    <description>The latest articles on DEV Community by Saami abbas Khan (@saamiabbaskhan).</description>
    <link>https://dev.to/saamiabbaskhan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2069606%2Fb35d1209-61fd-4120-ae9b-f4e76801e6f4.png</url>
      <title>DEV Community: Saami abbas Khan</title>
      <link>https://dev.to/saamiabbaskhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saamiabbaskhan"/>
    <language>en</language>
    <item>
      <title>Any improvements that are needed? I’d be happy to receive suggestions. The app is posted on itch.io and, since it’s a free unsigned Windows .exe, the page has been temporarily quarantined (still downloadable). As traffic and trust increase it'll be fine.</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Wed, 07 Jan 2026 15:55:14 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/any-improvements-that-are-needed-id-be-happy-to-receive-suggestions-the-app-is-posted-on-itchio-4n3f</link>
      <guid>https://dev.to/saamiabbaskhan/any-improvements-that-are-needed-id-be-happy-to-receive-suggestions-the-app-is-posted-on-itchio-4n3f</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/saamiabbaskhan" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2069606%2Fb35d1209-61fd-4120-ae9b-f4e76801e6f4.png" alt="saamiabbaskhan"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://vibe.forem.com/saamiabbaskhan/i-made-a-habit-tracker-because-the-free-ones-were-not-free-58a4" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;I Made a Habit Tracker Because the Free Ones Were… Not Free 😅&lt;/h2&gt;
      &lt;h3&gt;Saami abbas Khan ・ Dec 16 '25&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#gemini&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ai&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#vscode&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>opensource</category>
      <category>gemini</category>
      <category>ai</category>
      <category>vscode</category>
    </item>
    <item>
      <title>My Indie App Got Quarantined on itch.io — and I’m Opening It Up to the Dev Community</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Wed, 07 Jan 2026 15:41:09 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/my-indie-app-got-quarantined-on-itchio-and-im-opening-it-up-to-the-dev-community-2fkk</link>
      <guid>https://dev.to/saamiabbaskhan/my-indie-app-got-quarantined-on-itchio-and-im-opening-it-up-to-the-dev-community-2fkk</guid>
      <description>&lt;p&gt;A few days ago, something unexpected happened.&lt;/p&gt;

&lt;p&gt;I published a small indie project on &lt;a href="https://saamiabbaskhan.itch.io/focus-and-grow-habit-tracking" rel="noopener noreferrer"&gt;itch.io&lt;/a&gt; — a lightweight, offline habit-tracking app I built for people who want fewer distractions and more consistency.&lt;/p&gt;

&lt;p&gt;Within hours, the page was &lt;strong&gt;automatically placed under quarantine&lt;/strong&gt; for additional review. No takedown, No warning.&lt;br&gt;&lt;br&gt;
Just… quarantine.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What the App Is (and Isn’t)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Focus &amp;amp; Grow&lt;/strong&gt; is a &lt;strong&gt;fully offline Windows habit tracker&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No accounts
&lt;/li&gt;
&lt;li&gt;No ads
&lt;/li&gt;
&lt;li&gt;No trackers
&lt;/li&gt;
&lt;li&gt;No background network activity
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tech stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt; for app logic
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tauri (Rust)&lt;/strong&gt; for packaging
&lt;/li&gt;
&lt;li&gt;Distributed as a zipped &lt;strong&gt;Windows &lt;code&gt;.exe&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Includes a clear &lt;strong&gt;README&lt;/strong&gt; explaining usage and intent
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing obfuscated. Nothing hidden.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤔 Why This Probably Happened
&lt;/h2&gt;

&lt;p&gt;If you’ve shipped a Windows executable before, you know the struggle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unsigned &lt;code&gt;.exe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;New project with no reputation&lt;/li&gt;
&lt;li&gt;Automated security heuristics doing their thing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I completely understand why platforms do this — but it raises a real question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How do indie developers establish trust when starting from zero?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧪 Why I’m Sharing This Here
&lt;/h2&gt;

&lt;p&gt;I’ve already contacted itch.io for a &lt;strong&gt;manual review&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the meantime, I’m doing the most transparent thing I can:&lt;/p&gt;

&lt;p&gt;Opening the project up to the dev community.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Curious? Take a look.
&lt;/li&gt;
&lt;li&gt;Cautious? Inspect it.
&lt;/li&gt;
&lt;li&gt;Been through this before? Share your experience.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback, comments, or even just engagement genuinely help — both for improving the app and for signaling legitimacy.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 The Project
&lt;/h2&gt;

&lt;p&gt;The app is called &lt;a href="https://saamiabbaskhan.itch.io/focus-and-grow-habit-tracking" rel="noopener noreferrer"&gt;Focus &amp;amp; Grow&lt;/a&gt; — a simple habit tracker designed to stay out of your way.&lt;/p&gt;

&lt;p&gt;If you check it out and have thoughts, I’d love to hear them.&lt;/p&gt;




&lt;p&gt;Building in public isn’t always comfortable — but it’s worth it.&lt;/p&gt;

&lt;p&gt;Let’s talk.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>help</category>
      <category>coding</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I Made a Habit Tracker Because the Free Ones Were… Not Free 😅</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Tue, 16 Dec 2025 08:45:36 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/i-made-a-habit-tracker-because-the-free-ones-were-not-free-58a4</link>
      <guid>https://dev.to/saamiabbaskhan/i-made-a-habit-tracker-because-the-free-ones-were-not-free-58a4</guid>
      <description>&lt;p&gt;Recently, I was scrolling through Instagram and came across this &lt;strong&gt;amazing habit-tracking template&lt;/strong&gt; on Notion. But when I tried to download it… surprise, it was &lt;strong&gt;paid&lt;/strong&gt;. Ah, the pain. 😅&lt;/p&gt;

&lt;p&gt;Instead of endlessly searching for free alternatives or settling for something that didn’t quite click, I did the &lt;strong&gt;non-obvious thing&lt;/strong&gt;: I made my own.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;Focus &amp;amp; Grow&lt;/strong&gt; – a minimalistic, distraction-free monthly habit tracker that I &lt;strong&gt;vibe-coded&lt;/strong&gt; using &lt;strong&gt;TypeScript, React, and Tauri&lt;/strong&gt;. The goal? A tool that’s:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clean &amp;amp; simple&lt;/strong&gt; – no clutter, just your habits and progress
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy-first&lt;/strong&gt; – 100% local storage, no login required
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Powerful analytics&lt;/strong&gt; – streaks, trends, completion rates
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exportable&lt;/strong&gt; – share your monthly consistency chart as an image
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desktop-ready&lt;/strong&gt; – works natively via Tauri, or in your browser
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can &lt;strong&gt;either download the ready-to-use app from &lt;a href="https://saamiabbaskhan.itch.io/focus-and-grow-habit-tracking" rel="noopener noreferrer"&gt;Itch.io&lt;/a&gt;&lt;/strong&gt; for a smooth experience, &lt;strong&gt;or check out the code on &lt;a href="https://github.com/SaamiAbbasKhan/Focus-and-Grow-" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/strong&gt; if you want to tinker or contribute.  &lt;/p&gt;

&lt;p&gt;It would mean a lot if you could take a few minutes to &lt;strong&gt;test it out&lt;/strong&gt;, &lt;strong&gt;share feedback&lt;/strong&gt;, or &lt;strong&gt;suggest new features&lt;/strong&gt;. I’m especially curious about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How intuitive it feels
&lt;/li&gt;
&lt;li&gt;Any additional features you’d like to see
&lt;/li&gt;
&lt;li&gt;Suggestions for improvement
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks a ton for reading! 💛  &lt;/p&gt;

&lt;p&gt;If you try it, feel free to &lt;strong&gt;comment below&lt;/strong&gt;—I’d love to hear how you &lt;strong&gt;focus and grow&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>gemini</category>
      <category>ai</category>
      <category>vscode</category>
    </item>
    <item>
      <title>I Made a Habit Tracker Because the Free Ones Were… Not Free 😅</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Mon, 15 Dec 2025 10:48:36 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/i-made-a-habit-tracker-because-the-free-ones-were-not-free-225f</link>
      <guid>https://dev.to/saamiabbaskhan/i-made-a-habit-tracker-because-the-free-ones-were-not-free-225f</guid>
      <description>&lt;p&gt;Recently, I was scrolling through Instagram and came across this &lt;strong&gt;amazing habit-tracking template&lt;/strong&gt; on Notion. But when I tried to download it… surprise, it was &lt;strong&gt;paid&lt;/strong&gt;. Ah, the pain. 😅&lt;/p&gt;

&lt;p&gt;Instead of endlessly searching for free alternatives or settling for something that didn’t quite click, I did the &lt;strong&gt;non-obvious thing&lt;/strong&gt;: I made my own.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;Focus &amp;amp; Grow&lt;/strong&gt; – a minimalistic, distraction-free monthly habit tracker that I &lt;strong&gt;vibe-coded&lt;/strong&gt; using &lt;strong&gt;TypeScript, React, and Tauri&lt;/strong&gt;. The goal? A tool that’s:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clean &amp;amp; simple&lt;/strong&gt; – no clutter, just your habits and progress
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy-first&lt;/strong&gt; – 100% local storage, no login required
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Powerful analytics&lt;/strong&gt; – streaks, trends, completion rates
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exportable&lt;/strong&gt; – share your monthly consistency chart as an image
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desktop-ready&lt;/strong&gt; – works natively via Tauri, or in your browser
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can &lt;strong&gt;either download the ready-to-use app from &lt;a href="https://saamiabbaskhan.itch.io/focus-and-grow-habit-tracking" rel="noopener noreferrer"&gt;Itch.io&lt;/a&gt;&lt;/strong&gt; for a smooth experience, &lt;strong&gt;or check out the code on &lt;a href="https://github.com/SaamiAbbasKhan/Focus-and-Grow-" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/strong&gt; if you want to tinker or contribute.  &lt;/p&gt;

&lt;p&gt;It would mean a lot if you could take a few minutes to &lt;strong&gt;test it out&lt;/strong&gt;, &lt;strong&gt;share feedback&lt;/strong&gt;, or &lt;strong&gt;suggest new features&lt;/strong&gt;. I’m especially curious about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How intuitive it feels
&lt;/li&gt;
&lt;li&gt;Any additional features you’d like to see
&lt;/li&gt;
&lt;li&gt;Suggestions for improvement
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks a ton for reading! 💛  &lt;/p&gt;

&lt;p&gt;If you try it, feel free to &lt;strong&gt;comment below&lt;/strong&gt;—I’d love to hear how you &lt;strong&gt;focus and grow&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>tooling</category>
      <category>vibecoding</category>
      <category>opensource</category>
    </item>
    <item>
      <title>CourseTime Analyzer: Python + Selenium + GUI Project for Tracking YouTube Course Time</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Wed, 17 Sep 2025 15:47:07 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/coursetime-analyzer-python-selenium-gui-project-for-tracking-youtube-course-time-2mjp</link>
      <guid>https://dev.to/saamiabbaskhan/coursetime-analyzer-python-selenium-gui-project-for-tracking-youtube-course-time-2mjp</guid>
      <description>&lt;p&gt;Ever wondered &lt;strong&gt;how long it will take to finish that YouTube course playlist&lt;/strong&gt; you just found? Instead of manually checking each video, I built a small Python project called &lt;strong&gt;CourseTime Analyzer&lt;/strong&gt; 🚀.  &lt;/p&gt;

&lt;p&gt;This tool automatically searches YouTube for a course playlist, fetches all video durations, and calculates the &lt;strong&gt;total study time&lt;/strong&gt; — all packed in a simple &lt;strong&gt;Tkinter GUI&lt;/strong&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  🔥 Why I Built This
&lt;/h3&gt;

&lt;p&gt;Whenever I started a YouTube course, I always wanted to know &lt;em&gt;“How much total time will this take?”&lt;/em&gt; Sure, YouTube shows individual durations, but for playlists with 50+ videos, calculating by hand is painful.  &lt;/p&gt;

&lt;p&gt;So I automated it with &lt;strong&gt;Python + Selenium&lt;/strong&gt; and wrapped it in a clean GUI using &lt;strong&gt;Tkinter&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;👉 To be honest, this was a &lt;strong&gt;time-pass project&lt;/strong&gt;. I wasn’t in the mood to continue my actual work (learning more about &lt;em&gt;Softmax Regression&lt;/em&gt; 😅), so I coded this as a fun escape.  &lt;/p&gt;




&lt;h3&gt;
  
  
  ⚙️ Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Search YouTube for any course playlist
&lt;/li&gt;
&lt;li&gt;📺 Fetch playlist title and creator details
&lt;/li&gt;
&lt;li&gt;⏱️ Calculate total video duration in hours
&lt;/li&gt;
&lt;li&gt;🎥 Show video count and display durations (first 15 listed, rest summarized)
&lt;/li&gt;
&lt;li&gt;🔗 Clickable playlist link directly inside GUI
&lt;/li&gt;
&lt;li&gt;🖼️ Clean interface with background image
&lt;/li&gt;
&lt;li&gt;🖥️ Supports &lt;strong&gt;GUI mode (graphics.py)&lt;/strong&gt; and &lt;strong&gt;CLI mode (main.py)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧩 Modularized Approach
&lt;/h3&gt;

&lt;p&gt;The project is structured to keep things clean and reusable:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;main.py&lt;/strong&gt; → Handles the core mechanism (YouTube scraping &amp;amp; analysis via Selenium).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;graphics.py&lt;/strong&gt; → A wrapper around &lt;code&gt;main.py&lt;/code&gt; that provides a Tkinter-based GUI.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can run &lt;code&gt;main.py&lt;/code&gt; independently in CLI mode — the GUI is just an additional layer.  &lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 GitHub Repository
&lt;/h3&gt;

&lt;p&gt;All the code is open-source and available here:  &lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/SaamiAbbasKhan/CourseTime-Analyzer" rel="noopener noreferrer"&gt;CourseTime Analyzer on GitHub&lt;/a&gt;  &lt;/p&gt;




&lt;h3&gt;
  
  
  💬 Feedback
&lt;/h3&gt;

&lt;p&gt;Comments are open! Feel free to suggest improvements, criticize the approach, or even fork the repo and make it better. This was just a fun side project, so I’d love to see how others take it further. 🚀  &lt;/p&gt;




</description>
      <category>python</category>
      <category>selenium</category>
      <category>resources</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Yo!</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Mon, 07 Jul 2025 16:57:06 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/yo-5fbj</link>
      <guid>https://dev.to/saamiabbaskhan/yo-5fbj</guid>
      <description>&lt;p&gt;Hello! After a 10-month break 😅&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Hacktoberfest Experience</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Sun, 27 Oct 2024 14:26:13 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/hacktoberfest-experience-5blm</link>
      <guid>https://dev.to/saamiabbaskhan/hacktoberfest-experience-5blm</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest"&gt;2024 Hacktoberfest Writing challenge&lt;/a&gt;: Contributor Experience&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hacktoberfest was an amazing experience! I learned so much about open-source collaboration, from understanding new codebases to following contributor guidelines. Although some issues were challenging, each taught me valuable skills and boosted my confidence.&lt;/p&gt;

&lt;p&gt;The community’s support was also very incredible.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Should You Even Put Your Simple Projects on GitHub?</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Tue, 01 Oct 2024 19:20:19 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/should-you-even-put-your-simple-projects-on-github-160m</link>
      <guid>https://dev.to/saamiabbaskhan/should-you-even-put-your-simple-projects-on-github-160m</guid>
      <description>&lt;p&gt;I was hesitant to share my latest project, a Simple CLI File Explorer, because I feared it might be too basic. But after a lot of thought, I finally hit the upload button.&lt;/p&gt;

&lt;p&gt;I'm a beginner, still learning at my own pace, even if it’s just a little bit each day. But the key is, I’m staying consistent (thank God!). This project was designed to strengthen my core concepts, and while I know it’s far from perfect, and there are definitely areas for improvement, I honestly just needed to get it out there.&lt;/p&gt;

&lt;p&gt;Please check out my &lt;a href="https://github.com/SaamiAbbasKhan/Initial-Learnings/tree/main/Simple-FileExplorer-CLI" rel="noopener noreferrer"&gt;Simple CLI File Explorer&lt;/a&gt;, and I would love your honest    feedback—be as brutal as you want! Did I make the right call posting this? Where do I stand with this project?&lt;/p&gt;

&lt;p&gt;Your Opinion Matters!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>learning</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>Unlocking Functional Programming in Java: A Guide to Lambdas, Method References, and Chaining</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Fri, 27 Sep 2024 11:57:04 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/unlocking-functional-programming-in-java-a-guide-to-lambdas-method-references-and-chaining-4040</link>
      <guid>https://dev.to/saamiabbaskhan/unlocking-functional-programming-in-java-a-guide-to-lambdas-method-references-and-chaining-4040</guid>
      <description>&lt;p&gt;In this post we'll discover the power of functional programming in Java with lambdas, method references, and function chaining. Simplify your code and boost efficiency with these modern techniques!&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;em&gt;Table of Contents&lt;/em&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Functional Programming&lt;/li&gt;
&lt;li&gt;Lambda Expressions&lt;/li&gt;
&lt;li&gt;Method References&lt;/li&gt;
&lt;li&gt;Functional Interfaces&lt;/li&gt;
&lt;li&gt;Lambda Chaining&lt;/li&gt;
&lt;li&gt;Predicate Chaining&lt;/li&gt;
&lt;li&gt;Custom vs. Default Functional Interface Chaining
&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to Functional Programming
&lt;/h2&gt;

&lt;p&gt;Functional programming is a programming paradigm that emphasizes writing concise, efficient, and reusable code by extensively using functions, particularly lambdas. One of its key benefits is &lt;strong&gt;brevity&lt;/strong&gt;—reducing code length without sacrificing clarity or efficiency. In functional programming, functions are treated as first-class citizens, allowing for easier function chaining, leading to less verbose code.&lt;/p&gt;

&lt;p&gt;Adopting functional programming can significantly enhance productivity and maintainability, especially when working with complex data transformations or streamlining logic. However, brevity doesn’t mean sacrificing efficiency or readability. A well-written functional program should still be easy to understand, debug, and maintain.&lt;/p&gt;

&lt;p&gt;To successfully leverage functional programming, it’s essential to understand key terminologies such as functional interfaces, lambda expressions, method references, and chaining of functions.&lt;/p&gt;

&lt;p&gt;In this post, we'll explore these concepts in detail to help you harness the full power of functional programming in Java.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lambda Expressions
&lt;/h2&gt;

&lt;p&gt;Lambda expressions are simply a concise way to represent methods or functions in programming languages like Java. They are a key component of functional programming, allowing you to write cleaner, more expressive code.&lt;/p&gt;

&lt;p&gt;In Java, &lt;strong&gt;lambda expressions&lt;/strong&gt; are tightly coupled with &lt;strong&gt;functional interfaces&lt;/strong&gt;. To use lambdas effectively, it's essential to understand what a functional interface is.&lt;/p&gt;

&lt;p&gt;A functional interface in Java is an interface with only one abstract method. This method can be implemented using a lambda expression, which makes the code shorter and more readable.&lt;/p&gt;

&lt;p&gt;Here's a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@FunctionalInterface&lt;/span&gt;
&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;countInterface&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;count&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Returns the count, e.g., "Saami" returns 5&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Implementing the interface using a lambda&lt;/span&gt;
&lt;span class="n"&gt;countInterface&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Lambda to return string length&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Saami"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Outputs: 5&lt;/span&gt;


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

&lt;/div&gt;



&lt;p&gt;In this example, the lambda &lt;code&gt;s -&amp;gt; s.length()&lt;/code&gt; is used to implement the &lt;code&gt;count()&lt;/code&gt; method from the &lt;code&gt;countInterface&lt;/code&gt;. It's a compact and elegant way of writing what would otherwise require a more verbose approach using anonymous classes.&lt;/p&gt;

&lt;p&gt;While you could create a method to achieve the same result, using lambdas aligns with the functional programming paradigm of brevity—writing concise and expressive code. Lambdas can also be multi-line, but the aim is to maintain simplicity and brevity whenever possible&lt;/p&gt;

&lt;h2&gt;
  
  
  Method References
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Method references&lt;/strong&gt; in Java are a shorthand way to further simplify lambda expressions. They provide a more readable and concise syntax, making your code easier to understand while maintaining functionality. Method references are particularly useful when your lambda expression simply calls a method.&lt;/p&gt;

&lt;p&gt;Let’s take a look at some examples where a lambda expression can be replaced with a method reference for improved readability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@FunctionalInterface&lt;/span&gt;
&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;CountInterface&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;count&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Returns the count, e.g., "Saami" returns 5&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Implementing the interface using a method reference&lt;/span&gt;

&lt;span class="nc"&gt;CountInterface&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nl"&gt;String:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;span class="c1"&gt;// Using the method reference to get the length of the string&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Saami"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Outputs: 5&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Functional Interfaces
&lt;/h2&gt;

&lt;p&gt;In Java, a functional interface is an interface that contains exactly one abstract method. This concept is pivotal in functional programming, as it allows the use of lambda expressions to implement the interface's functionality in a concise manner. Functional interfaces can also contain default or static methods, but they must adhere to the rule of having only one abstract method.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@FunctionalInterface&lt;/code&gt; annotation is used to indicate that an interface is intended to be a functional interface. While this annotation is not mandatory, it provides compile-time checking to ensure that the interface remains functional. If you accidentally add more than one abstract method, the compiler will throw an error.&lt;/p&gt;

&lt;p&gt;For more details on functional interfaces, feel free to check out my dedicated post on &lt;a href="https://dev.to/saamiabbaskhan/default-functional-interfaces-in-java-3hho"&gt;functional interfaces&lt;/a&gt; where I delve deeper into their usage, examples, and best practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lambda Chaining
&lt;/h2&gt;

&lt;p&gt;Before diving into lambda chaining, it’s important to understand the default functional interfaces provided by Java. For a detailed overview, check out my post on &lt;a href="https://dev.to/saamiabbaskhan/default-functional-interfaces-in-java-3hho"&gt;Default Functional Interfaces in Java&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In Java, you can chain lambda expressions using the &lt;code&gt;andThen()&lt;/code&gt; method, which is available in both the Function and Consumer interfaces. The main difference between the two lies in how they handle inputs and outputs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Function Interface&lt;/strong&gt;: The Function interface is designed for transformations. It takes an input, processes it, and returns an output. When chaining functions, the output of the first lambda expression becomes the input for the second. This allows for a seamless flow of data through multiple transformations.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Function&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;uCase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nl"&gt;String:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;toUpperCase&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Function&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;fun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;uCase&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;andThen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;concat&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"KHAN"&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;andThen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;split&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fun&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;apply&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Saami"&lt;/span&gt;&lt;span class="o"&gt;)));&lt;/span&gt;

&lt;span class="c1"&gt;// Output&lt;/span&gt;
&lt;span class="c1"&gt;// S A A M I K H A N &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Consumer Interface: In contrast, the Consumer interface does not return any result. Instead, it takes an input and performs an action, typically producing side effects. When using &lt;code&gt;andThen()&lt;/code&gt; with consumers, the first consumer will execute, and then the second will follow.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Consumer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;printUpperCase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toUpperCase&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;Consumer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;printLength&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Length: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;

&lt;span class="nc"&gt;Consumer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;combinedConsumer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;printUpperCase&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;andThen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;printLength&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;combinedConsumer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;accept&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Saami"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Outputs: "SAAMI" and "Length: 5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By using &lt;code&gt;andThen()&lt;/code&gt;, you can effectively chain lambda expressions to create more complex behavior in a clean and readable manner. This chaining allows for efficient code organization and minimizes boilerplate, aligning with the principles of functional programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  Predicate Chaining
&lt;/h2&gt;

&lt;p&gt;Unlike the Function or Consumer interfaces, we don’t have an &lt;code&gt;andThen()&lt;/code&gt;method for predicates. However, you can chain predicates using the &lt;code&gt;and()&lt;/code&gt;, &lt;code&gt;or()&lt;/code&gt;, and &lt;code&gt;negate()&lt;/code&gt; methods. These methods allow you to combine multiple predicates into a logical chain, facilitating complex conditional checks in a concise manner.&lt;/p&gt;

&lt;p&gt;Example of Predicate Chaining:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Predicate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;equals&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Saami"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;Predicate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;startsWith&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"S"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;Predicate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;endsWith&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"b"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Chaining predicates using or(), negate(), and and()&lt;/span&gt;
&lt;span class="nc"&gt;Predicate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;combined&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;or&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;negate&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;and&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p3&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; 

&lt;span class="c1"&gt;// Here, chaining requires no `andThen()`; you can directly chain the logical convenience methods using the dot (.) operator.&lt;/span&gt;
&lt;span class="c1"&gt;// Thus making a LOGICAL CHAIN&lt;/span&gt;

&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;combined&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SaamI"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Outputs: false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;p1 checks if the string equals &lt;strong&gt;"Saami"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;p2 checks if the string starts with &lt;strong&gt;"S"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;p3 checks if the string ends with &lt;strong&gt;"b"&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The combined predicate first checks if either p1 or p2 is true and then negates that result. Finally, it checks if p3 is true. This allows you to build a logical chain without needing additional methods like &lt;code&gt;andThen()&lt;/code&gt;, making it straightforward and intuitive.&lt;/p&gt;

&lt;p&gt;By utilizing these chaining methods, you can create complex conditional logic while keeping your code clean and readable, which aligns perfectly with the goals of functional programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom Functional Interface Chaining vs. Default Functional Interfaces
&lt;/h2&gt;

&lt;p&gt;While creating custom functional interfaces allows for flexibility in defining specific behaviors, chaining these custom interfaces can become quite complex. Here’s why using default functional interfaces is often the better choice:&lt;/p&gt;

&lt;h3&gt;
  
  
  Complexity of Custom Functional Interface Chaining:
&lt;/h3&gt;

&lt;p&gt;When you decide to chain custom functional interfaces, you must carefully consider how parameters are passed between lambdas. This involves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameter Matching: Ensuring that the parameters of one lambda match the expected input type of the next. This can add overhead to your design.&lt;/li&gt;
&lt;li&gt;Edge Case Handling: You need to think through various edge cases and potential input scenarios to maintain consistent and correct behavior across chains.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This added complexity can lead to more cumbersome and error-prone code.&lt;/p&gt;

&lt;p&gt;Default Functional Interfaces Are Optimized for such purposes, Java's built-in functional interfaces, such as Function, Predicate, and Consumer, are designed for common use cases and come with several advantages:&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In summary, functional programming in Java offers powerful tools for writing clean, efficient, and maintainable code. By leveraging lambda expressions, method references, and functional interfaces, developers can express complex operations concisely. Chaining functions, whether through the &lt;code&gt;andThen()&lt;/code&gt; method for functional transformations or through logical methods for predicates, enhances code readability and organization.&lt;/p&gt;

&lt;p&gt;While custom functional interfaces provide flexibility, they often introduce complexity that can be avoided by utilizing Java’s built-in default functional interfaces. This approach not only streamlines the development process but also aligns with the principles of functional programming.&lt;/p&gt;

&lt;p&gt;By understanding and applying these concepts, you can unlock the full potential of functional programming in Java, making your code more expressive and easier to maintain.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All information in this post reflects my personal learnings as I document my journey in programming. I casually create posts to share insights with others.&lt;br&gt;
I would love to hear any additional tips or insights from fellow developers! Feel free to share your thoughts in the comments below.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>java</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>How AI Can Elevate You as a Developer</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Tue, 24 Sep 2024 09:30:00 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/how-ai-can-elevate-you-as-a-developer-27fk</link>
      <guid>https://dev.to/saamiabbaskhan/how-ai-can-elevate-you-as-a-developer-27fk</guid>
      <description>&lt;p&gt;There’s a common misconception that AI will take over and replace all jobs. This simply isn’t true. While some jobs will disappear, especially low-skill ones, AI is also opening up new opportunities. For instance, there was a time when just being able to create a simple landing page with &lt;code&gt;HTML&lt;/code&gt;and &lt;code&gt;CSS&lt;/code&gt;was enough to be in demand. But as competition increased and no-code platforms like &lt;em&gt;Wix&lt;/em&gt; and &lt;em&gt;Webflow&lt;/em&gt; grew, the demand for low-end web developers diminished.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;AI&lt;/strong&gt;, however, the landscape has shifted again. Now, tools like ChatGPT can assist with debugging, generating &lt;code&gt;README&lt;/code&gt;files, boilerplates, or even answering complex questions. This is a huge advantage for developers. While AI might handle general tasks efficiently, it can’t replace the nuanced skills of professional developers for more complex and specific tasks also there will always be a need for people who manage, supervise, or complement AI solutions.&lt;/p&gt;

&lt;p&gt;As developers, we need to evolve by practicing, learning, and contributing more. AI can take away some tasks, but it also opens up possibilities—whether it’s automating work or helping create complex workflows. AI is impacting everything, from making PDFs to generating images, and is present in almost every field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adapting as a Developer
&lt;/h2&gt;

&lt;p&gt;Given this shift, showcasing a simple project on your portfolio isn’t enough anymore. What you need to focus on is going deeper into your chosen tech stack, mastering your tools, and learning how AI and automation can fit into your work. For example, you can specialize in something like say Spring Boot but still cover other essential areas like soft skills (communication and marketing) and integrating AI into your workflows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr959pustz9rwmvwvo9jx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr959pustz9rwmvwvo9jx.jpg" alt="A professional growth pattern, where deep expertise is developed in one core area ('Deep Knowledge of One Stack') while maintaining a broad understanding of other related fields" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This balanced growth makes you not only a master in your field but also adaptable. And remember: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Many people think we have to be the first one to finish the race but the reality is just don't be the last one&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You just need to avoid being the last. Perfection is overrated, but being better than the majority will make you stand out.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’m sharing this post based on my knowledge and experience, and I’d love to hear your thoughts in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>career</category>
      <category>hiring</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is Semantic Markup? ~ GameDev Challenge</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Sun, 22 Sep 2024 18:47:25 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/what-is-semantic-markup-gamedev-challenge-3k2a</link>
      <guid>https://dev.to/saamiabbaskhan/what-is-semantic-markup-gamedev-challenge-3k2a</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/webgame"&gt;Web Game Challenge&lt;/a&gt;: One Byte Explainer&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explainer
&lt;/h2&gt;

&lt;p&gt;Semantic markup refers to the use of HTML elements that clearly describe their meaning in a way that’s both easy for developers and understood by machines e.g, use of tags like &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Context
&lt;/h2&gt;

&lt;p&gt;Using semantic markup makes our code SEO-optimized and user-friendly by improving its chances of appearing at the top of search results. It also enhances code readability, enables better layouts, improves UX, and is widely used by screen readers for accessibility.&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/saamiabbaskhan"&gt;@saamiabbaskhan&lt;/a&gt; &lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gamechallenge</category>
      <category>gamedev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Scoping in HTML</title>
      <dc:creator>Saami abbas Khan</dc:creator>
      <pubDate>Sun, 22 Sep 2024 18:32:26 +0000</pubDate>
      <link>https://dev.to/saamiabbaskhan/scoping-in-html-5ai9</link>
      <guid>https://dev.to/saamiabbaskhan/scoping-in-html-5ai9</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/webgame"&gt;Web Game Challenge&lt;/a&gt;: One Byte Explainer&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explainer
&lt;/h2&gt;

&lt;p&gt;In HTML, there are two types of elements: &lt;em&gt;block&lt;/em&gt; and &lt;em&gt;inline&lt;/em&gt;. Block elements (e.g. &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;) cover the entire line, while inline elements (e.g., &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;) occupy only the necessary space. A block element can't be wrapped inside an inline element like &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Context
&lt;/h2&gt;

&lt;p&gt;If we wrap a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; (a block element) with a &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; tag, it will behave unexpectedly. For example, applying a background color to that &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element will only partially work. Remember to always wrap inline elements (like &lt;span&gt;) with block elements (like ), not the other way around.

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/saamiabbaskhan"&gt;@saamiabbaskhan&lt;/a&gt; &lt;/p&gt;

&lt;/span&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gamechallenge</category>
      <category>gamedev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
