3 ms·
I'm mixed on this one. While I love pattern matching in SML and Rust, I don't know if it's right for Python. Like other comments have said, I loved and learned
by jjice 6y ago
I'm mixed on this one. While I love pattern matching in SML and Rust, I don't know if it's right for Python.
Like other comments have said, I loved and learned a lot of Python from looking at a code base and understanding everything immediately because there wasn't much to learn on the language end of things. It was nice and small. Not that the addition of pattern matching is a death sentence for simplicity, but I fear that it may lead to some other extraneous features in the future.
I like powerful, featureful languages, but I personally like Python as a simple language that anyone can learn 80% of in a busy weekend.
Will I use pattern matching? Maybe. I'll definitely play around with it. Now if we could get some algebraic datatypes then I think I'd start contradicting myself...
- baby 6y agoTrue, but honestly pattern matching is so cool that all languages should have it and ditch switch statements.
- chriswarbo 6y agoThankfully Python has avoided switch statements. Hopefully pattern-matching will take the place of if/elif/elif/else chains, or dereferencing dictionary literals (e.g. `{case1:foo, case2:bar, ...}[myVal]`)