Something as trivial as 'getOrDefault' cost me hours of debugging 🤦♂️ I wanted a simple thing - “use a default value if the key is missing.” AI generated the code using `getOrDefault`. It looked correct. I reviewed it. Didn’t think twice. But the issue wasn’t a missing key. The key existed… with a null value. And getOrDefault doesn’t apply the default in that case. So the code was “right”… but the behavior was wrong. What’s uncomfortable is: I knew that a key can have a null value. Still, I didn’t catch it during review. Not because the code was complex but because I didn’t fully account for this nuance. That’s the real risk 😅 It’s not about AI making mistakes. It’s about us assuming the code does what we intend. What you ask for, what gets generated, and how it actually behaves - can all be different. And these gaps are not easy to catch with just tests or lower environments. Fundamentals and language-specific nuances matter more than ever. Because in the end, correctness is still our responsibility. #SoftwareEngineering #CleanCode #Java #Coding
Lessons learned from getOrDefault pitfalls in Java
More Relevant Posts
-
AI-assisted coding has made it incredibly easy to write code. But writing code was never the hard part. The real engineering begins when you ask: - How does this behave under load? - What do JVM metrics say when traffic spikes? - Should we go full concurrency, or controlled parallelism? - Do we scale horizontally or vertically? - What’s the cost trade-off of each decision? That’s where judgment matters. AI can generate threads, but it won’t decide the right level of concurrency for your system. It can suggest patterns, but it won’t own your production incidents. It can optimize snippets, but it won’t balance performance vs cost vs reliability. That’s still on us.(At least for now… unless someone builds an incredibly complex agent architecture that can debug production issues, tune performance, scale systems, and run cost analysis better than us. In which case, we might need to have a different conversation.) I’ve always enjoyed working with Java, especially its multithreading capabilities. But in real systems, even something as “simple” as threading becomes a series of trade-offs: - Throughput vs stability - Latency vs resource usage - Speed vs predictability The difference between a good engineer and a great one isn’t how fast they write code anymore. It’s how well they think through trade-offs. Code is easy. Decisions are hard. And that’s exactly where engineering lives. #SoftwareEngineering #AI #AICoding #SystemDesign #BackendEngineering #Java #JVM #Multithreading #Concurrency #Scalability #DistributedSystems Read “Multithreading in Java: Implementing Multithreading with Spring Annotations“ by Yash Paliwal on Medium: https://lnkd.in/g2qyD3JK
To view or add a comment, sign in
-
🚀 Day 88 – DSA Journey | Binary Tree Postorder Traversal Continuing my daily DSA practice, today I tackled one of the trickier tree traversals using an iterative approach. 📌 Problem Practiced: Binary Tree Postorder Traversal (LeetCode 145) 🔍 Problem Idea: Traverse a binary tree in postorder — Left → Right → Root — and return the node values. 💡 Key Insight: Postorder traversal is not straightforward iteratively. A clever trick is to reverse a modified preorder traversal (Root → Right → Left) to achieve the correct order. 📌 Approach Used: • Use a stack to process nodes • Traverse in Root → Right → Left order • Insert elements at the beginning of the result list • This effectively reverses the order to get Left → Right → Root 📌 Concepts Strengthened: • Tree traversal (Postorder) • Stack usage • Iterative traversal tricks • Reversing traversal logic ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) 🔥 Today’s takeaway: Sometimes solving a problem becomes easier when you reverse the perspective — small tricks can simplify complex logic. On to Day 89! 🚀 #Day88 #DSAJourney #LeetCode #BinaryTree #Stack #Java #ProblemSolving #Coding #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
AI Tools Every Developer Should Know From APIs to Production. Another interesting episode from Sateesh Tech Talk, breaking down the end-to-end AI stack for building real, production ready AI apps using familiar software engineering patterns. 🎥 https://lnkd.in/g-YqcHQj You’ll learn: • How requests flow through APIs, RAG, LLMs, tools, and production systems • Upper vs. lower layers of the AI stack • Implementing the same architecture in Java and Python • Why RAG, tools, and observability matter If you can build APIs or microservices, you already have the skills to build AI systems.
End‑to‑End AI Stack Explained | AI Tools Every Developer Should Know | (Java & Python)
https://www.youtube.com/
To view or add a comment, sign in
-
Most people think debugging is about finding the bug. It's not. It's about building the system that finds the next one faster. At my current role, when I joined, critical backend issues took about 48 hours to resolve. Not because people were slow — because there was no structure around how issues got triaged, reproduced, and traced through the pipeline. I didn't write a magic tool. I just built a repeatable debugging workflow. Structured logging in the right places. Clear escalation steps. A habit of writing down what broke and why after every incident. Resolution time dropped to about 12 hours. The lesson I keep relearning: the highest-leverage engineering work is often not building new features. It's making the system easier to understand when something goes wrong at midnight. That applies to every backend I've worked on — Java microservices, Python pipelines, LLM-integrated workflows. The stack changes. The need for structured observability never does. #SoftwareEngineering #BackendEngineering #Debugging #Python #ProductionSystems #AIEngineering #BuildInPublic
To view or add a comment, sign in
-
💻 Two realities of the dev world: — “It worked on my machine” 👉 The most expensive sentence in the history of software. — “It’s just a small change” 👉 Translation: full refactor, 3 critical bugs, and a sleepless night. Development isn’t about writing code. It’s about constantly dealing with the unexpected. #SoftwareEngineer #Martzcode #AI #Java #Typescript
To view or add a comment, sign in
-
🚀 Solved “Search Insert Position” using Binary Search on LeetCode! Today I worked on an interesting problem where the goal is to find the index of a target element in a sorted array. If the target is not present, we return the index where it should be inserted to maintain sorted order. 🔍 Approach: Instead of using a linear search (O(n)), I implemented an efficient Binary Search (O(log n)) approach. 💡 Key Learning: One important detail is calculating the middle index safely: mid = low + (high - low) / 2 This avoids potential integer overflow compared to (low + high) / 2 and ensures correct behavior even for large inputs. ⚙️ Logic: If target == arr[mid] → return mid If target > arr[mid] → search right half Else → search left half If not found → return ‘low’ as the correct insert position 📈 Result: Achieved 100% performance on LeetCode 🚀 This problem reinforced my understanding of: ✔ Binary Search fundamentals ✔ Edge case handling ✔ Writing optimized and safe code Looking forward to solving more problems and improving problem-solving skills! #LeetCode #BinarySearch #Java #DataStructures #Coding #ProblemSolving
To view or add a comment, sign in
-
-
The biggest gap in AI coding isn't writing code. It's proving it works. Your coding agent generates code in seconds. But it doesn't write tests. Doesn't know your stack. Doesn't pick the right framework. And doesn't maintain a testing strategy as your project grows. I built `bestest` to fill that gap. An open-source testing architect that lives inside your coding agent. Run `/bestest init` on any repo. It runs a 7-phase detection engine across 80+ signals, produces a StackProfile with confidence scores, then walks you through framework selection backed by ADRs. Not vibes. Documented architectural reasoning. Once you pick a framework, it generates tests that compile, pass, and cover real behavior. Every test goes through a verification loop: compile, execute, analyze failures, fix, rerun. No coverage theater. Supports JS/TS, Python, Java, Go. Generates CI. Migrates frameworks (Jest to Vitest, JUnit 4 to 5, Cypress to Playwright). Keeps a living TESTING.md that auto-updates on every scan. 19 commands. 50+ reference files. One `/bestest init` to start. Works with Claude, GSD, any agent with skill support. Link in comments. #BuildInPublic #AITools #Testing #OpenSource
To view or add a comment, sign in
-
Chinese labs keep on shipping, I hope this will motivate US labs to innovate and push the frontier and keep leading. On paper Kimi K2.6 looks very impressive, on par with closed source models. "Long-horizon coding - 4,000+ tool calls, over 12 hours of continuous execution, with generalization across languages (Rust, Go, Python) and tasks (frontend, devops, perf optimization)." https://lnkd.in/gG3CXfYP
To view or add a comment, sign in
-
-
Every Java dev knows the feeling of trying to learn faster… and somehow ending up even more overwhelmed. AI was supposed to fix that, right? This video goes straight into that strange moment when AI gives you more answers, more options, more roadmaps… and way less clarity. It shows the hidden problem many developers don’t realize they’re stuck in. If you’ve been jumping between topics, tutorials, and AI prompts and still not moving toward better opportunities, this will make you pause. Weekly Live → https://bit.ly/48ophNZ
Too Much to Learn in Java? Don’t Let AI Make You More Lost
To view or add a comment, sign in
-
Just wrapped my talk at ArcOfAI in Austin yesterday. 75 minutes on AI coding agents for full-stack Java dev in IntelliJ IDEA. Here's what we covered... AI coding agents aren't autocomplete anymore. They write entire features, generate tests, and produce docs. The shift is real and it's fast. We did a live head-to-head: GitHub Copilot vs JetBrains Junie, running Claude, GPT, Gemini, and Grok side-by-side inside IntelliJ IDEA 2026.1. And then topped it off with an OpenCode demo. The stack I used: Spring Boot + The Apache Grails Framework. Why Grails? Groovy gives you ~30-40% better token efficiency vs pure Java. That matters a lot when you're hitting context limits. We also got real about the pitfalls: ↳ Hallucinations inventing fake methods and plugins ↳ Context loss mid-session on large codebases ↳ Security risks from unreviewed AI commits ↳ Over-reliance leading to hidden tech debt And I showed my GitHub contribution graph: 7,744 contributions in the last year. Agentic engineering acceleration is not theoretical. The audience brought great energy and sharp questions. Austin did not disappoint. 🚀 Slides link in the comments 👇
To view or add a comment, sign in
-
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
The challenge with reviewing AI-generated code is that it appears correct at first glance, you’re effectively reviewing senior-level code that contains subtle, junior-level mistakes. The code is often well-structured, idiomatic, and uses appropriate abstractions. This creates a “senior-level appearance.” Issues tend to appear in edge cases, error handling or implicit assumptions, areas where deeper reasoning or context is required.