Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ars140543yCheck out good open source projects, study design patterns. Break your code down into small chunks.
-
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. -
Voxera113973yAs 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. -
Crost40743yArchitectural 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.
Related Rants
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?
question
questions
web developer
clean code