{"id":3496,"date":"2019-11-26T00:06:02","date_gmt":"2019-11-26T00:06:02","guid":{"rendered":"https:\/\/waydev.co\/?p=3496"},"modified":"2026-11-10T13:44:37","modified_gmt":"2026-11-10T13:44:37","slug":"code-reviews-and-why-they-matter","status":"publish","type":"post","link":"https:\/\/waydev.co\/de\/code-reviews-and-why-they-matter\/","title":{"rendered":"Code reviews and why they matter"},"content":{"rendered":"<p>We used to think that the secret to getting better at anything was directly linked to the timed dedicated to practice (we\u2019ve all heard about the 10, 000 hours that stand between us and achieving mastery in any field) but, as in turns out, it\u2019s not how much we practice but also how we do it. According to psychologist Andres Ericsson, \u201cdeliberate practice\u201d is what matters and makes a huge difference in achieving expert performance.<\/p>\n<p>In his research paper \u201c<a href=\"https:\/\/graphics8.nytimes.com\/images\/blogs\/freakonomics\/pdf\/DeliberatePractice(PsychologicalReview).pdf\">The Role of Deliberate Practice in the Acquisition of Expert Performance<\/a>,\u201d published in the journal\u00a0<em>Psychological Review<\/em>, Ericsson looked at the habits of top performers in fields like sports, music, mathematics, and chess, and noticed an interesting pattern:\u00a0they engage in focused, intense practice sessions, usually only for an hour or two at a time. Along with an intense focus, what defines deliberate practice is also a constant thirst for improvement through actively and consistently asking for feedback and incorporating it.<\/p>\n<p>If the mere mention of the word \u201cfeedback\u201d gives you the chills, you might want to read Karl E. Wiegers\u2019 essay on why feedback (or peer reviews as he call it) is not a dirty word but a practice that signals maturity and a sincere and strong commitment towards becoming a better software engineer. According to Wiegers, feedback mechanisms are a clear indicator of a healthy software engineering culture that creates the premises for higher productivity and better product quality.<\/p>\n<p>One obvious feedback mechanism is code review, the process by which someone other than the code\u2019s author checks a program by looking at parts of its source code. This usually happens after implementations or before, as an interruption.<\/p>\n<p>Here are a few (common sense) reasons why code reviews are a good idea:<\/p>\n<ul>\n<li>You get to brag about what an awesome job you are doing. All humans take pride on the things they do well, and programmers are no different.<\/li>\n<li>To Ericsson\u2019s point, we learn from others through feedback and some of the best software engineers got there after years of refining their skills and outputs with the support of their peers.<\/li>\n<li>It ensures consistency and are a great way of preventing bugs.<\/li>\n<li>Is a great way of increasing legibility of code fragments (fewer bugs, reusable code)?<\/li>\n<li>The more security requirements you have to navigate, the more useful code reviews are with spotting weaknesses and preventing pitfalls.<\/li>\n<\/ul>\n<p>When deciding what to review, practices vary \u2013 you might want to review every change merged into the main branch or set a limit under which a review isn\u2019t necessary.<\/p>\n<p>For best results, put a bit of effort into preparing your code for reviews:<\/p>\n<ul>\n<li>Make sure to complete, test and review the code yourself before submitting for review.<\/li>\n<li>Changes can differ in scope and size (you might be looking to get rid of a bug or add\/remove a feature) and it\u2019s up to you to decide how to split reviewable fragments &#8211; shorter ones are always easier to work with and yield better results.<\/li>\n<li>Be mindful with refactoring \u2013 remember that the focus in on improving internal structure without altering external behavior. It\u2019s common sense to clean up after oneself and even more so when coding \u2013 keep it clean and elegantly simple.<\/li>\n<\/ul>\n<p>While there are many places to go to for code reviews (from colleagues or team members or companies that provide software audit services to freelancers, agencies and even programming subreddits for smaller code fragments), you decide at what stage of the project to ask for code reviews \u2013 we recommend doing it before merging the code to the mainline branch.<\/p>\n<p>Another example of good practices when looking for helpful code reviews is caring about your commit message \u2013 a note that signal changes made to a code repository. Make sure it\u2019s concise and easy to understand by anyone reviewing your code: keep it clear and short; use bullet points, asterixis, or hyphens, use hanging indents. <a href=\"http:\/\/tbaggery.com\/2008\/04\/19\/a-note-about-git-commit-messages.html\">More details on structure and examples here<\/a>.<\/p>\n<p>\u00a0<\/p>\n\n\n<p class=\"wp-block-paragraph\">If you want to find out more about how Waydev can help you, <a href=\"https:\/\/waydev.co\/de\/demo\/\" target=\"_blank\" rel=\"noreferrer noopener\">schedule a demo.<\/a>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"\/de\/demo\/\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/waydev.co\/wp-content\/uploads\/2021\/09\/CTA-1-1.png\" alt=\"Demo\" class=\"wp-image-11488\" width=\"428\" height=\"65\" srcset=\"https:\/\/waydev.co\/wp-content\/uploads\/2021\/09\/CTA-1-1.png 428w, https:\/\/waydev.co\/wp-content\/uploads\/2021\/09\/CTA-1-1-300x46.png 300w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>We used to think that the secret to getting better at anything was directly linked to the timed dedicated to practice (we\u2019ve all heard about the 10, 000 hours that stand between us and achieving mastery in any field) but, as in turns out, it\u2019s not how much we practice but also how we do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4717,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[58,62],"tags":[],"fgroups":[],"class_list":["post-3496","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-review","category-code-review-stats"],"acf":[],"_links":{"self":[{"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/posts\/3496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/comments?post=3496"}],"version-history":[{"count":1,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/posts\/3496\/revisions"}],"predecessor-version":[{"id":25402,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/posts\/3496\/revisions\/25402"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/media\/4717"}],"wp:attachment":[{"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/media?parent=3496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/categories?post=3496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/tags?post=3496"},{"taxonomy":"fgroups","embeddable":true,"href":"https:\/\/waydev.co\/de\/wp-json\/wp\/v2\/fgroups?post=3496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}