Thread 105794340 - /g/ [Archived: 693 hours ago]

Anonymous
7/4/2025, 2:19:32 AM No.105794340
1743331746477368
1743331746477368
md5: 5dde37e916070ac3423b6631b4ede57a🔍
the great debate
Replies: >>105794376 >>105794415 >>105794515 >>105794814 >>105795107
Anonymous
7/4/2025, 2:21:04 AM No.105794354
!=
Anonymous
7/4/2025, 2:24:03 AM No.105794376
>>105794340 (OP)
> input is a negative number
> Rocket explodes for 'unknonw' reason.
> Millions of dollars lost because OP doesn't know the difference between > and !=
You will never be a rocket scientist.
Replies: >>105794457 >>105794632 >>105795107 >>105797082
Anonymous
7/4/2025, 2:29:19 AM No.105794415
1704071481771436
1704071481771436
md5: cdd8501a164a3357df20333ceff2a718🔍
>>105794340 (OP)
If count is unsigned you should use > for ancient architectures where gt doesn't modify the status register
Replies: >>105796916
Anonymous
7/4/2025, 2:37:01 AM No.105794457
>>105794376
> input is a negative number
This alone is reason to fire/not hire OP.
Replies: >>105795753
Anonymous
7/4/2025, 2:43:47 AM No.105794515
>>105794340 (OP)
Those are different things.
Anonymous
7/4/2025, 2:59:31 AM No.105794632
>>105794376
>var called $count
>its negative
you will never be an engineer
Replies: >>105794710 >>105795753 >>105798021
Anonymous
7/4/2025, 3:11:03 AM No.105794710
>>105794632
Variable names don't define the type of data they hold.
Replies: >>105794727
Anonymous
7/4/2025, 3:12:41 AM No.105794727
>>105794710
>Variable names don't define the type of data they hold.
astute observation my genius friend!
Replies: >>105794807
Anonymous
7/4/2025, 3:22:35 AM No.105794807
>>105794727
You're not smart. Never will be.
Replies: >>105795227
Anonymous
7/4/2025, 3:23:07 AM No.105794814
>>105794340 (OP)
If count is unsigned, then > is equivalent to !=. Additionally, if the upper limit is known, then use `count < max`.
Replies: >>105794902 >>105795121
Anonymous
7/4/2025, 3:36:15 AM No.105794902
>>105794814
Counter vars are too abusable and unsigned counters they'll fail the step isn't always 1. Implicit conversion will cause infinite loops too.
Replies: >>105795475
Anonymous
7/4/2025, 3:37:16 AM No.105794908
>they'll
will*
Anonymous
7/4/2025, 3:40:51 AM No.105794932
it costs costs nothing to eliminate a class of bugs and make it easier to reason about a program, but some retards will still be obstinate about it.
Replies: >>105795120
Anonymous
7/4/2025, 4:03:31 AM No.105795081
How is this a debate, > obviously.
Anonymous
7/4/2025, 4:08:35 AM No.105795107
>>105794340 (OP)
>>105794376
> is more correct because it implies the number should only ever be 0 or positive. if you use != then you are basically saying either "this number may be 0, positive or negative" or "i expect this number to sometimes be negative due to bad programming" neither of which are preferable if the number should only ever be positive
Replies: >>105795120
Anonymous
7/4/2025, 4:10:24 AM No.105795120
>>105795107
accidental meme arrow sorry guys

>>105794932
if we extend this logic then you should also introduce null checks for every single object in a method even if all the existing use cases do not allow a null reference to even exist. it eliminates null reference exceptions after all
Replies: >>105795193
Anonymous
7/4/2025, 4:11:06 AM No.105795121
1724714764144023
1724714764144023
md5: 37630754c5c96422acb44954c7e0070e🔍
>>105794814
No, it's not. Have you ever heard about integer overflow, chud? This whole thread is a fiasco and OP is chud.
Replies: >>105795475
Anonymous
7/4/2025, 4:16:59 AM No.105795164
wizard book
wizard book
md5: e8ee8ef3ae0a8c9c1ca06a68664b9040🔍
>operators
lel, shit language.

(positive? $count)
(filter positive? '(1 0 0 2 3 0 4)) ; -> '(1 2 3 4)
Replies: >>105796933 >>105797046
Anonymous
7/4/2025, 4:21:50 AM No.105795193
>>105795120
null assertions are very common. they're also not completely free, so you are not comparing apples to apples.
Anonymous
7/4/2025, 4:27:16 AM No.105795227
>>105794807
projection & cope
Anonymous
7/4/2025, 5:12:04 AM No.105795475
>>105794902
>unsigned counters they'll fail the step isn't always 1
You mean "if the step isn't always 1"?
>Implicit conversion will cause infinite loops too.
This is more of a C problem than it is an unsigned problem. This can be mitigated by using unsigned integers for all variables and values which your counter will be compared against. You'll find that many such variables and values will also be non-negative by nature.

>>105795121
Do you even know how unsigned types work in C and its descendants? `count < max` works precisely because overflowing into the negative range yields a very large number that violates the condition.
Replies: >>105795798
Anonymous
7/4/2025, 6:11:17 AM No.105795753
1739561825224211
1739561825224211
md5: 8cbd99c15812f4989295883278a6163f🔍
>>105794457
>>105794632
This line of thinking is exactly why we have shitty software in production: Due to people that feel that every block of code they write is a means to satisfy their malignant need to constantly prove their intellect.
It also shows how you've never worked in a real enterprise ever. If you did, you'd know that speed of execution and high level / customer facing logic trumps whatever code crafting you want to do. You're there to make the employer money, not be an artisan.
This isn't even a debate.
Replies: >>105795805 >>105796884
Anonymous
7/4/2025, 6:21:31 AM No.105795798
>>105795475
>This can be mitigated by using unsigned integers for all variables and values which your counter will be compared against
No if you're using a countdown because the unsigned set isn't closed under subtraction, "(unsigned) small - (unsigned) large" will overflow. And unlike div between integers with a well behavior the result of that operation depends on the system (obviously people should never use == to compare the result of divisions)
Anonymous
7/4/2025, 6:23:52 AM No.105795805
>>105795753
>You're there to make the employer money, not be an artisan.
>This isn't even a debate.
Yes, because blatant retardation is profitable. Of course it isn't a debate. When you are licking windows, I don't need to argue about whether or not it is raining outside.
Anonymous
7/4/2025, 9:53:07 AM No.105796884
>>105795753
But nobody here asked about wageslaves
Anonymous
7/4/2025, 9:57:30 AM No.105796916
>>105794415
Please elaborate
Anonymous
7/4/2025, 10:00:03 AM No.105796933
>>105795164
>AI generating a cover for a book that already exists
Retard
Anonymous
7/4/2025, 10:12:59 AM No.105797046
>>105795164
is this forth?
Anonymous
7/4/2025, 10:19:44 AM No.105797082
>>105794376
this
anomalous fuckups happen with both hardware and software
trusting it'll always be a positive number could result in shit breaking irl and that could be life and death
assume shit erroneously fucks up, whether intentionally or not, and cover your ass with irrefutable checks
there's an old vi on youtube I think from LiveOverflow who demonstrated you can voltage-jump your way through if checks for something like a password check
Anonymous
7/4/2025, 10:57:36 AM No.105797313
how is this even a thread? two objectively different statements, but if this this were places in a while loop i would do (count > 0) just to knock on wood.
Anonymous
7/4/2025, 1:06:00 PM No.105798021
>>105794632
count is not an alias for "unsigned int", jeet, nor should you expect a symbol name to be foolproof logic.