4 ms·
"So the danger to paste stuff at the wrong indent level is far less than in Python. " I would argue that this is actually a feature of the language. This "dang
by FraaJad 16y ago
"So the danger to paste stuff at the wrong indent level is far less than in Python. "
I would argue that this is actually a feature of the language. This "danger" actually forces the programmer to read through the code he is pasting by indenting.
Also, how many pairs of source code fragments share the same variable names? This argument is quite shallow.
- yesimahuman 16y agoThe biggest error I have with pasting is that the pasted code uses spaces where I use tabs. They look like the same indent level but they are not. A good old ggVG= solves that though in vim
- hasenj 16y agogg=G also works; one less character
- chunkbot 16y agoI use Emacs, and I can't remember the last time I manually indented a line of code. Most of my non-web programming is in Erlang, Lisp, and C. My editor does the indentation for me.
- Daishiman 16y ago:retab is your friend.
- jeberle 16y ago:set expandtab | retab
- stcredzero 16y agoThis "danger" actually forces the programmer to read through the code he is pasting by indenting. Read through, or partly rewrite? More of the latter than the former, IMO. If you're only reading then 4 spaces is often indistinguishable from a tab. Sounds like the "block indenting" style in Smalltalk. Kent Beck favored it because it made bad Smalltalk code look bad. (Hard to read.) I like the idea, but in reality, it's too idealistic and not nearly practical enough.