🚀 CLEAN CODE REMINDER: COMMENTS THAT COUNT “Comment the why, not the obvious what—getters, setters, constructors don’t need notes.” When code is self-explanatory, extra comments add noise. Save comments for intent, trade-offs, and surprising decisions: ✅ Explain why a rule exists, a constraint, or a workaround. ✅ Capture domain knowledge, edge cases, and assumptions. ❌ Don’t narrate trivial code (e.g., getters/setters/constructors). Keep it crisp. Let code show the what. Use comments to preserve the why. ✍️ #CleanCode #Java #SpringBoot #Readability #CodeQuality #SoftwareEngineering #DevBestPractices #Refactoring #Comments #Maintainability
Vincent Vauban’s Post
More Relevant Posts
-
Why abstract class needs a constructor? 🤔 Even though you can’t create an object of an abstract class, its constructor still runs — because it helps initialize common properties when a subclass object is created! 🔥 💡 Example: The abstract class sets up base variables or logs setup info before the child class adds its own behavior. #Java #OOPs #Constructor #AbstractClass #JavaConcepts #CodingReels #Skillio #JavaForBeginners
To view or add a comment, sign in
-
𝐓𝐡𝐞 𝐁𝐞𝐬𝐭 𝐂𝐨𝐝𝐞 𝐈 𝐄𝐯𝐞𝐫 𝐃𝐞𝐥𝐞𝐭𝐞𝐝 Last week I deleted 2,000 lines of Java code. Code I spent 3 weeks writing. Code that worked perfectly. And the system got faster, more reliable, and easier to maintain. 𝐇𝐞𝐫𝐞’𝐬 𝐰𝐡𝐚𝐭 𝐡𝐚𝐩𝐩𝐞𝐧𝐞𝐝: I inherited a project with a “flexible” architecture. The previous dev built it to handle “every possible future requirement.” The result? • 7 abstraction layers • 15 design patterns • Configuration files for configuration files • Zero actual users I spent days just understanding what it did. 𝐓𝐡𝐞𝐧 𝐈 𝐚𝐬𝐤𝐞𝐝 𝐚 𝐬𝐢𝐦𝐩𝐥𝐞 𝐪𝐮𝐞𝐬𝐭𝐢𝐨𝐧: “What does this system actually need to do TODAY?” Turns out: Process orders and send emails. That’s it. 𝐒𝐨 𝐈 𝐝𝐞𝐥𝐞𝐭𝐞𝐝: → The abstract factory factories→ The strategy pattern strategies→ The observer pattern observers→ 90% of the “flexibility” 𝐖𝐡𝐚𝐭 𝐫𝐞𝐦𝐚𝐢𝐧𝐞𝐝: → Simple classes that do one thing→ Clear names anyone can understand→ Code a junior dev could debug 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞 𝐰𝐞𝐧𝐭 𝐮𝐩 𝟒𝟎%. 𝐁𝐮𝐠𝐬 𝐰𝐞𝐧𝐭 𝐝𝐨𝐰𝐧 𝟖𝟎%. 𝐓𝐡𝐞 𝐥𝐞𝐬𝐬𝐨𝐧? The best code is the code you don’t write. Every line of code is a liability: • It needs to be maintained • It can break • Someone has to understand it • It slows down the system 𝐁𝐮𝐢𝐥𝐝 𝐟𝐨𝐫 𝐭𝐨𝐝𝐚𝐲’𝐬 𝐩𝐫𝐨𝐛𝐥𝐞𝐦, 𝐧𝐨𝐭 𝐭𝐨𝐦𝐨𝐫𝐫𝐨𝐰’𝐬 “𝐰𝐡𝐚𝐭-𝐢𝐟𝐬.” You can always add complexity later. You can’t easily remove it. What’s the most satisfying code you’ve ever deleted? #SoftwareEngineering #Java #CleanCode #TechLeadership #LessTechDebt
To view or add a comment, sign in
-
-
Exceptions typically take a copy of the stack trace and (if thrown) roll up the callstack to try and find the next try/catch. This is super useful for debugging errors in production and as a backstop for when unexpected things happen. However it is super costly if all you're going to do is catch it and do manual recovery. In my microbenchmarks, exceptions ran ~300x slower than errors as values in typescript. 5 reasons to stop throwing exceptions - https://lnkd.in/e5zHmbVK
To view or add a comment, sign in
-
𝐇𝐨𝐰 𝐈 𝐔𝐬𝐞 𝐟𝐢𝐧𝐚𝐥 I make use of final to mark 𝐯𝐚𝐫𝐢𝐚𝐛𝐥𝐞𝐬, 𝐩𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬, and 𝐟𝐢𝐞𝐥𝐝𝐬 when they won’t change. It prevents 1. Accidental reassignments. 2. Makes code intent clear. 3. Helps the JVM optimize. 𝐋𝐞𝐬𝐬𝐨𝐧 𝐋𝐞𝐚𝐫𝐧𝐞𝐝: Adding final to variables you don’t reassign prevents bugs and improves readability. For example, 𝐟𝐢𝐧𝐚𝐥 𝐒𝐭𝐫𝐢𝐧𝐠 𝐧𝐚𝐦𝐞 = 𝐮𝐬𝐞𝐫.𝐠𝐞𝐭𝐍𝐚𝐦𝐞() signals it’s not meant to change. Use it in methods and loops — it’s free safety! #Java #SpringBoot #CleanCode
To view or add a comment, sign in
-
-
🚀 You use ArrayList every day. But do you know what’s hiding under the hood? 👇 We all use this line every day 👇 List<String> list = new ArrayList<>(); Here’s the real inheritance chain 👇 Iterable ↓ Collection (extends Iterable) ↓ AbstractCollection (implements Collection) ↓ List (extends Collection) ↓ AbstractList (extends AbstractCollection, implements List) ↓ ArrayList (extends AbstractList, implements List, RandomAccess, Cloneable, Serializable) 💡 Quick takeaways: ✅ Iterable is what makes enhanced for-loops (for-each) possible. ✅ AbstractCollection & AbstractList provide skeleton implementations so subclasses only need to implement key methods. ✅ ArrayList adds dynamic resizing, fast lookups, and cloning support. ⚙️ Hidden Insight: Your everyday ArrayList isn’t just a list — it’s a layered masterpiece of interfaces + abstract classes + marker interfaces that make it fast, flexible & reliable 🚀 #Java #Coding #DeveloperTips #ArrayList #Programming #LearnJava #OOP
To view or add a comment, sign in
-
#helloskillio Why abstract class needs a constructor? 🤔 Even though you can’t create an object of an abstract class, its constructor still runs — because it helps initialize common properties when a subclass object is created! 🔥 💡 Example: The abstract class sets up base variables or logs setup info before the child class adds its own behavior. #Java #OOPs #Constructor #AbstractClass #JavaConcepts #CodingReels #Skillio #JavaForBeginners https://lnkd.in/gWv63jaz
To view or add a comment, sign in
-
Frameworks evolve. APIs change. But clean, modular code always pays off. I’ve reviewed hundreds of pull requests — and the best engineers aren’t the ones who use every new library, but those who make their code readable and resilient. Write code like someone else will maintain it tomorrow — because they will. 👩💻 #CleanCode #Java #SoftwareEngineering #TechLeadership
To view or add a comment, sign in
-
In the AOP workflow, the process involves two key phases: **Development:** - Identify cross-cutting concerns. - Create aspects. - Define pointcuts to specify where logic should be applied. - Implement advice, which constitutes the logic itself. **Runtime:** During runtime, the AOP framework performs the following steps: - Detect aspects. - Create target objects and AOP proxies. - When a client invokes a method, the proxy intercepts the call. - If a pointcut matches, the advice (Before, AfterReturning, AfterThrowing, After) executes around the target method. - The Around advice has the ability to control the execution of the target method. - Finally, the results are returned to the client through the proxy. #SpringBoot #Java #Coding #Developers #SoftwareEngineering #TechLearning
To view or add a comment, sign in
-
-
Tired of repetitive object.property syntax? ✨ Let's talk destructuring! Tip #009: Use object destructuring to extract multiple properties from objects in a single, clean statement. Perfect for function parameters, API responses, and config objects. Benefits: ✅ Cleaner, more readable code ✅ Less repetition ✅ Better parameter naming ✅ Modern JavaScript standard What's your favorite use case for destructuring? Share your examples below! 👇 #JavaScript #CleanCode #WebDevelopment #ProgrammingTips #SoftwareEngineering #Coding #ModernJavaScript #100Devs #Developer
To view or add a comment, sign in
-
-
This looks like a simple code, but most developers get it wrong Let’s look at this simple code final int[] arr = {1, 2, 3}; arr[0] = 99; 🧠 Many developers think final makes the entire array unchangeable — but that’s not true! ✅ What’s actually happening: The final keyword means the reference arr cannot be reassigned to point to a new array. But the contents of the array can still be modified. For example: arr[0] = 99; // ✅ Allowed arr = new int[]{4, 5, 6}; // ❌ Compilation error 📊 After modification: [99, 2, 3] 🧩 Key takeaway: > final makes the reference immutable, not the object itself. #Java #ProgrammingTips #InterviewQuestions #JavaDeveloper #LearningJava
To view or add a comment, sign in
More from this author
Explore related topics
- Building Clean Code Habits for Developers
- Simple Ways To Improve Code Quality
- How to Refactor Code Thoroughly
- Best Practices for Writing Clean Code
- Writing Elegant Code for Software Engineers
- How to Improve Your Code Review Process
- GitHub Code Review Workflow Best Practices
- How to Write Clear and Accurate Code Comments
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
You could even assert with an error comment to make sure your "world" isn't collapsing. And it defines intend too, and clarify your assumption.