4 ms·
I’m a heavy professional python user, and I’ve read about this new feature maybe a half dozen times. And I still don’t get it. Sigh. Powerful? I guess so. Com
by oofbey 5y ago
I’m a heavy professional python user, and I’ve read about this new feature maybe a half dozen times. And I still don’t get it. Sigh.
Powerful? I guess so.
Complicated? Definitely.
Confusing? You bet.
Good addition? Uhh, I really hope so.
- BiteCode_dev 5y agoGive a try to fastapi + vscode with pylance. Eye opening to what you can do if you use modern features right.
- mixmastamyk 5y agoThis is the best piece I've read on the subject, you might give it another try. I'm now lukewarm on the feature, whereas before I thought an abomination.
- rocqua 5y agoThe concept came over from Rust and Haskell. The value of the concept really comes out when you start designing your types to be case...match-ed against. I am not the best person to explain this, but the value I mean is allowing more 'algebraic datatypes' to be used in python. This way you can have the structure of your data(types) more closely resemble your business logic. Making code more readable, and also making it harder to represent invalid states, which reduces the need to validate data. (I recall an article called "parse don't validate" the same idea applies here) I think it will take a while for python users to start using this paradigm, but I expect it will be very useful for folks who know Rust, Haskell, or similar languages.
- umanwizard 5y agoThe concept is much older than Rust and Haskell. It was present in ML which is from the 70s and has strongly influenced most modern languages (and yes, Rust and Haskell particularly strongly).
- rocqua 5y agoof course. But within Haskel and Rust the concept gained traction with the wider developer community. I think especially Rust was important for getting python developers to consider adopting it. Since it is a 'serious' language rather than an 'ivory tower' language.
- deleted 5y ago[deleted]