Code Review Is Also a Technical Skill

Published 2025-05-19

Updated 2025-06-09

Some strongly recommended code review practices: strict self-checks during development are the cheapest investment.

Written by - kok-s0s

Qt

Code Review

Checklist for Shared Data Access in Multithreading

1. Is There Multithreaded Access?

Check itemExplanation
Do multiple threads access the same variable/data?For example timers, callbacks, background threads, etc.
Are there cross-thread signal/slot connections?Non-default connection types, such as QueuedConnection in Qt, can trigger across threads.
Are global objects, singletons, or shared references involved?These are easy to read and write from multiple threads at the same time.

2. Is There Concurrent Reading and Writing?

Check itemExplanation
Does one thread write while another thread reads?Even if writes are infrequent, there is still risk.
Are containers being added to or removed from?Operations such as append, remove, and insert are modifications.
Are non-thread-safe data structures used?Qt containers such as QList and QVector are not thread-safe by default.

3. Is Synchronization Protection in Place?

Check itemExplanation
Is shared data protected by a lock?For example QMutex or QReadWriteLock.
Does the lock cover the whole access/modification region?Especially for multi-line operations, the whole operation must be covered.
Is automatic locking used?Avoid forgetting to unlock, such as with QMutexLocker.
Are time-consuming operations avoided inside the lock?Avoid deadlocks and UI blocking.

4. Is the Structure Reasonable and Extensible?

Check itemExplanation
Is the lock a member variable that protects the whole resource lifetime?Ensure the resource and lock are strongly bound.
Is a thread-safe container needed?For example ThreadSafeQueue or ThreadSafeMap.
Is there a thread communication mechanism?For example condition variables, thread-safe queues, or event dispatch.
Should work logic be put into a separate thread?QThread, task queues, and signal/slot communication can decouple thread logic more clearly.

5. Are There Tests or Monitoring Mechanisms?

Check itemExplanation
Are assertions or logs used to detect abnormal access?Add consistency checks to find edge cases.
Are cross-thread interactions actively tested in debug mode?Strengthen testing of different interaction orders between threads.
Have occasional crashes or undefined behavior appeared?If yes, thread-safety issues are very likely.

Other Practical Suggestions

Code Format and Git Commit

I currently have a shallow opinion: if a programmer knows how to format code and writes clear Git commit messages, I feel they have already surpassed around 75% of programmers.

Code Format Shows Basic Professionalism

Unified code formatting means:

In real development, too many people do not care about this, or only rely on the IDE’s default formatting, which makes the team code style messy.

People who can skillfully use clang-format, .editorconfig, or prettier are honestly not that common.

Clear Commit Messages Show Collaboration Ability

Clear commit messages, such as those following Conventional Commits, let team members quickly understand the purpose of each change.

They also reflect how the developer thinks: whether they have structure, summarization ability, and documentation awareness.

In large teams or CI/CD workflows, good commits can even affect release rhythm and rollback efficiency.

These two habits are “visible fundamentals”. Many advanced skills, such as low-level optimization and architecture design, are not immediately visible. Formatting and commits are visible the moment you open a repository.

An Example

Two PRs:

Which one would you trust more? Without a doubt, B.

OOP Code Review Checklist for C++ / Qt

Class Design and Responsibility

Encapsulation and Access Control

Dependency Management and Decoupling

Inheritance vs Composition

Constructors and Resource Management

Readability and Naming

Structure and Module Boundaries

Qt-Specific Suggestions


If most of the above is done, the OOP code already has strong structure and maintainability.