WELCOME TO Excendra

Habits That Make You a Good Coder

Habits That Make You a Good Coder

Imagine stepping into a library where all the books are written in an alien language, the grammar is inconsistent, and the font changes every page. Frustrating, right? Similarly, poorly written code is a nightmare for anyone who has to read, understand, or build upon it later – including future you. Coding isn’t just about writing instructions for your computer; it’s about creating something that another developer (or yourself in six months) can easily understand.

Let’s unpack why this habit is essential and how you can develop it.

1. Treat Your Code as a Conversation

At its core, code is communication. When you write code, ask yourself: “If I handed this to someone in my team, would they immediately get what I was trying to accomplish?” When you write your code, assume another developer – maybe someone new to programming – is looking over your digital shoulder. Your code doesn’t need to be poetic, but it does need to be logical and clear.

2. Use Descriptive Variable and Function Names

One of the easiest ways to make your code readable is to label things properly. Avoid vague names like x or temp. Instead, use names that describe the purpose of the variable or function, like totalSales or calculateMonthlyRevenue(). A good rule of thumb? If the name answers the question “what does this do?”, you’re on the right path.

3. Write Comments With Purpose

Comments are another tool to ensure your code is a conversation anyone can follow. **But sparingly!** Over-commenting can clutter your script, while under-commenting can lead to confusion. Focus your comments on **explaining why** you’re doing something, rather than what you’re doing. For example:


// Fetching user sessions to check for inactivity
let userSessions = getUserSessions();

This tells a future developer (and you) the intention behind this line of code, without stating the obvious.

se Consistent Formatting

4. Use Consistent Formatting

Ever feel annoyed when reading a book with inconsistent fonts, random spaces, or misaligned paragraphs? The same goes for code. Consistent indentation, line-spacing, and structure make your code easy to follow. Tools like linters or formatters (Prettier, for example) can help maintain this uniformity. Bonus? Clean code isn’t just easier for humans to process—it’s often less buggy too.

5. Keep It Organized

Break down long scripts or functions if they’re becoming monsters to read. A general rule is: if your function does more than one clear task, consider splitting it. No one should have to scroll for miles to decipher your logic. For example, rather than cramming two distinct calculations in one function, make two smaller, purposeful functions and call them as needed.

6. Avoid Cleverness for Its Own Sake

We get it; you might have pulled off a one-liner that’s so concise it could win an award for brevity. However, clever code isn’t necessarily good code. If it takes someone a minute to figure out what you’re doing, you’re missing the point. Favor clarity over cleverness every time.

Treat Error Messages as Helpful Directions

Let’s talk about errors. No, don’t shudder! When you see that red text glaring at you from the console, it’s not an enemy. It’s more like a friend waving a flag and saying, “Hey, something’s off! Let’s fix this together.” The sooner you change your perspective on error messages, the better your coding life will become.

Why You Should Befriend Errors

Errors often feel frustrating, but they exist for a reason. Think of them as your code trying to tell you what went wrong—like a GPS guiding you back on track when you accidentally take the wrong turn. If you start seeing errors as opportunities to learn and improve rather than barriers, you’ll build up your problem-solving muscle in no time.

For instance, an undefined is not a function error tells you that somewhere, you’re trying to use something that doesn’t exist as a function. Instead of panicking, break it down. Where is this undefined variable coming from? Why isn’t it behaving as expected? Errors don’t just point out issues; they help refine your logical thinking.

How to Decode Error Messages

If error messages feel like another language to you, that’s okay. They can seem intimidating at first. Follow these steps to make sense of them:

  1. Read the exact message: Don’t skim it, even though your first instinct might be to scroll past and hope the problem fixes itself (spoiler: it won’t). The error message contains valuable clues.
  2. Identify the problem: Focus on keywords like “syntax error,” “undefined,” or “reference error.” These words point you in the general direction of the issue.
  3. Trace the source: Many error messages come with a file name and line number. Jump to that location in your code. Sometimes, the root cause is nearby!
  4. Consult the community: When in doubt, Google it. Chances are, someone else has encountered a similar issue, and forums like Stack Overflow can lead you to solutions.

Adopt a Positive Mindset

Errors are an inevitable part of coding. Instead of dreading them, work on embracing the learning opportunity they bring. After all, every error you encounter makes you better prepared to handle future challenges. Think of debugging as a detective game where the goal is to uncover the mystery hidden in your code.

Pro Tip: Stay Calm and Debug On

One underestimated skill in programming is staying calm while debugging. Avoid the temptation to rush through changes in your code just to “see if it works now.” Take your time, isolate the problem, and make deliberate changes. This methodical approach not only gets the job done but also prevents you from introducing new bugs.

Refactor Code as a Daily Practice, Not a Chore

Let’s be honest, refactoring code doesn’t always sound like the most exciting activity in the world—but here’s the thing: it can genuinely transform your coding experience and elevate your skills. If you’ve been looking at refactoring as a one-off task or, worse, as a frustrating chore, it’s time to flip the script. Here’s how to embrace refactoring as a daily habit and why it’s such a powerful practice.

Why Refactoring Matters

Simply put, refactoring is about improving your code without changing its functionality. Think of it as spring cleaning for your projects! It keeps your codebase clean, readable, and maintainable in the long run. When you consistently refactor, you reduce technical debt (those hidden issues waiting to bite you later). Plus, you make life easier for your future self—and any teammates who inherit your work.

Make Refactoring Small and Frequent

Here’s a pro tip: refactoring doesn’t have to involve massive overhauls. In fact, small, consistent improvements are far more manageable and impactful. After completing a feature or fixing a bug—and before you close that ticket—ask yourself:

  • Can I rename that variable so it’s more descriptive?
  • Is there duplicate code I can extract into a function?
  • Does this block of code need better comments or structure?

Addressing these small updates regularly will have you looking back at your code with pride, not confusion, weeks or months later.

It’s Not About Perfection

Here’s where refactoring gets a bad rap: many people think it means obsessively polishing your code until it’s flawless. Newsflash—it doesn’t! Refactoring is about better, not perfect. Focus on making progress rather than endlessly rejecting your own work. A tiny improvement, like converting a messy “ statement into a cleaner ternary operator, can make a big difference.

Best Practices to Build

Best Practices to Build a Refactoring Routine

Ready to make refactoring second nature? Start here:

  1. Adopt a “Boy Scout” Rule: Always leave your code better than you found it. Even a small improvement counts!
  2. Plan for Refactoring: Allocate time for it when scheduling tasks. When it’s baked into your workflow, it won’t feel like a divergence or distraction.
  3. Automate Checks: Leverage tools like linters and static analyzers. They’ll point out areas for improvement while you work.
  4. Build Test Coverage: Refactoring becomes far less stressful when you know automated tests have your back. A solid test suite ensures you don’t accidentally break things while optimizing your code.

Learn the Art of Balancing Adaptability and Stubbornness

When it comes to coding, striking the perfect balance between being adaptable and staying stubborn can feel like walking a tightrope. But mastering this delicate art is what turns a good coder into a great one. Let’s dig deeper into what this really means and how you can implement it in your coding journey.

Why You Need to Be Adaptable

The tech world is constantly evolving. Frameworks change, new tools emerge, and programming languages are updated regularly. Being adaptable ensures that you’re not left clinging to outdated methods when newer, more efficient solutions are available. Here are a few ways adaptability plays a vital role:

  • Learning new technologies: Being open to picking up a new library or framework ensures you grow with the industry, rather than falling behind.
  • Adjusting to project needs: Sometimes, your first approach to a solution might not match the project’s real needs. Adapting swiftly makes you invaluable to any team.
  • Working with others: Collaborating with developers often means adapting to their code style, tools, or even their way of thinking.

Adaptability makes you versatile and keeps your work relevant, but don’t confuse adaptability with being a pushover. That’s where our next point comes in.

Why You Should Be Just a Little Stubborn

While adaptability is critical, so is knowing when to stick to your guns. Sometimes, you’ll encounter situations that require you to fight for a good engineering decision. This “constructive stubbornness” is not about ego; it’s about maintaining high standards. Here are situations where being firm is beneficial:

  • Code quality: If others suggest shortcuts that will lead to technical debt or bugs, it’s essential to push back and advocate for well-thought-out solutions.
  • Best practices: Don’t abandon principles like proper version control or robust testing just because there’s pressure to get things done quickly.
  • Long-term vision: If you know a decision could negatively affect the scalability or maintainability of a system, don’t hesitate to speak up.

Remember, a good coder isn’t stubborn for the sake of being difficult; they’re stubborn when it counts.

Tips to Balance Both

So how do you know when to be adaptable and when to stay the course? Here’s some actionable advice:

  1. Listen first: When facing new ideas or feedback, start with a mindset of openness. Understand where the other party is coming from before you decide to adapt or stand firm.
  2. Ask “why?”: If you’re resistant to a change, question your own reasoning. Are you hesitant because it’s truly a poor decision, or is it just unfamiliar territory?
  3. Back it up with data: If you choose to stay stubborn, let data or evidence guide your argument. Whether it’s performance benchmarks or best practices, hard facts almost always win the day.
  4. Be open to compromise: Sometimes, the best course of action lies in the middle. Try to find solutions that incorporate the best of both worlds.

Document What You Do, But Only the Things That Matter

Let’s face it—documentation can feel like the broccoli of coding. You know it’s good for you, but the temptation to skip it is strong. However, effective documentation is a cornerstone of good coding habits. Here’s the kicker though: it’s not about documenting everything; it’s about documenting what actually matters. Let’s dive into how you can do this wisely!

Why Documentation Matters

Imagine someone (maybe even future you) trying to figure out what your code does—without the context swirling in your brain. Good documentation acts like breadcrumbs leading straight to the heart of your logic. It saves time, reduces frustration, and helps maintain a project long after you’re done with it. But overloading your code with unnecessary comments and explanations? That can be just as harmful as no documentation at all.

Find the Sweet Spot: What Matters?

Not every part of your code needs to be annotated. Here’s a quick breakdown of what definitely deserves attention:

  • Tricky Logic: Write clear explanations for algorithms or sections of code that aren’t easily understood at a glance. Don’t leave people guessing at your genius!
  • Why Over How: Sure, it’s obvious how the code works—it’s written right there. But why did you make a particular architectural choice? Documenting the “why” can be a game-changer for anyone revisiting the code later.
  • Setup Instructions: If you’re working on a project that needs specific installation or dependencies, make sure to document this in a README file at the very least. This is often a lifesaver for collaborators.
  • Public APIs: If you’re designing functions or methods for others to use, describe what they do, their parameters, and their return values.

Keep It Clean and Organized

If your documentation is all over the place, it’s not helping anyone. Use consistent formatting, whether it’s through inline comments, external documentation files, or docstrings (most languages, like Python, support these). Create a structure that’s predictable and easy to navigate. Consider tools like JSDoc, Sphinx, or Doxygen to keep things professional and maintainable.

Avoid Overloading With Comments

Here’s the truth: not every line of code needs an explanatory comment. Skip the obvious. You don’t need to write // increment counter by 1 when your line already says counter++;—that’s redundant. Focus instead on the intent and context behind parts of the code that aren’t crystal clear.

Make It a Team Effort

When you’re collaborating on a project, make documentation a shared responsibility. Agree on standards at the start. Whether it’s a style guide or tools (like Markdown or Confluence), ensure everyone knows how and where to contribute.

The Golden Rule: Document With Empathy

Always ask yourself: “If I came back to this code six months from now, would I understand what I’m looking at?” Writing documentation with empathy ensures you’re thinking about the next developer (or your future self!) who’ll interact with your work.

Limit Features; Focus on Functionality First

Let’s be honest for a second: we all get dazzled by flashy features when we’re coding. The countless “what ifs” pop up—”What if the app could do X?” or “What if I added this extra Y feature?”. It’s easy to lose yourself in a spiral of endless feature ideas. But here’s the thing: when it comes to building software that truly shines, functionality must come first. Limiting features might feel counterintuitive at first, but let me show you why it’s actually your secret superpower.

Why Less Is More

Think about some of the greatest pieces of technology out there—why do we love them? It’s because they solve one or a handful of problems really well. They didn’t set out to be everything for everyone. Instead, they honed in on their core purpose and delivered excellence. For you, this means starting small and making sure what you’re building actually works the way it’s supposed to. Users appreciate a product that’s simple but effective over one that’s feature-packed but buggy.

The Dangers of Overloading

Imagine you’re cooking dinner, and instead of focusing on one solid dish, you attempt to whip up six gourmet meals at once. The result? Chaos. Your sauce boils over, the meat gets overcooked, and nothing is seasoned properly. The same could happen to your code. Adding too many features too soon splits your focus, leading to poorly written code, bugs, and worse yet, a product that doesn’t meet anyone’s expectations.

How to Stay Focused on Functionality

Here are a few actionable steps to help you stay on track:

  • Define the MVP (Minimum Viable Product): Clarify the absolute basics your application or software needs to work and stick to them like glue.
  • Prioritize Tasks: Use a simple list or task management system and rank feature requests based on their importance to the core functionality. What will help users achieve their goals most efficiently?
  • Use a User-Lens View: Ask yourself, “If I were using this, what would I care about most?” Answering this keeps you grounded.

The Beauty of Iteration

Here’s the best news: you don’t have to say goodbye to those snazzy extra features forever. By focusing on a strong, functional foundation first, you set the stage for future improvements. Think of functionality as the roots of a tree and every new feature as a branch—it’s only healthy if the roots are strong. Once you’ve nailed your MVP and have user feedback rolling in, you can confidently decide which features add real value.

Consistently Seek Feedback Without Fear or Ego

Seeking feedback can be intimidating, but it’s one of the most crucial habits to cultivate as a coder. After all, no one writes perfect code on their first try—not even the experts. The key to growth is embracing the process of improvement, and feedback plays a huge role in that. So, let’s dive into how you can master this skill while keeping fear and ego out of the equation.

Why Feedback Is Your Superpower

Feedback is like a mirror. It reflects areas for improvement and highlights blind spots that might go unnoticed. But don’t just take feedback as criticism. Instead, think of it as free advice from someone trying to help you level up. A second (or third) set of eyes on your code can catch things you missed, suggest new approaches, or even introduce you to concepts you didn’t know existed. Who wouldn’t want that?

Plus, by routinely seeking feedback, you normalize the practice of collaboration, which is important in team environments. The best developers aren’t just good solo performers; they’re team players who learn from each other and grow together.

Tips for Asking Great Feedback

Nervous about approaching someone for feedback? Don’t worry—here are a few tips to make it easier and more productive:

  • Be specific: Avoid just saying, “Can you review my code?” Instead, ask targeted questions like, “Does this approach look efficient to you?” or “Do you see any potential edge cases I might have missed?”
  • Time it well: Make sure the person you’re asking has enough time to provide thoughtful feedback. Sending a Slack message 5 minutes before they sign off for the day might not be the best idea!
  • Provide context: Explain the purpose of your code and any constraints you’re working with. A little context goes a long way in helping someone give useful advice.

Receiving Feedback Without Ego

Now, here’s the tricky part—how do you handle feedback gracefully? It’s easy to get defensive or feel disheartened when someone points out flaws in your work. But here’s how you can turn it into a positive experience:

  1. Separate yourself from your code: Remember, critiques are about the code, not you as a person. It’s just an opportunity to learn, not a personal attack.
  2. Clarify, don’t argue: If you disagree or don’t understand the feedback, ask respectful questions to clarify. Turning it into a debate helps no one.
  3. Thank the reviewer: Even if you don’t apply all their suggestions, acknowledge the effort they took to help you out.

Make Feedback a Regular Practice

Don’t just ask for feedback once in a blue moon. Turn it into a consistent habit. Whether it’s code reviews, pair programming sessions, or informal check-ins with colleagues, create an environment where feedback flows naturally. This not only improves your skills but also fosters trust and camaraderie among your peers.