Remove the ++ and –- operators
81–90 of 249 posts
Re: Remove the ++ and –- operators
#82> Their expressive advantage is minimal - x++ is not much shorter than x += 1 Personal opinion, but I definitely miss '++' every time I'm doing '+=' in Python.
I think I'd argue with the "not much shorter" because it's less typing to perform a `++` versus `+=1`; I hold shift, I type the = key, obtaining the +, then I have to pause typing long enough to release the shift key, type the = key again, and now my other hand has to get involved and type a 1. And that's without the spaces.
Re: Remove the ++ and –- operators
#83Earlier quoted context omitted.
I think I'd argue with the "not much shorter" because it's less typing to perform a `++` versus `+=1`; I hold shift, I type the = key, obtaining the +, then I have to pause typing long enough to release the shift key, type the = key again, and now my other hand has to get involved and type a 1. And that's without the spaces.
Well, I type the * key to get a +, then shift and 0 to get a =, then 1 to get a 1. Slow, and my fingers have to jump completely over the keyboard. What is far more annoying, and should be banned, are `these` (I have to press shift+' twice to get one `, otherwise I end up with á' instead of `a`), and {}[], as they are on AltGr+7/8/9/0
I swapped the US out for international because it was important to me to type Pokémon properly. It is an annoyance to have to type ` followed by a space because it is waiting for a vowel to let me type ù. Same with ' which let's me type ç or " which lets me type ü... etc. I disable it when programming for the reason you cited. It can be annoying to deal with. Especially when my IDE tries to autocomplete " and I typed "" instead of " (followed by a space) and I get """".
Re: Remove the ++ and –- operators
#84While 4 touches on this a bit, I think another reason is that mutable value types are generally harmful. Save mutability for compiler optimizations and write your code with "let".
Re: Remove the ++ and –- operators
#85?
Re: Remove the ++ and –- operators
#86"Drop one of x++ or ++x. C++ programmers generally prefer the prefix forms, but everyone else generally prefers the postfix forms. Dropping either one would be a significant deviation from C." Funny given the name of the language.
Re: Remove the ++ and –- operators
#87Earlier quoted context omitted.
Agreed. In the list of disadvantages, we don't see "many professional programmers expect the ++ and -- operator" or "beginners will be confused because old code examples on the web will stop working".
This argument feels like 'legacy for legacy's sake'.
Re: Remove the ++ and –- operators
#88VOTES-- MORE SERIOUSLY....CODING CAN BE ABOUT AESTHETICS. YES, JUST BECAUSE. CODE CAN LOOK GOOD AND THAT IS A VALUE. BUT ALSO, AESTHETICS CAN HAVE A NON-MEANINGLESS AFFECT ON COMPREHENSION, READABILITY, CODING-PLEASURE AND PRODUCTIVITY. SO MONEY, BASICALLY. PERSONALLY, I LOVE THE ++ AND -- AESTHETIC. IT'S JUST A COOL GLYPH/DIGRAM/IDIOM. BRING BACK THE QUIRKINESS ( OKAY, NOT TO THE PERL-LEVEL ) BUT BRING IT BACK!
Re: Remove the ++ and –- operators
#89I strongly disagree with this. Being able to do a very simple task like increment or decrement a number inline is useful and reduces clutter and I've always found the idea that the operator complicates things ridiculous. The way they work has always been obvious to me since I first learned to program in PHP as a tween.
Re: Remove the ++ and –- operators
#90"These operators increase the burden to learn Swift as a first programming language" Come on. There are legitimate reasons not to carry one language's expressions to another, but this isn't a good one. Most people first learn of ++/-- as "By the way, you can use ++ as a shortcut to add one" and leave it at that.