Variable names should never mislead — if a name implies a data structure, type, or behavior, the code must deliver on that promise. Let's walk through it in the slides below. #cleancode #code #programming #developer
Avoid Misleading Variable Names in Code
More Relevant Posts
-
If you can't pronounce your variable names, you can't discuss your code — rename them to sound like natural language. Let's walk through it in the slides below. #cleancode #code #programming #developer
To view or add a comment, sign in
-
Everyone celebrates a 200 OK… but do you really understand all 2xx responses? HTTP 2xx status codes mean success — but each one tells a different story. 👉 201 when something is created 👉 202 when work is still in progress 👉 204 when there’s nothing to return 👉 206 when only part of the data is sent As backend developers, choosing the correct status code is not just technical—it’s about clear communication. #SoftwareEngineering #BackendDevelopment #WebDevelopment #Django #FastAPI #APIDevelopment #HTTP #Programming #Developers
To view or add a comment, sign in
-
-
Day 45-What if your entire application depended on just one object… and creating more could break things? That’s exactly why Singleton Class exists. 🔹 What is a Singleton Class? A Singleton class ensures that 👉 only one object is created in the entire application. No matter how many times you access it, you always get the same instance. 🔹 How is it implemented? • Make the constructor private → restrict object creation • Create a static reference → hold the single instance • Provide a public static method → return that instance 🔹 Types of Singleton 1. Lazy Initialization 👉 Object is created only when required ✔ Saves memory ✔ Efficient for large applications 2. Eager Initialization 👉 Object is created when the class is loaded ✔ Simple and fast ✔ Always ready to use 🔹 Why does Singleton matter? • Prevents unnecessary object creation • Maintains consistency • Saves memory • Useful for shared resources like: DB connections, logging, configurations 🔹 Key takeaway 👉 Control object creation → Control your application behavior #Java #OOP #Singleton #DesignPatterns #JavaProgramming #Coding #SoftwareDevelopment #Developers #TechLearning #100DaysOfCode #Programming #CodeSmart #BackendDevelopment
To view or add a comment, sign in
-
-
Single-letter names and magic numbers are impossible to search for in a codebase — replace them with descriptive, searchable names whose length matches their scope. Let's walk through it in the slides below. #cleancode #code #programming #developer
To view or add a comment, sign in
-
Poor variable names force readers to guess — intention-revealing names make code instantly understandable. Let's walk through it in the slides below. #cleancode #code #programming #developer
To view or add a comment, sign in
-
• Solving LeetCode Problem | Day 13 • Problem: Fizz Buzz | LeetCode 412 • Approach: Simple implementation problem focused on conditional logic. For each number from 1 to n: Check divisibility by both 3 and 5 "FizzBuzz" If only divisible by 3 => "Fizz" If only divisible by 5 => "Buzz" Otherwise convert number to string. Key focus was writing clean and readable logic rather than overcomplicating it. • Time Complexity: O(n) • Space Complexity: O(n) • What I learned: Even easy problems matter — they test clarity of thinking. Writing clean conditions without redundancy is important. Don’t ignore basics while chasing harder problems. #leetcode #dsa #programming #java #coding #problemSolving #100daysofcode
To view or add a comment, sign in
-
-
Find the minimum distance between a given start index and any occurrence of a target in the array. Leetcode problem link: https://lnkd.in/gZFkirHw 🔍 Key Takeaways: Used a two-pointer approach to scan from both ends. Kept updating the minimum absolute distance from start. Included the condition left != right to avoid checking the same element twice. ✅ Why this works: Instead of scanning only from one side, this approach checks both ends in each iteration, making the logic structured and efficient. 📘 What I like about this solution: Simple and readable Avoids redundant checks Great example of combining two pointers with distance calculation #Java #LeetCode #DSA #Programming #SoftwareEngineering #Developers #loveToCode
To view or add a comment, sign in
-
-
Refactoring Old C# Code with Small Improvements Have you ever been stuck trying to understand C# code you wrote six months ago? It's more common than you think. Last week, I needed to revisit an old project and found gigantic methods, without clear names and generic variables like 'temp' and 'data'. The curious thing is, all these choices made sense at the time. I refactored by giving descriptive names to the variables and extracting smaller functions. This change alone reduced reading time by 30%, measured by the time it took me to explain the code to a colleague. It's always worth remembering: clean code isn't just about elegance, it's about future productivity. What's the biggest challenge you've ever faced when rereading your own code? Share in the comments! #csharp #cleancode #refactoring #devlife #bestpractices #programming
To view or add a comment, sign in
-
-
If two things have different names, they must actually do different things — names should reflect real differences, not just add noise. Let's walk through it in the slides below. #cleancode #code #programming #developer
To view or add a comment, sign in
-
Long functions bury logic under noise — the first rule of functions is they should be small, and the second rule is they should be smaller than that. Refactor by extracting named functions so the code tells a story. Let's walk through it in the slides below. #cleancode #code #programming #developer
To view or add a comment, sign in
Explore related topics
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