2

I'm a self taught web developer, I know I can develop great apps, but my code doesn't feel structured... It gets messier as I add more features, and this makes it harder to develop and keep track of everything.

How can I improve this, are there any processes to follow?

Comments
  • 3
    Check out good open source projects, study design patterns. Break your code down into small chunks.
  • 2
    I've been in the same situation and what really helped me was having conversations with other experienced developers and reading about common design patterns and fitting data structures.
    Also the kind of language, framework and build tools you use have a big impact.
    I've migrated all scripts to TypeScript when v0.9 came out and since then TS helped me to clean up and structure code by organizing everything into modules and shared libraries.
  • 4
    As mentioned, study design patterns, find a few that matches your code and focus on one or two to begin with to avoid the rabbit hole of to many patterns ;)

    Draw up very simple diagrams over the parts of the application and try to make independent groups with a clear boundary and then try to enforce that boundary in the code.

    And try to get a fellow dev to do code reviews with, if they have a hard time reading the code it needs refactoring.

    And do not be afraid to refactor code.

    Use unit testing, both to catch regressions but also, good unit testing enforces more loose coupling which often helps to keep code less convoluted.
  • 3
    Architectural patterns are also super important. I enjoy following onion architecture as I find where my code is, is often more important that what it is. For extensibility and maintaining I mean.
  • 1
    dont put everything in a single file lmao thats what i used to do
Add Comment