Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
Post History
My guess: Because they used a signed integer type for rep, therefore it's not capped at 0. (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction i...
Answer
#6: Post edited
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- rep := rep + -penalty;
- ```
- vs:
- ```
- rep := (rep + -penalty > 1) ? rep + -penalty : 1;
- ```
- Here using a simple substraction has the advantage of easier detection of arithmetic overflow. But I doubt it's using _raw/machine_ numeric types. Because it's Ruby - I guess it auto promotes to arbitrary precision. But it was supposed to be C#. There are _raw/machine_ numeric types in C#.
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- rep := rep + -penalty;
- ```
- vs:
- ```
- rep := (rep + -penalty > 1) ? rep + -penalty : 1;
- ```
- Here using a simple substraction has the advantage of easier detection of arithmetic overflow. But I doubt it's using _raw/machine_ numeric types. Because it's Ruby - I guess it auto promotes to arbitrary precision. But it was supposed to be C#. There are _raw/machine_ numeric types in C#.
- ---
- ### your comments
- > I don't think the Q was about technical details.
- I agree. However, in the particular case of _Codidact_<sup>1</sup>, many current - interim? - design decisions are tightly intimate with the corresponding technical implication, because they actually predate _Codidact_<sup>2</sup> itself, in some cases by many years. I could guess therefore, some of those might been taken probably with simplicity in mind.
- <sub>1: This _Codidact_ occurrence, you can read as _[Qpixel][0]_.</sub>
- <sub>2: _Codidact_ in the broad sense. Post-"[Dear Stack Exchange, Inc.,][1]".</sub>
- [0]: http://github.com/codidact/qpixel
- [1]: https://dearstackexchange.com
#5: Post edited
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- rep := rep + -penalty;
- ```
- vs:
- ```
- rep := (rep + -penalty > 1) ? rep + -penalty : 1;
- ```
Here using a simple substraction has the advantage of easier detection of arithmetic overflow. But I doubt it's using _raw/machine_ numeric types.
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- rep := rep + -penalty;
- ```
- vs:
- ```
- rep := (rep + -penalty > 1) ? rep + -penalty : 1;
- ```
- Here using a simple substraction has the advantage of easier detection of arithmetic overflow. But I doubt it's using _raw/machine_ numeric types. Because it's Ruby - I guess it auto promotes to arbitrary precision. But it was supposed to be C#. There are _raw/machine_ numeric types in C#.
#4: Post edited
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
rep := rep + -penalty- ```
- vs:
- ```
rep := (rep + -penalty > 1) ? rep + -penalty : 1- ```
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- rep := rep + -penalty;
- ```
- vs:
- ```
- rep := (rep + -penalty > 1) ? rep + -penalty : 1;
- ```
- Here using a simple substraction has the advantage of easier detection of arithmetic overflow. But I doubt it's using _raw/machine_ numeric types.
#3: Post edited
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
a := a - b- ```
- vs:
- ```
a := (a - b > 1) ? a - b : 1- ```
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- rep := rep + -penalty
- ```
- vs:
- ```
- rep := (rep + -penalty > 1) ? rep + -penalty : 1
- ```
#2: Post edited
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
(And rep substraction performs just a substraction instead of a capped substraction).- ```
- a := a - b
- ```
- vs:
- ```
- a := (a - b > 1) ? a - b : 1
- ```
- My guess:
- Because they used a signed integer type for rep, therefore it's not capped at 0.
- (And hypothesizing that because of lazyness and simplicity rep substraction performs just a substraction instead of a capped substraction).
- ```
- a := a - b
- ```
- vs:
- ```
- a := (a - b > 1) ? a - b : 1
- ```