Code reviews best practices

Code reviews best practices
Average rating: 0
(0 votes)

Thanks! You’ve rated this material!

Computers make very fast, very accurate mistakes. That’s why we always need to review what we write. We are good at collecting the best practices. And this time we can share with your code reviews best practices that we can totally recommend for use.

Yep, here we collected the most common code review suggestions for you:

  1. Throw an exception when things go in the wrong direction. Empty objects are not the best tool for this. If something is exceptional you should throw an exception.
  2. Choose the most specific possible type. It will allow you to avoid a whole class of bugs and is the reason for choosing strongly typed language like Java.

    There are a number of different places where strings come from, such as:

    • query and path parameters in urls
    • JSON
    • databases that don’t support enums
    • poorly written libraries
  3. Prefer Optionals to nulls.Optional allows you to completely remove NPEs from your program.
  4. Avoid using container objects like Optional, List, or Task as method parameters. It’s not very good when the return type is the same kind of container.

Want to know more? Check this great material.

To add some value, you can also explore our previous material about code reviews. Take care!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111