LegoBrickOnFire
@LegoBrickOnFire@lemmy.world
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 18 hours ago:
I dislike treating None as an equivalent for the empy list, but that does not further the discussion…
I hurt myself in confusion while reading the second quote. Is it the right quote? (also, nazi (relating to the nsdap) is probably not the right word, did you mean fascist?)
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 19 hours ago:
I agree. So if None is a valid input we should check it first, and then check if the length is zero. In this situation, we see a type error only if the programmer screwed up and everything is explicit
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 19 hours ago:
I don’t really understand the point about exceptions. Yeah “not foo” cannot throw an exception. But the program should crash if an invalid input is provided. If the function expects an optional[list] it should be provided with either a list or None, nothing else.
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 20 hours ago:
Passing None to a function expecting a list is the error…
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 20 hours ago:
Well, in your case it is not clear whether you intended to branch in the variable foo being None, or on the list being empty which is semantically very different…
Thats why it’s better to explicitelly express whether you want an empty collection (len = 0) or a None value.
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 20 hours ago:
I really dislike using boolean operators on anything that is not a boolean. I recently made an esception to my rule and got punished… Yeah it is skill issue on my part that I tried to check that a variable equal to 0 was not None using “if variable…”. But many programming rules are there to avoid bugs caused by this kind of inattention.
- Comment on This is unfair! 6 days ago:
I had never heard of Democracy Manifest before coming to lemmy. I am loving this subculture in strad of reddit’s
- Comment on [deleted] 1 week ago:
Lol, is he the one who just got 3 years in prison in switzerland?
If not, it’s enough to land you three years in prison in switzerland
- Comment on Today's Survey. One point for everything that you have NEVER DONE 1 week ago:
40-14 is also off by half a year, dang
- Comment on If I sit in my basement and do nothing, I can't fuck things up 5 weeks ago:
Use a spoon/fork to direct the flow, the liquid will follow the surface of the spoon, not that of the container
- Comment on Zig; what I think after months of using it. 2 months ago:
Great article I think. I don’t have a lot of experience in zig, but I feel like it’s just a better version of C. More specifically, C with a more modern synthax, better defined behaviour, better error handling. As the author highlights it, using the comptime and reflection to make generics can easily become a footgun and make the code messy. But hey, having the option to make generic code is still better than C.
- Comment on What is a metaphor you like in your language? 2 months ago:
Are there really esperato speakers in the wild (not just Duolingo?) It would be a fun language to learn, but if no one speaks i’d rather just get better at german :)
- Comment on Top 10 Anime of the Week #04 - Winter 2025 (Anime Corner) 2 months ago:
oh wow, I am blind… Thanks!
- Comment on Top 10 Anime of the Week #04 - Winter 2025 (Anime Corner) 2 months ago:
what’s up? The apothecary Diaries are not even making the list?
- Comment on Steam Deck sales drop hard following the Nintendo Switch 2 announcement 2 months ago:
Thank you for your wisdom <3
- Comment on Steam Deck sales drop hard following the Nintendo Switch 2 announcement 2 months ago:
Unemployement will be the true salvation :p
- Comment on Steam Deck sales drop hard following the Nintendo Switch 2 announcement 2 months ago:
I am waiting for the day I will have time to play :')
- Comment on Sony's Crunchyroll Finds Its Early Lead in Anime Under Attack 3 months ago:
Not me clicking the link expecting to find some alternative site that is not crunchyroll that allows me to legally watch anime and support the creator. But actually those are just companies I want to avoid just as bad as crunchyroll…
- Comment on Frieren will never stop 4 months ago:
The manga being called “frieren the slayer” is a bit of spoiler. It was really chilling how the name “frieren the slayer” was revealed in the anime. It was definetly my favourite scene in the anime
- Comment on Even better than a cart of apples 4 months ago:
Those are things that regulate the tension in the overhead cables in train tracks. With the variation of temperature cables tend to contract/expand and this systems allows the cables to do so freely with a constant tension provided by the weights.
- Comment on Bluesky says it won’t train AI on your posts 4 months ago:
To be fair, they could probably train AI on Lemmy data, they just won’t ask for permission and won’t be charged for it
- Comment on But yes. 4 months ago:
They just found rocks that are naturally hot and boiled water with it… Engineering is a scam.
- Comment on [Clip] Is That a Real Gun? - Heavenly Delusion 4 months ago:
This is my favourite anime of all time! There are several layers to the story that can only be understood after watching the anime again and it’s beautiful.
- Comment on Tiger Predators 5 months ago:
Tigers with horns 😨😨 ?