docs: Adjust developer-notes.md to use signed ints normally (#3663)

* Adjust developer-notes.md to use signed ints normally

Signed-off-by: pasta <pasta@dashboost.org>

* Adjust wording in dev-notes

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* remove trailing whitespace

Signed-off-by: pasta <pasta@dashboost.org>

* Remove trailing whitespace

* maybe fix linter

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
PastaPastaPasta 2020-08-30 14:22:51 +00:00 committed by GitHub
parent 8baf69d448
commit e8e34b836a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -407,6 +407,13 @@ class A
- *Rationale*: Easier to understand what is happening, thus easier to spot mistakes, even for those
that are not language lawyers
- Prefer signed ints and do not mix signed and unsigned integers. If an unsigned int is used, it should have a good
reason. The fact a value will never be negative is not a good reason. The most common reason will be that mod two
arithmetic is needed, such as in cryptographic primitives. If you need to make sure that some value is always
a non-negative one, use an assertion or exception instead.
- *Rationale*: When signed ints are mixed with unsigned ints, the signed int is converted to a unsigned
int. If the signed int is some negative `N`, it'll become `INT_MAX - N` which might cause unexpected consequences.
Strings and formatting
------------------------