To be fair, "an entire x" does have markedly different connotation than "x". The emphasis is that it's, well, the entirety of x. It's the difference between "i ate the cereal" and "i ate all the cereal".
I’m not sure I understand your point about fall through having to be explicit
As far as i understand it, every switch statement requires a break
otherwise it's a compiler error - which makes sense from the "fallthrough is a footgun" C perspective. But fallthrough isnt the implicit behavior in C# like it is in C - the absence of a break
wouldnt fall through, even if it wasnt a compiler error. Fallthrough only happens when you explicitly use goto
.
But break
is what you want 99% of the time, and fallthrough is explicit. So why does break
also need to be explicit? Why isnt it just the default behavior when there's nothing at the end of the case?
It's like saying "my hammer that's on fire isnt safe, so you're required to wear oven mitts when hammering" instead of just... producing a hammer that's not on fire.
From what i saw on the internet, the justification (from MS) was literally "c programmers will be confused if they dont have to put breaks at the end".
Generators probably. It's the one thing i genuinely miss about python when i work in rust.
Is pycharm's semantic highlighting still kinda ass? That's the biggest thing that stopped me from using it over vsc. As of like may this year i remember there still being active issue tracking for it.
Seems you missed the last line
compiles to fast code
15532 on-type format (, by adding closing ) automatically
Thank fucking god lmao. The PR specifically mentions the Some(
case too, which is exactly where i encounter this the most.
Overall very nice changes
Here's the script. It's nothing fancy, and iirc it only works for top level functions/classes. That means you still have to take care of attributes and methods which is a little annoying, but for simple stuff it should save a bit of time.
Pyo3 doesnt generate type hints at all iirc. There's some more info here
The gist, as i recall, is that you're supposed to maintain a .pyi file in the rust project folder that gets automatically added in by maturin when building. I'm no regex wizard, but i was able to whip together a small script that generates simple function and class stubs that also have the rust docstring. Iirc they're planning on adding some official support for generating type hints, but i have no idea how far along it is or where it is on the priority list
It's most useful when you're using some data you already have as the dictionary key. A usecase i had for this was a binary file parser with 10 types of event markers. It was originally coded with if/elif, but performance was a pretty big consideration. Using the event markers as keys to a dictionary dispatch improved performance by about 15% and made the code significantly more readable.
I read the book. It's not too difficult to replicate their test's functionality with rust tests, but i still ended up using their software suite a few times to verify some behavior and get a better understanding of the step-by-step logic for the alu and cpu
People in different socioeconomic situations/locations experience new technology at different points in time. Just because the internet existed doesnt mean they (or anyone in their immediate vicinity) had internet, state of the art computers, etc.
Qownnotes
It's a desktop app, but can sync with self-hosted cloud servers. It's also literally just text/markdown files.