4 ms·
I can't handle [] syntax for generics. It makes code unreadable as far as I'm concerned because it makes it twice as difficult to know if I'm dealing with an ar
by jimbob45 4y ago
I can't handle [] syntax for generics. It makes code unreadable as far as I'm concerned because it makes it twice as difficult to know if I'm dealing with an array indexer or a generic.
The rest I can excuse but [], I cannot. Same reason I won't touch Nim.
- xigoi 4y agoI can't handle <> syntax for generics. It's impossible to auto-pair and looks ugly. The real solution is [] for generics and something else for indexing.
- renox 4y agoWhen looking for eleguant solutions: look at D, it's full of pearls: they use !() for generics.
- wtetzner 4y agoUsing function call syntax for array indexing always made sense to me. Functions are mappings from inputs to outputs, and arrays are mappings from indexes to values.
- xigoi 4y agoI agree, but explain that to programmers who think parametric polymorphism is too complex.
- int_19h 4y agoGiven that one of the languages that historically used the same syntax for array access and function invocation since day one is BASIC, I would dare say that it's not a complicated concept.