@izaya where's that story you're writing? I wanted to catch up on it but lost the link on my phone
While I appreciate the advantages of "Easier to Ask for Permission than Forgiveness", given how poorly distinguished exception type hierarchies are in #Python, for the sake of providing good error reporting, I find "Look Before You Leap" makes a lot of sense a lot of the time. I'm thinking of the cases where you have a set of options for sets of provided parameters: Checking what's intended and then doing just that thing means that when the operation fails, I can report "<commanded operation> failed" vs trying each thing in series as the previous thing fails and then reporting all of the things that might have failed, only one of which was the intended one.
Really, I haven't found much reason to prefer EAFP outside of certain situations like dictionary accesses, where "checking" is the same thing as access, so it's redundant, or where checking first would cause TOCTOU (https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use) errors, in which case it's just a correctness thing. Maybe my example above for error reporting is a strawman and not what people have in mind when they say you should prefer EAFP, but given that it looks like basically the same kind of case where EAFP *is* generally recommended (until it doesn't), seems like without talking about the logic behind it (TOCTOU, redundancy, maybe others), you'll tend to mispredict the right approach.
it continues to baffle me why printf-style string formatting functions don't support a maximum length for strings that truncates to the first N character.s. While I recognize that you can eventually get to needing more elaborate preprocessing, that basic capability really handles quite a few cases when you want a fixed-width output
https://www.bbc.co.uk/programmes/w3ct1hth "the real story" is a pretty good program. it has, a couple of times, "incepted" it's way into my dreams when I keep my radio on over night. they just had an episode on #cryptocurrency, which I know is of interest to some
#radio #podcast
There's a lot of praise for syncthing but I think it's kind of unstable:
- often it says that another device is "disconnected" even though I just synced something 5 seconds ago
- the "sync progress" meter gets stuck at various percentages, even though syncing already finished
- the "sync progress" percentage is wildly different between two devices that sync the same folder
And some weirder stuff that I couldn't reproduce.
It has its own assembly language now.
My wife has honed her innate talent for #sourdough #bread making over the past few years. She can make many varieties with her starter and has opened a #microbakery business and is delivering locally to several customers now. Naturally, we only eat bread that she makes in the house too.
#MyWork #MyPhoto #CCBYSA #DSLR #Nikon #D7000 #Food #Cooking #Baking
To construct a #ParallelLine to a given line (in blue) in 2D #EuclideanSpace, all you need to do is pick two #points and draw #circles centred at those points of a specified #radius. Draw a #perpendicular to the line at each point (in red) and then draw a new line passing through the intersection of the perpendicular with the circles and there is the line parallel to the original one. Here is the process shown in #Geogebra.
It would be nice if C/C++ deprecation warnings would tell you at what version they were introduced. Bonus points for telling you when or at what version it's planned to remove the function.
#programming
A capable software engineer and aspirating (sic) cook. Also posting about space stuff (mostly NASA) occasionally
pronouns: he, him