4 ms·
I've reviewed a lot of code. The three biggest things that help junior devs (really every dev) produce better quality code for code reviews are: 1. Use a lint
by tedmiston 10y ago
I've reviewed a lot of code. The three biggest things that help junior devs (really every dev) produce better quality code for code reviews are:
1. Use a linter. For example, eslint in JavaScript, and pycodestyle (formerly pep8) in Python.
2. Use an automated code quality service. Most have an open source free tier. The ones I know of are: Landscape, Codacy, and Code Climate. You can see a trivial example of their buttons (click through for reports) on my one-file repo here [1].
3. Read more advanced books to learn the more advanced patterns. Software engineering quality is mostly about using abstractions and paradigms well.
Also, keep in mind: Always aim to be consistent with the existing codebase even if it goes against your personal style or beliefs. Consistency makes it easier for a team to actively develop together. If your team has a style guide, know those conventions; if they don't, default to best practices per your framework / language.
Another thing you can do is read and study code written by very experienced devs. Think of things like your framework itself or the standard library of your language. You'll learn more advanced features there as well. There is plenty of role model code in the wild.
[1]: https://github.com/tedmiston/tag-brain https://github.com/tedmiston/tag-brain