Skip to content

Commit

Permalink
Adds note about unrelated new to initialize changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
CitadelStationBot authored and CitadelStationBot committed Apr 18, 2017
1 parent 83cadc5 commit a87f1d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Remember, this tradeoff makes sense in many cases but not all, you should think

### Prefer `Initialize` over `New` for atoms
Our game controller is pretty good at handling long operations and lag. But, it can't control what happens when the map is loaded, which calls `New` for all atoms on the map. If you're creating a new atom, use the `Initialize` proc to do what you would normally do in `New`. This cuts down on the number of proc calls needed when the world is loaded. See here for details on `Initialize`: https://github.com/tgstation/tgstation/blob/master/code/game/atoms.dm#L49
While we normally encourage (and in some cases, even require) bringing out of date code up to date when you make unrelated changes near the out of date code, that is not the case for `New` -> `Initialize` conversions. These systems are generally more dependant on parent and children procs so unrelated random conversions of existing things can cause bugs that take months to figure out.

### No magic numbers or strings
Make these #defines with a name that more clearly states what it's for.
Expand Down

0 comments on commit a87f1d2

Please sign in to comment.