4 ms·
Many programmers are averse to line wrapping plain text files (especially source code), which has never made much sense to me. There's great support for it in l
by wilg 6y ago
Many programmers are averse to line wrapping plain text files (especially source code), which has never made much sense to me. There's great support for it in like every editor.
- catalogia 6y agoEditors support it fine, but personally I find the result aesthetically unpleasant no matter the editor.
- serf 6y agolinewrap is aesthetically and logically jarring when you're debugging code 'by shape'. peaks and valleys between functions and such are a huge aid visually -- line wrapping makes visualization of source code harder for myself, personally.
- lelandbatey 6y agoThat's only a problem if you're using a line-wrap method which doesn't account for indentation and just blindly wraps (which yes, is awful). If you want to have nice indentation aware plain text line wrapping, your text editor almost certainly supports it. If you use vim, look into the "breakindent" option. If you use Emacs, you can use the "adaptive-wrap" package with a configuration like this: ;; Indentation of softwraped code (use-package adaptive-wrap :ensure t :init (defun my-activate-adaptive-wrap-prefix-mode () "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously." (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1))) (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode))
- themodelplumber 6y agoIn my experience, line wrapping makes line numbering uglier and less intuitively useful. This impacts line operations. I agree with Linus in some ways, but I think he's also repping a broad-front executive-style decision rather than a really nuanced one. And the details can really impact the preference in a case like this.
- 0-_-0 6y agoI've recently been getting used to using line wrapping in VSCode (Alt+Z) and it's been working great. I only wish it was a bit more "semantic", similar to running a linter with a specified width rather than just copying the indentation of the previous line, so that e.g. when I need to wrap a line that's a comma separated list (e.g. function parameters) it lines up the list elements in 1 column: def f( a, b, c, d ):
- Roboprog 6y agoI like it, but then I have adopted a style very similar to that in the last 3 or 4 years: format expressions to approximate their syntax tree, with closing symbols aligned with the line that opened the sub-tree. Essentially, K&R indentation for ALL grouping symbols, not just curly braces. This way, lines are never very long anyway. Well, especially since my JS code has more of a “Ruby, with a dash of Lisp” style than a “Java” style.
- Roboprog 6y agoAs to vertical size: how much crap are you going to put into one function, anyway? Other than perhaps some local (nested) helper functions.