|
Option #7: undefined behavior.
|
# ¿ Dec 11, 2023 17:54 |
|
|
# ¿ May 21, 2024 07:08 |
|
leper khan posted:Horror from the thread and all, but I never understood the appeal of option types. Doesn't give any more information than a pointer. See here for a pretty good explanation.
|
# ¿ Dec 12, 2023 16:25 |
|
https://twitter.com/yiningkarlli/status/1736300787704426780
|
# ¿ Dec 18, 2023 04:14 |
|
https://twitter.com/IroncladDev/status/1752349724105945181
|
# ¿ Jan 31, 2024 02:47 |
|
code:
|
# ¿ Mar 7, 2024 21:57 |
|
Bruegels Fuckbooks posted:Here's a C# version that precomputes all even numbers up to IntMax, which obviously will save on calculation speed. We improve the initialization speed using a Lazy<T> so we only pay the cost of the precomputation on first use of IsEven() It'd be even more efficient to move the precomputation to compile time.
|
# ¿ Mar 11, 2024 15:44 |
|
I briefly looked into generating a lookup table using templates but that's way too much effort for me.
|
# ¿ Mar 11, 2024 16:25 |
|
I could write a lot about R here but this latest example I came across is a complete mystery:code:
The convention for function calls in R is that they return the value of the last expression evaluated. That sure looks like it should be 1 in both cases but that's not what happens. I'm probably happier not thinking too much about why.
|
# ¿ Mar 14, 2024 04:29 |
|
https://twitter.com/ryxcommar/status/1772105348872011972
|
# ¿ Mar 25, 2024 15:31 |
|
csammis posted:What is a database but coding horrors made persistent
|
# ¿ Apr 3, 2024 14:31 |
|
https://twitter.com/the_moisrex/status/1776661987855941776
|
# ¿ Apr 6, 2024 23:34 |
|
You can get weird behavior even with machine integers. The function that sends x to -x has two fixed points and that means you can't always assume that abs(x) > 0.
|
# ¿ Apr 29, 2024 02:27 |
|
|
# ¿ May 21, 2024 07:08 |
|
|
# ¿ May 14, 2024 20:30 |