//Todo: Improve Code Quality

//Todo: Improve Code Quality

Set a personal max limit on class and method size.

Too often I hear developers say, “I can’t clean up the tech debt because management won’t let me.” But here’s the truth — most of the tech debt and code quality decisions you make every day aren’t dictated by management.

How big are your classes and methods get.

I rarely see methods that are too small, but I constantly see classes and methods with hundreds of lines. Large classes and methods are harder to understand and harder to maintain. It’s a choice you make one line of code at a time. And you can start changing it today.

Action for this week:

  1. Pick your personal max line count for a class and for a method. (e.g., 200 lines for a class, 40 lines for a method — or whatever feels right to you.)
  2. Every time you open an old file and see something over that limit, don’t add to it — refactor. Move your logic into smaller methods or new classes.
  3. Hold yourself to your limit. No exceptions.

You can’t control management. But you can control your own habits. Start today — set your limit, stick to it, and make your code better one method at a time.

Leave it better then you found it, wisdom that can apply across life's experiences.

To view or add a comment, sign in

More articles by David Strickland

  • 4 Questions ChatGpt thinks we need to answer

    Got to pontificating with Chatgpt this evening and ended up with an unexpected result. Me: The ability to accept moral…

  • //Todo: Write Code you can Live With

    "For Now" Often Means Forever: The Hidden Cost of Half-Done Transitions One of the hardest truths I’ve learned in my…

    1 Comment
  • //Todo: Improve Code Quality

    Clean Your Code: One Using at a Time Every using statement tells a story. It says, this class knows something about…

    1 Comment
  • //Todo: Improve Code Quality

    Eliminate Nulls — Shrink Your Models In database design, null values have always been a red flag — a clear sign that…

  • //Todo: Improve Code Quality

    Make Your Dependencies Obvious One of the hallmarks of maintainable code is clarity, not just in what it does, but in…

    1 Comment
  • //Todo: Improve Code Quality

    Update an Outdated Reference Today Many codebases live in quiet fear. A single dependency update feels risky.

  • //Todo: Improve Code Quality

    Adopt a Linter and Commit to Consistency Every developer has opinions about formatting, naming, and code style. Tabs or…

  • //Todo: Improve Code Quality

    Add Interfaces and then actually Use Them A key principle of clean architecture is program to an abstraction, not an…

  • //Todo: Improve Code Quality

    Isolate a Dependency with a Facade According to the Single Responsibility Principle (SRP), a class should have one…

  • //Todo: Improve Code Quality

    Correct Hungarian Class Names Once upon a time, Hungarian notation was everywhere: — a string containing a name — an…

    1 Comment

Explore content categories