Maher (@knmaher) profile picture

Java & Spring Boot Developer | Building SaaS in public | Sharing backend tips & clean architecture thoughts

Joined December 2021
Photo by Maher (@knmaher)Photo by Maher (@knmaher)Photo by Maher (@knmaher)Photo by Maher (@knmaher)Photo by Maher (@knmaher)
World Cup 2026 is done for Iraq. We knew this group was stacked with France, Norway and Senegal — no one expected us to breeze through or anything. Qualifying after 40 years was already a big deal. But honestly, the way we played… that’s what’s frustrating. We expected more fight from the lads. More heart, better organization, some real chances instead of just sitting back and getting picked apart. The losses were heavy and it didn’t feel like we showed up with the right mentality against teams at that level. This level isn’t good enough. Things have to change — the preparation, the tactics, how the team approaches these big games. We can’t keep accepting performances like this. Qualifying got us here, now we need to actually compete properly next time around. #Iraq #WorldCup2026
109
Mesopotamia! Mesopotamia! Lions never die! Lions of Mesopotamia! Tomorrow vs France – no fear, only fire! We’ve waited decades for this. Give everything on that pitch. Philadelphia, feel the roar! 🦁🇮🇶 #Iraq #WorldCup #france
125
Wishing all Yazidis around the world a blessed and joyful Ser sal! May this New Year bring peace, healing, and hope to your communities. 🌸 #Sersal #YazidiNewYear
108
Unpopular opinion: junior developers should spend less time learning frameworks and more time learning how APIs, databases, and debugging actually work. Frameworks change. Foundations pay forever. Agree or disagree?
133
Enums in Java Are Not Just Constants They Support Fields, Methods & Polymorphism Eliminate switch. Move Logic Inside the Enum. #Java
84
Need a map that’s fast and keeps the order you insert keys? LinkedHashMap = HashMap + doubly-linked list. ✅ Predictable iteration ✅ Perfect for JSON/config output ✅ Turn on accessOrder=true → instant LRU cache. #Java #CleanCode #maher4j
1
79
See this 👇🏼
Java trick 💡 Since JDK 16 you can pattern-match right inside instanceof if (obj instanceof User u && u.active()) { welcome(u); } Stop writing the old two-step 👇 if (obj instanceof User) { User u = (User) obj; } Clearer, safer, one line. #Java
1
296
Java trick 💡 Since JDK 16 you can pattern-match right inside instanceof if (obj instanceof User u && u.active()) { welcome(u); } Stop writing the old two-step 👇 if (obj instanceof User) { User u = (User) obj; } Clearer, safer, one line. #Java
1
2
334
See this 👇🏼
We once refunded €10 000 overnight. No hacker. No missing semicolon. Just one innocent-looking Java line. Here’s the bug that cost us — and how you can dodge it 👇🏼 #Java #CleanCode #Maher4J
1
408
We once refunded €10 000 overnight. No hacker. No missing semicolon. Just one innocent-looking Java line. Here’s the bug that cost us — and how you can dodge it 👇🏼 #Java #CleanCode #Maher4J
1
1
448
The code: if (!amountPaid.equals(expected)) { refund(); // 🔥 } On prod, amountPaid = 10 and expected = 10.00. equals() returned false → system thought the charge was “wrong” → mass refunds. 🤦🏻
1
11
We now forbid .get() in code reviews — unless there’s a guard. Anyone else have Optional usage rules in your team?
We now forbid .get() in code reviews — unless there’s a guard. Anyone else have Optional usage rules in your team?
164
We now forbid .get() in code reviews — unless there’s a guard. Anyone else have Optional usage rules in your team?
We once lost hours debugging a NullPointerException. Cause? Optional.get() — someone assumed it was always present. Now our rule is simple: ❌ Never use .get() ✅ Always use .orElse, .orElseThrow, or .ifPresent It’s not just cleaner — it’s safer. #Java #CleanCode #DevLife
2
1
428
We once lost hours debugging a NullPointerException. Cause? Optional.get() — someone assumed it was always present. Now our rule is simple: ❌ Never use .get() ✅ Always use .orElse, .orElseThrow, or .ifPresent It’s not just cleaner — it’s safer. #Java #CleanCode #DevLife
1
2
293
I used to inject services into entities “just to make it work.” It worked — until it made testing painful and the domain layer messy. Clean Architecture changed how I think. Entities shouldn’t know about Spring. Ever.
2
303
Most Java devs never use sealed classes. But they’re perfect when you want strict control over inheritance. Here’s how sealed classes help you write safer, cleaner, and more predictable code
1
5
1,182
Define a sealed base interface: public sealed interface UserRole permits Admin, Editor, Viewer {} Now only Admin, Editor, and Viewer can implement UserRole.
1
52
Java trick 💡 Map.of() creates an immutable map. Trying to do map.put(...) throws: UnsupportedOperationException Map<String, String> config = Map.of("env", "prod"); config.put("debug", "true"); // 💥 boom Use new HashMap<>(Map.of(...)) if you need to modify it. #Java
1
1
17
1,237
If you don’t need the exception variable in a catch block, you can use _ to ignore it since Java 9: try { doSomething(); } catch (IOException | SQLException _) { log.warn("Handled but ignored"); } #Java #CodeTips #CleanCode
80
I stopped using @Autowired in my Spring Boot services completely. Why? Because constructor injection gives you: ✅ Immutability ✅ Testability ✅ Better error visibility And yes – fewer hidden bugs. Who else avoids @Autowired? #Java #SpringBoot #CleanCode #BackendDev
76
Ever used @EventListener in Spring Boot to decouple logic? Let me show you a simple example 👇 #SpringBoot #Java #CleanArchitecture
2
133
Java devs – quick question 👇 When you’re designing a Spring Boot backend, where do you draw the line between using: •A service class •A domain method •A utility/helper class I’m curious how you think about separation of concerns in real-world projects. #Java
98