<?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 Himanshu Kawale on Medium]]></title>
        <description><![CDATA[Stories by Himanshu Kawale on Medium]]></description>
        <link>https://medium.com/@himanshu.kawale_92475?source=rss-2888cb8974e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Himanshu Kawale on Medium</title>
            <link>https://medium.com/@himanshu.kawale_92475?source=rss-2888cb8974e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:45:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@himanshu.kawale_92475/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[How Java and Python Taught Me That Programming Languages Shape the Way We Think]]></title>
            <link>https://medium.com/@himanshu.kawale_92475/how-java-and-python-taught-me-that-programming-languages-shape-the-way-we-think-1d7fffce1c8f?source=rss-2888cb8974e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d7fffce1c8f</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Himanshu Kawale]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 12:18:48 GMT</pubDate>
            <atom:updated>2026-06-07T12:18:48.407Z</atom:updated>
            <content:encoded><![CDATA[<p>One thing I’ve always found fascinating after working with both Java and Python is how differently they approach failure handling.</p><p>At first glance, it seems like a technical distinction. But the more time I spent with both languages, the more I realized it goes beyond syntax. It reflects two fundamentally different philosophies about how software should be written.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gR2kEdGm8xxKAzUpn22OFw.png" /></figure><h3>Java: Look Before You Leap</h3><p>In Java, developers are often encouraged to write code defensively.</p><p>Before performing an operation, we tend to verify that everything is in the expected state:</p><ul><li>Check for null</li><li>Validate inputs</li><li>Verify that an object or resource exists</li><li>Ensure conditions are satisfied</li></ul><p>Only then do we proceed with the operation.</p><p>We prevent errors before they happen.</p><pre>if (user != null &amp;&amp; user.getName() != null) {<br>    System.out.println(user.getName());<br>}</pre><p>This approach is often described as <strong>“Look Before You Leap” (LBYL)</strong>. It prioritizes predictability and explicit checks, reducing the likelihood of unexpected runtime failures.</p><p>In large enterprise systems, where reliability and strict contracts matter, this philosophy makes a lot of sense.</p><h3>Python: Easier to Ask Forgiveness Than Permission</h3><p>Python often takes a different approach.</p><p>Instead of checking every possible condition beforehand, Python encourages attempting the operation directly and handling exceptions only if something goes wrong.</p><pre>try:<br>    print(data[&quot;name&quot;])<br>except KeyError:<br>    print(&quot;Missing name&quot;)</pre><p>Rather than writing:</p><pre>if &quot;name&quot; in data:<br>    print(data[&quot;name&quot;])</pre><p>Python embraces the philosophy known as <strong>EAFP — Easier to Ask Forgiveness than Permission</strong>.</p><p>The assumption is that the operation will usually succeed. If it doesn’t, the language provides a clean and explicit way to handle the failure.</p><p>This often leads to code that is shorter, more readable, and focused on the primary path rather than all possible edge cases.</p><h3>It’s More Than Just Syntax</h3><p>What I find most interesting is that these approaches subtly influence how you design software.</p><p>When writing Java, I often find myself thinking:</p><p><em>“What could go wrong before this executes?”</em></p><p>When writing Python, the thought process shifts toward:</p><p><em>“Let’s perform the operation and handle exceptions if they occur.”</em></p><p>Neither approach is universally better. Each evolved from the design goals and ecosystem of its language.</p><p>But over time, these patterns become habits. They shape how we reason about problems, structure our code, and even review the work of other developers.</p><h3>Learning Languages Means Learning Perspectives</h3><p>One of the biggest benefits of learning multiple programming languages isn’t gaining access to more tools.</p><p>It’s gaining exposure to different ways of thinking.</p><p>Every language carries opinions about software design:</p><ul><li>How errors should be handled</li><li>How abstractions should be built</li><li>How readability should be prioritized</li><li>How much responsibility should be placed on the developer</li></ul><p>When you switch between languages, you begin to notice these philosophies everywhere.</p><p>You stop seeing programming languages as collections of keywords and frameworks. Instead, you start seeing them as different approaches to solving the same problems.</p><h3>Final Thoughts</h3><p>The contrast between Java’s defensive style and Python’s EAFP philosophy is a great example of how language design influences developer behavior.</p><p>Different languages don’t just give us different syntax.</p><p>They encourage different mindsets.</p><p>And the more languages you learn, the more you appreciate that programming is not only about writing code, it’s also about understanding the ideas and philosophies that shape it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d7fffce1c8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Making Any Java Resource Auto-Closeable (A Clean Code Trick You’ll Actually Reuse)]]></title>
            <link>https://medium.com/@himanshu.kawale_92475/making-any-java-resource-auto-closeable-a-clean-code-trick-youll-actually-reuse-d7f2a6280f9f?source=rss-2888cb8974e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7f2a6280f9f</guid>
            <category><![CDATA[java-tips-and-tricks]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-tips]]></category>
            <dc:creator><![CDATA[Himanshu Kawale]]></dc:creator>
            <pubDate>Sun, 03 May 2026 14:28:10 GMT</pubDate>
            <atom:updated>2026-05-03T14:28:10.061Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve worked with Java long enough, you’ve probably developed a deep appreciation for try-with-resources.</p><p>It’s clean.<br>It’s safe.<br>It prevents those “oops, forgot to close it” bugs.</p><p>But then you run into <em>that one class</em>…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wc1PmHy3LL8yDJfQAoOD9g.png" /></figure><h3>Not Everything Plays Nice with AutoCloseable</h3><p>Consider Timer.</p><p>It has a cancel() method to clean up resources, but it <strong>doesn’t implement </strong><strong>AutoCloseable</strong>.</p><p>So you’re forced into this pattern:</p><pre>Timer timer = new Timer();<br>try {<br>    timer.schedule(new SomeTask(), 1000);<br>} finally {<br>    timer.cancel(); // easy to forget<br>}</pre><p>This works, until it doesn’t.</p><ul><li>Someone forgets the finally</li><li>A refactor removes it accidentally</li><li>An early return bypasses cleanup</li></ul><p>Now you’ve got lingering threads and subtle bugs that are <em>painful</em> to debug.</p><h3>Adapt, Don’t Suffer</h3><p>Instead of repeating this pattern everywhere, we can <strong>wrap the resource once</strong> and make it compatible with try-with-resources.</p><h3>Step 1: Create a Simple Adapter</h3><pre>public class AutoCloseableTimer implements AutoCloseable {<br>    private final Timer timer;<br><br>    public AutoCloseableTimer(Timer timer) {<br>        this.timer = timer;<br>    }<br>    public Timer get() {<br>        return timer;<br>    }<br>    @Override<br>    public void close() {<br>        timer.cancel();<br>    }<br>}</pre><h3>Step 2: Use It Like a Native Resource</h3><pre>try (var t = new AutoCloseableTimer(new Timer())) {<br>    t.get().schedule(new SomeTask(), 1000);<br>}</pre><p>No finally.<br>No mental overhead.<br>No chance of forgetting the cleanup.</p><h3>Make It Generic</h3><p>Now let’s make this pattern reusable for <em>any</em> resource.</p><pre>public class AutoCloseableResource&lt;T&gt; implements AutoCloseable {<br>    private final T resource;<br>    private final Runnable closer;<br><br>    public AutoCloseableResource(T resource, Runnable closer) {<br>        this.resource = resource;<br>        this.closer = closer;<br>    }<br>    public T get() {<br>        return resource;<br>    }<br>    @Override<br>    public void close() {<br>        closer.run();<br>    }<br>}</pre><h3>Usage Example</h3><pre>try (var wrapped = new AutoCloseableResource&lt;&gt;(new Timer(), timer::cancel)) {<br>    wrapped.get().schedule(task, 1000);<br>}</pre><h3>Why This Works So Well</h3><h3>1. Eliminates Repetition</h3><p>You don’t rewrite try-finally blocks everywhere.</p><h3>2. Reduces Cognitive Load</h3><p>No need to remember:</p><blockquote><em>“Did I cancel this?”</em></blockquote><h3>3. Prevents Subtle Bugs</h3><p>Missing cleanup is one of those issues that doesn’t fail fast — it silently causes problems later.</p><h3>Things to Keep in Mind</h3><ul><li>Your closer logic <strong>must be safe and idempotent</strong> (calling it multiple times shouldn’t break things).</li><li>Be cautious with resources that:<br>- Throw checked exceptions during cleanup<br>- Require ordered shutdown of multiple components</li><li>Don’t overuse this for trivial objects , it’s most useful for <strong>resources with lifecycle responsibility</strong> (threads, connections, streams, etc.)</li></ul><h3>Real-World Use Cases</h3><p>This pattern is surprisingly versatile:</p><ul><li>JDBC connections that aren’t managed properly</li><li>Custom SDK clients with shutdown() methods</li><li>Thread pools (executor.shutdown())</li><li>File or stream wrappers in legacy code</li><li>Hardware/device SDKs</li></ul><h3>The Bigger Insight</h3><p>It’s about a mindset shift:</p><blockquote><strong><em>If an API doesn’t fit your code style, adapt the API, not your discipline.</em></strong></blockquote><p>Good developers don’t rely on memory to write correct code.<br>They design systems where <em>correctness is the default</em>.</p><h3>Final Thought</h3><p>Java gave us try-with-resources for a reason. To make cleanup automatic and reliable.</p><p>If a class doesn’t support it, that’s not your limitation.</p><p>It’s just an opportunity to wrap it once, and never think about it again.</p><p>If you’ve ever been bitten by a missing close() or cancel(), this tiny pattern might save you hours someday.</p><p>And honestly… it just feels good to write code that cleans up after itself 🙂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7f2a6280f9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Debug When I Have No Clue What’s Wrong]]></title>
            <link>https://medium.com/@himanshu.kawale_92475/how-i-debug-when-i-have-no-clue-whats-wrong-8fa815be8888?source=rss-2888cb8974e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fa815be8888</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Himanshu Kawale]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 14:57:19 GMT</pubDate>
            <atom:updated>2026-04-26T14:57:19.556Z</atom:updated>
            <content:encoded><![CDATA[<p>Earlier, I used to think debugging was all about being smart enough to spot the issue instantly.</p><p>I believed good developers could look at a problem once, connect the dots in seconds, and magically know the exact bug causing everything to break.</p><p>Over time, I learned that’s rarely how real debugging works.</p><p>Most of the time, debugging is not about brilliance.<br>It’s about having a system.</p><p>Because when production is failing, deadlines are close, and nothing makes sense, “just think harder” doesn’t help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xfgjs0uYbRa11R5gNOIgNA.png" /></figure><p>Here’s the approach I follow whenever I’m completely stuck.</p><h3>1. Start With What I Know</h3><p>The first question I ask is simple:</p><p><strong>What changed?</strong></p><p>If something was working before and suddenly stopped, then somewhere between those two points, something introduced the problem.</p><p>It could be:</p><ul><li>a code change</li><li>a configuration update</li><li>an environment issue</li><li>a dependency version change</li><li>even a small “harmless” tweak</li></ul><p>Instead of looking everywhere, I go back to the last known working state.</p><p>Debugging becomes much easier when you have a clear scope to search.</p><h3>2. Reduce the Scope</h3><p>When a large system breaks, it feels overwhelming because everything looks connected.</p><p>That’s why I try to make the problem smaller.</p><p>I break the system into parts:</p><ul><li>Is the issue in the frontend or backend?</li><li>Is it the API or the database?</li><li>Is the request failing before validation or after processing?</li></ul><p>The goal is not to solve the problem immediately.</p><p>The goal is to isolate it.</p><p>Because once the scope becomes small enough, the bug usually appears voluntarily.</p><h3>3. Increase Visibility</h3><p>Guessing is expensive.</p><p>Observation is cheaper.</p><p>Whenever I feel confused, I add visibility:</p><ul><li>logs</li><li>print statements</li><li>temporary checks</li><li>request/response inspection</li><li>database verification</li><li>step-by-step execution</li></ul><p>I want facts, not assumptions.</p><p>A lot of debugging pain comes from solving the wrong problem because we trusted what we “thought” was happening.</p><p>Visibility replaces imagination with evidence.</p><p>That changes everything.</p><h3>4. Follow the Flow Slowly</h3><p>One of the biggest debugging mistakes is jumping to conclusions too early.</p><p>We see one suspicious thing and immediately decide:</p><p>“That must be the issue.”</p><p>Slow Down…</p><p>Follow the execution step by step:</p><ul><li>where the request starts</li><li>where the data changes</li><li>where the expected behavior breaks</li></ul><p>Sometimes the actual problem is far away from where the symptom appears.</p><p>Slow is often faster.</p><h3>5. Explain It Out Loud</h3><p>This sounds strange, but it works surprisingly well.</p><p>I explain the issue to myself as if I’m teaching someone else.</p><p>Sometimes to a teammate.<br>Sometimes to a wall.<br>(Sometimes I can’t differentiate between the two)</p><p>If I cannot explain:</p><ul><li>What should happen</li><li>What is actually happening</li><li>Where the difference begins</li></ul><p>…then I probably don’t understand the problem yet.</p><p>And unclear understanding creates bad fixes.</p><p>Clarity often appears while explaining.</p><p>That’s why “rubber duck debugging” is famous for a reason.</p><h3>6. Challenge Assumptions</h3><p>This one hurts the ego the most.</p><p>Because bugs usually hide behind assumptions like:</p><ul><li>“This API definitely returns the right data”</li><li>“This condition should never be false”</li><li>“That function has already been tested”</li><li>“The issue can’t be there”</li></ul><p>Famous last words.</p><p>Some of the hardest bugs I’ve fixed existed because I trusted something I never verified.</p><p>Now I try to ask:</p><p><strong>What am I assuming is correct without proof?</strong></p><p>That question has saved me more times than I can count. (Metaphor, obviously. I can count. At least till 7.)</p><h3>The Biggest Shift for Me</h3><p>The biggest mindset change was realizing this:</p><p><strong>Debugging isn’t about having answers.</strong></p><p>It’s about building a process that leads you to them.</p><p>Good debugging is not magic.</p><p>It’s structure.</p><p>It’s patience.</p><p>It’s discipline.</p><p>And most importantly, it’s the willingness to slow down when everything inside you wants to rush.</p><p>Because when nothing makes sense, speed creates chaos.</p><p>Clarity creates solutions.</p><h3>Final Thought</h3><p>If you’re stuck, don’t panic.</p><p>Don’t rush.</p><p>Make the problem smaller.</p><p>Observe more.</p><p>Assume less.</p><p>Follow the trail.</p><p>Most bugs are not impossible.<br>They’re just hiding behind noise.</p><p>Your job is not to guess.</p><p>Your job is to remove the noise.</p><p>And that’s where real debugging begins.</p><p>Let me know your story of debugging.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fa815be8888" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>