|
Volte posted:Forget the word "null", it's distorting your viewpoint. Option is effectively a list that can have either zero or one element in it, and as a result you can basically use all the nice patterns that you can use with lists (and a few others that come from the zero-or-one property too). Null specifically means an invalid pointer, and it is sometimes (mis)used to represent the "empty list" case, but None and null aren't the same thing. Null is the absence of value. The concept isn't unique to pointers.
|
# ¿ Dec 12, 2023 19:09 |
|
|
# ¿ May 17, 2024 19:00 |
|
Polio Vax Scene posted:my problems may be undefined or absent depending on the language i am using My problems are severe but not representable.
|
# ¿ Dec 13, 2023 15:24 |
|
ExcessBLarg! posted:I'm struggling to think of a good example of having 100+ "else if" blocks even for generated code. Surely it could be converted to some kind of dispatch mechanism, or at least convert the conditional tests into a tree form. I want to write my code generator in 5 minutes, and generating additional elif blocks is easy.
|
# ¿ Dec 18, 2023 17:34 |
|
NihilCredo posted:car-cons-ization was right there car-cons-inogens
|
# ¿ Dec 27, 2023 02:39 |
|
shame on an IGA posted:TIL about python prepopulating integer objects for every value between -5 and 256 every time you run a program there was no other way for them to increase performance
|
# ¿ Mar 7, 2024 14:38 |
|
GABA ghoul posted:Htbh, but I would not approve this in a pull request because it clearly doesn't work if you pass a 0(which is even). AI still has a long way to go before it can replace a real developer or any negative numbers, despite signed input
|
# ¿ Mar 7, 2024 15:27 |
|
GABA ghoul posted:I think there is a very clever solution for this that could save a lot of work theres code like this in my current project and i dont have enough pull to get the person who wrote it on PIP
|
# ¿ Mar 7, 2024 18:00 |
|
GABA ghoul posted:
fail PR. use "." and the invariant cultureinfo
|
# ¿ Mar 7, 2024 22:21 |
|
GABA ghoul posted:This good solid code, but personally I would go with a more modern functional programming approach kleene logic leads to kleene code
|
# ¿ Mar 11, 2024 14:07 |
|
ultrafilter posted:It'd be even more efficient to move the precomputation to compile time. use a generator expression so you only precompute values you might use
|
# ¿ Mar 11, 2024 16:28 |
|
Bruegels Fuckbooks posted:That's actually a great idea! Here's the improved version:
|
# ¿ Mar 11, 2024 16:29 |
|
csammis posted:What is a database but coding horrors made transactional
|
# ¿ Apr 3, 2024 14:40 |
|
Soricidus posted:The problem with it is that having a case statement in the middle of a loop is the kind of thing that might plausibly be undefined behavior or a compiler-specific extension. It’s obvious what the code intends to do, but it’s not a common idiom, so unless you’re familiar with the trick, it’s not obvious whether it will actually do that reliably, even if you run it and it seems to work on your machine. what. duff's device is a little silly, but it's not against the spec
|
# ¿ Apr 10, 2024 19:47 |
|
Zopotantor posted:This is not really Duff's device though; it’s an implementation of a state machine or coroutine. In Duff's device the loop actually has a function, but here it would not really be necessary if the author had properly initialised "i" in the constructor. case statements in a loop have no issues
|
# ¿ Apr 10, 2024 20:55 |
|
|
# ¿ May 17, 2024 19:00 |
|
Bruegels Fuckbooks posted:its almost impossible to avoid getting sued for something if you work as a software developer long enough and release enough products - you can do all the patent search and perform all the rituals you want to try to ensure that you don't get sued and still end up with a lawsuit because someone has the software patent on an arrow that faces to the right indicating that a submenu is present on a context menu and your patent search should've picked up on that fact. better to have a policy of not searching patents. avoids 3x damages
|
# ¿ May 10, 2024 19:51 |