[Python-ideas] Yet Another Switch-Case Syntax Proposal
Andrew Barnert
abarnert at yahoo.com
Wed Apr 23 01:29:02 CEST 2014
On Apr 22, 2014, at 15:20, Oleg Broytman <phd at phdru.name> wrote:
> On Tue, Apr 22, 2014 at 03:06:55PM -0700, Devin Jeanpierre <jeanpierreda at gmail.com> wrote:
>> Why is it that every time someone brings up switch/case, they're being
>> inspired by C and Java instead of ML or Haskell?
>
> How many people know imperative, procedural and OO languages? And how
> many know functional or logic-based languages?
I think most people know multi-paradigm languages. C++ has similar features, even if many of them are restricted to it's compile-time template engine. Most JavaScript programs are all about passing anonymous functions to higher-order functions as callbacks, of abstractions on top of that like futures. And so on.
Anyway, people don't have a problem learning map, any, comprehensions, unpacking, or other functional-derived features in Python even if they come from C; in fact, those features are often why they don't want to go back to C. The issue is always finding the right balance, borrowing features that fit into the language well and make code easier to read but not trying to encourage recursive folds over loops or rebuild I/O around monads or pure but nondeterministic functions.
More information about the Python-ideas
mailing list