Skip to main content

8 posts tagged with "best-practices"

View All Tags

I Have Multiple Changes But Only Want to Commit the Port Update鈥擬y Git Partial Staging Journey

13 min read
Mahmut Salman
Software Developer

I changed my dev server port from 5173 to 5174 across three files, but I also had other unrelated changes in those same files! 馃槹 I only wanted to commit the port changes. My mentor walked me through Git's partial staging features: git add -p, git stash, interactive staging, and patch mode. After some trial and error (and learning what NOT to do), I successfully committed only the port changes while keeping my other work-in-progress safe. This is professional Git workflow! 馃幆

Stop Writing For Loops: Master Java Streams with 5 Essential Patterns

14 min read
Mahmut Salman
Software Developer

I used to think Java Streams were confusing magic. I avoided them for months, writing nested for loops like it was 2005. Then I saw a senior developer calculate cart totals in ONE line of code that took me 15 lines. I felt like a caveman discovering fire. 馃敟 Let me teach you the 5 patterns that cover 90% of real-world Stream usage鈥攏o PhD required.

Mastering Two-Tier Exception Handling in Spring Boot: A Complete Guide

11 min read
Mahmut Salman
Software Developer

Ever wondered why sometimes your Spring Boot exceptions are caught by @RestControllerAdvice and other times they're not? Or why your custom AccessDeniedHandler returns 403 before your controller even executes? I spent hours debugging this mystery until I understood Spring Boot's two-tier exception handling architecture. Let me save you the confusion. 馃幆

Wait, You're Exposing Your Password?! Understanding Input vs Output DTOs in Spring Boot

14 min read
Mahmut Salman
Software Developer

I'll never forget the day I accidentally exposed user passwords in my API responses. I returned the entire User entity from a GET endpoint, thinking "Spring Boot will handle it!" Spoiler alert: It returned EVERYTHING鈥攊ncluding hashed passwords, internal IDs, and timestamps. My code reviewer nearly had a heart attack. 馃槺 That's when I learned about DTOs. Let me save you from this nightmare.