Working in a software company
History / Edit / PDF / EPUB / BIB / 1 min read (~48 words)- Always prioritize your work
- Always work on something that is a task in a task tracking system
- You should always be able to tell someone else what task you are working on and link them to that task
- Always provide an agenda when you book meetings with others
- Code changes are stored in git
- Setup continuous integration (e.g., GitHub Actions)
- Use dependency management (e.g., uv)
- Have a testing framework (e.g., pytest)
- Define a code standard, enforced through tools and not documentation (e.g., ruff)
- Prefer typed function/method over dynamic types
- On every commit to git
- Code quality check
- Code style check
- Unit/functional/integration/system tests
- Code coverage should be recorded during tests and a report made available
- Prior to pushing
- Use an LLM tool to review the changes to identify potential issues
- On pushes, the CI should
- Code quality check
- Code style check
- Unit/functional/integration/system tests
- A project repository must have
- a
README.mdexplaining how to run the project on your own computer - a
RELEASING.mdexplaining how to release the code - a
CHANGELOG.mdlisting relevant changes made
- a
- Responsibilities are made explicit in terms of roles
- Critical roles, such as project lead, must have a backup/shadow individual
- Setup telemetry, alerts, profiling, logging
The most up to date version of this process is available as a Claude command in my dot-claude repository.
- Verify that the build/tests pass
- Read the issue title and description
- New code
- Understand the feature and associated requirements that are supposed to be implemented
- Verify code implements the desired feature and that the requirements are completed
- New/Changed code
- Check code contains tests
- Is all the new code covered by those tests?
- Verify the location of new/moved files
- Are the files in the right directory?
- Are they appropriately named?
- Verify classes, methods, functions, parameters naming
- Are they significant of their purpose?
- Are they clear enough?
- Are they respecting the naming convention?
- Does the code respect SOLID?
- Consider that when functions/methods signature change, code may now be backward incompatible.
- Discuss whether this is necessary
- Backward incompatible changes should be documented
- In a weak typed or type hinted language, are parameters and return of functions/methods typed?
- Are there TODOs that should be completed within this review?
- Check code for code style issues
- Check code contains tests
- Bug fix
- Verify that the fix is applied at the right location and will not "fix the symptoms, not the cause"
When reviewing
- Provide specific and actionable feedback
- Clearly mark nitpicks and optional comments
- Assume competence
- Provide rationale or context
- Consider how comments may be interpreted
- Don't criticize the person, criticize the code
- Don't use harsh language
- https://en.wikipedia.org/wiki/SOLID
- https://medium.com/palantir/code-review-best-practices-19e02780015f
- https://phauer.com/2018/code-review-guidelines/
- https://smartbear.com/learn/code-review/guide-to-code-review-process/
- https://smartbear.com/learn/code-review/best-practices-for-peer-code-review/
- https://nyu-cds.github.io/effective-code-reviews/03-checklist/
- https://google.github.io/eng-practices/
- https://testing.googleblog.com/2019/11/code-health-respectful-reviews-useful.html
- https://engineering.18f.gov/code-review/
- https://conventionalcomments.org/
- https://docs.gitlab.com/ee/development/code_review.html
- https://gitmoji.dev/
When joining a new project without tests, here is the value you need to provide through the addition of tests:
- the application works and doesn't crash
- the application works and supports a few input cases
- the application works and supports a variety of input cases
- the application works and is robust to most input cases
- Write a test that tests the common case usage of your function
- Write tests that cover edge cases of your function
- Write tests to cover all statements, branches, paths
A table of probabilities is built
The ratio 1/drop chance is used to compute a total drop chance
A number is generated in the range 0-total drop chance
A table lookup is done to find the associated item
Item properties are randomly rolled
Different table lookup may be built depending on the difficulty setting as well as the current act
The rarity of an enemy pack may either change the random generator distribution or some other mean to modify the probability of higher quality items from dropping
The pseudo random number generator is initialized each game and does not depend on the current time (to avoid issue with reading some timer which may have the same value over many iterations or may be slow to read)
When an enemy is killed, we want to determine how many items will drop