Debug Assertions

thumb
Identquality.debugassertions
Typelibrary
Created
Updated
Latest Version 151768 +5
Links s&box
Summary
Description
[Image] This library adds Assert functions which are only checked in debug mode (that is, in the editor). This lets you create reliable code which has no performance impact once the game is released. This is because C# has an attribute which can actually remove code if DEBUG isn't defined. It completely disappears. For a taste about defensive programming, please watch the ~9 minutes after this timestamp in this video: https://youtu.be/oitYvDe4nps?t=210 Emphasis on the part at 8:40. The issue which inspired this project: https://github.com/Facepunch/sbox-public/issues/291 The source code is available at https://gitgud.io/nixx/sbox-debug-assertions Note: The assertions sit in the Quality.Diagnostics namespace, in case s&box ever add their own.
[Image] This library adds Assert functions which are only checked in debug mode (that is, in the editor). This lets you create reliable code which has no performance impact once the game is released. This is because C# has an attribute which can actually remove code if DEBUG isn't defined. It completely disappears. For a taste about defensive programming, please watch the ~9 minutes after this timestamp in this video: https://youtu.be/oitYvDe4nps?t=210 Emphasis on the part at 8:40. The issue which inspired this project: https://github.com/Facepunch/sbox-public/issues/291 The source code is available at https://gitgud.io/nixx/sbox-debug-assertions Note: The assertions sit in the Quality.Diagnostics namespace, in case s&box ever add their own.
Votes 0 0 0
Error Rate0%
Data
{}