3 ms·
You misread my comment. I'm not saying "colons are bad", I'm saying "excessive holding of keys is bad". if (cond) { } requires 4 presses of Shift (or 2, if you
by dataflow 4y ago
You misread my comment. I'm not saying "colons are bad", I'm saying "excessive holding of keys is bad".
if (cond) { } requires 4 presses of Shift (or 2, if you combine them).
if cond: foo requires 1 press of Shift.
I'm not sure what part of my comment makes you believe that I think the latter comes out worse than the former. If anything, the fewer keypresses probably strongly helped Python's success without people necessarily realizing it. Moreover, this might very well be one thing hindering more widespread adoption of Python's type annotations.
You also need to consider how common each construct is. A class declaration requiring 20 excessive keystrokes is not necessarily worse than a variable declaration requiring 1 excessive keystroke.
- the_af 4y agoBut Scala and lots of other programming languages use ":" with no hindrance to adoption. Also consider this: lots of hugely frequent characters and symbols that don't require SHIFT in EN-US keyboards do in other keyboards layouts, for example Spanish. So this cannot be a consideration, at least not a major one.
- dataflow 4y ago> But Scala and lots of other programming languages use ":" with no hindrance to adoption. It's kind of weird to see you assert that with no attempt to establish its truth when Scala is something like... the ~20th most popular language? Whereas Python, C, C++, Java, VB, C#, etc. are right at the top. So either this is one of the (obviously many) factors hindering wider adoption of Scala, in which case the relative popularity is entirely consistent with this, or it isn't a factor, in which case the it would make sense to present at least some evidence to the contrary given that your assertion goes against the popularity rankings. > Also consider this: lots of hugely frequent characters and symbols that don't require SHIFT in EN-US keyboards do in other keyboards layouts, for example Spanish. So this cannot be a consideration, at least not a major one. I'm pretty sure the popularity of {most software technologies} outside the US and inside the US are very far from being independent variables.
- the_af 4y ago> It's kind of weird to see you assert that with no attempt to establish its truth when Scala is something like... the ~20th most popular language? Whereas Python, C, C++, Java, VB, C#, etc. are right at the top The barrier to adoption of Scala has to do its functional programming side, as well as its complex libraries and types. Kotlin also uses ": type" syntax, by the way. As does Python! > I'm pretty sure the popularity of {most software technologies} outside the US and inside the US are very far from being independent variables. It's hard to understand your point. Are you arguing that programming languages are less popular outside the US? Or "most software technologies"? So let's sum it up: SHIFT concerns are very minor in comparison to other programming language ergonomics (in which need I remind you, C++ never fared very well), and the ": type" syntax is very common and mainstream in programming languages, with no hindrance to adoption.
- dureuill 4y agoThe number of excessive keystrokes is largely irrelevant (as long as it isn't an order of magnitude too much), because typing the code on keyboard is generally far from the limiting factor for the speed of writing code. Most of the time you spend thinking about what you should be typing. So optimizing for the number of keystrokes is optimizing for the wrong metrics