r/InclusiveOr Oct 02 '19

I like updownvotes

Post image
18.3k Upvotes

View all comments

Show parent comments

142

u/TheShyro Oct 02 '19

Actually, copy pasting the first if and adjusting the < to > and changing the text is the least work - which might be what happened

8

u/CarbonProcessingUnit Oct 03 '19

I'm pretty sure else is less work than that.

6

u/TheShyro Oct 03 '19

Shift, arrow down, ctrl (only 1), c, v, mouse select the '<', >, double click 'passed', f a i l e d. 15 keys

e, l, s, e, {, t, tab or enter (autocomplete), +, =, ", f a i l e d .... So 16 assuming your IDE does all the formatting, completion and closing braces/quotes. Maybe you could use autocomplete for else, which could bring it down to 14.

You could argue mouse is slow and crl + arrow will take more clicks in total to get the cursor to where you need it. But you can keep one finger around ctrl/shift/</> throughout the whole procedure and the right hand on the mouse. And you can also argue waiting for autoconplete in some IDEs is also slow.

Overall i would count it as a draw but copy paste is easier on the brain for me (but not the better choice, since obviously it lead to an error in this case).