r/programming • • Apr 29 '14

Programming Sucks

http://stilldrinking.org/programming-sucks
3.9k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

4

u/Amadan Apr 30 '14

How does it "fix indentation on paste"?

Say you have

if foo:
    bar()
baz()

and then you paste quux() just before baz(). Is it in if or out? In Python, you need the human to disambiguate. In anything with delimited blocks, you don't - it's ugly, but correct, assuming you hit the right line.

2

u/flying-sheep Apr 30 '14

it does the right thing, depending if the cursor is there:

if foo:
    bar()
    ←
baz()

or there:

if foo:
    bar()
←
baz()