📚
Docs
  • Welcome
  • Santhosh Thottingal
    • Coding
    • Software I use
    • Research Papers
    • Talks
    • Projects
    • In news
    • Ideas
    • Books
  • Malayalam Computing
    • Unicode
      • Syllable
      • Conjunct
      • Articles
    • Input methods
      • Inscript
      • Swanalekha
      • Handwriting Recognition
        • Procrustes Analysis
      • Proprietory Input Methods
      • What is a good input method?
      • Typewriter
    • Script Rendering
      • Orthography
      • Ya Ra Va Signs
      • U signs
    • Type Design
      • Color Fonts
      • Curves
      • Design Ideas
      • Manjari
        • Gallery
      • Chilanka
      • Gayathri
      • Customize Malayalam fonts in Linux
      • Articles
      • Tools
      • Type classification
        • Display typefaces
    • Spellcheck
      • History
      • Dictionary based approach
      • Nature of Malayalam spelling mistakes
      • Morphology analyser based approach
      • Tools and services
      • Links
    • Hyphenation
      • Web page
    • Typesetting
      • LaTeX
      • Scribus
      • PDF
      • XeTeX
      • Indesign
      • Markup languages
    • Speech Recognition
    • Speech Synthesis
      • Dhvani
    • Collation
    • Corpus
    • Morphology Analysis
      • Mlmorph
        • Snippets
      • Part of speech tagging
      • Morphology complexity
    • Named Entity Recognition
    • Numbers
      • Number spellout
      • Hindi
    • Machine Translation
      • Neural Machine Translation
    • Optical Character recognition
    • Transliteration
    • Digitization
    • NLP
      • Low resource languages
      • Natural Language Generation
    • Grammar analysis
      • Style checkers
    • Dictionary
      • Lexicon
    • Natural Language Understanding
    • Natural Language Generation
    • Swathanthra Malayalam Computing
    • Meta
      • Malayalam Sign Language
      • പദനിർമിതി
      • History
      • ലിപിപരിണാമം നിലച്ചുപോയോ?
      • ഭാഷാ പഠനം
      • ശ്രേഷ്ഠ ഭാഷ
      • Dictionary
    • Encyclopedia
    • Government
      • Script
      • കേരള ഭാഷാ ഇൻസ്റ്റിറ്റ്യൂട്ട്
  • Academic Research
    • Knowledge Dissemination
    • Research papers
    • Reproducible Research
  • Arts
  • Books
  • Blockchain
  • Computer Science
    • Data, Information, Knowledge
    • Theory of computation
    • Compilers and Interpreters
    • Graphics
    • Data Visualization
    • Parsers
    • Data Structures & Algorithms
    • Finite State Transducer
  • Cyberspace
    • Digital Governance
    • കേരളത്തിൽ
    • Online Abuse
  • Databases
  • Education
    • Finite State Transducers
    • Digital Education
    • Digital Literacy
      • ഡിജിറ്റൽ സാക്ഷരതാ പദ്ധതി
      • Resources
    • Remote Learning
    • General Learning
  • Entertainment
  • Frontend technology
    • Colors
    • Design systems
    • CSS
    • PWA
    • SPA
    • Vue
  • Generative Graphics
    • Drawbot
    • Matrix Digital Rain
  • Hardware
  • Internet
    • Etiquettes
    • Privacy
    • IPFS
    • Resilience
    • Decentralization
    • Network debugging tools
  • Knowledge Representation
  • Languages & Scripts
    • Arabic
    • Vattezhuth
  • Life
    • Digital Minimalism
  • Linux
  • Machine learning
    • Neural Networks
    • Dialog systems, Information retrieval
    • Large Language Models
    • Embedding
    • ML in Production
    • Retrieval Augmented Generation
  • Mathematics
  • Music
  • Parenting
  • Politics
    • Hatred, Hinduthwa, Nationalism
  • Productivity
  • Problem Solving
  • Science
  • Software Libraries
  • Software Engneering
    • Architecture
    • Product Management
    • Docker
    • Programming
      • Javascript
    • People
    • Performance
    • Code Review
  • Web3
  • Web Typography
  • Writing
  • പാട്ടുകൾ
    • കുട്ടിപ്പാട്ടുകൾ
  • മലയാളം അച്ചടി
  • ഗവേഷണപ്രബന്ധങ്ങൾ
Powered by GitBook
On this page
  • General approach
  • Ignore minor issues
  • Focus on things that matter
  • Don't insist on coding style
  • Multiple ways of doing things
  • Clarity on your comments
  • Be nice
  • References
  1. Software Engneering

Code Review

My approach for code review

General approach

Code review is to help impove the code and there by improving the product. It is not an evaluation or judgement on the person who wrote the code. What is being reviewed is the code, not the person who write the code. Code review is not an exam that every commit need to be passed. Sometimes the reviewer and submitter will agree to address a few suggestion in future iteration than holding the commit in review forever. Don't do architecture review in PRs. If you're going to make architectural changes, do so in a lightweight design document and get approval there first.

Ignore minor issues

As long as it is not causing a bug, leave minor issues aside. Interfere only if it will cause a bug. You are not trying to write Linux Kernel. It is OK to have some bad parts of your repo. I am pretty sure even Linux Kernel will have some bad code, even after Linus's strict code review.

Focus on things that matter

Instead of going line by line, check the overall logic, check flows in the logic, structure, maintainability and re-usability. Having a perfect code may give you a short term ego boost. But in the long term, the time you spend on that is just a waste. Instead of focusing on that, try to build something new or fix a couple of bugs. The idea of perfect code or perfect algorithm is a delusion.

Don't insist on coding style

Don't get me wrong, your project should have a coding standard and style. Instead of manually making sure it is followed, automate it. Make use of git pre-push / pre-commit hooks. Test it via CI/CD tools to make sure that each PR is tested independently of the developer's environment. Use a linter and code beautifier of your team's choice. If your project is JS, use eslint, prettier, etc, if it is python use pep8 or pycodestyle. If you want a custom rule which you can't find in any of these linters, write your own shell script.

It is OK if the variable name is long, or you can come up with a better variable name. As long as the code is readable and code is making sense, it is fine, let it go.

It is quite possible that the code is written by a person who is non-native English speaker. Don't force your understanding of that language on that person. If you think something can be better written, propose alternative and be gentle about it.

Multiple ways of doing things

As programmers, we always see different methods of doing the same things. If a choice is subjective, prefer developers choice and not impose your preference. It is common to have multiple ways to do same thing. Avoid asking "why not this way" unless there is a demonstrable advantage. Given the choices have equal advantage, prefer developer's version.

Clarity on your comments

For every comment that you make, make sure there is a clear action to be taken. It should be clear what you expect to happen. Just stating your opinion is not enough. If possible give code snippets. If there are web resources that explain a concept better, please provide that. Then it becomes a team effort than a judging exercise. Every back and forth communication for clarification is time waste. If the code is related to a UI, try maximum to use screenshots and video snippets to illustrate the problem and explain what you expect.

Be nice

Be nice to the person who spent time to write the code you are reviewing. The code you are reviewing is written by another human being who has their own opinions, be considerate, don't push your ideology down his or her throat. Agree to disagree. If you think there is a better way to this, think about iterations and improving in multiple steps, rather than outright rejection of a work.

References

PreviousPerformanceNextWeb3

Last updated 3 years ago

- Google Engineering practices

- Jishnu Mohan

Non violent code review

by Aniket Kadam.

from Google's Coe Health series

by Sandya Sankarram

on Coding Horror

How to do a code review
How to and How not to, do Code Review
https://www.mediawiki.org/wiki/Nonviolent_Code_Review
Compassionate Coding
Code Health: Respectful Reviews == Useful Reviews
Unlearning toxic behaviors in a code review culture
The Ten Commandments of Egoless Programming
Conventional Comments