4 ms·
If I recall Nim doesn't even allow tabs. Programming languages should not be overly opinionated in formatting, especially when it requires extra bytes to use sp
by encryptluks2 4y ago
If I recall Nim doesn't even allow tabs. Programming languages should not be overly opinionated in formatting, especially when it requires extra bytes to use spaces.
- thunky 4y ago> Programming languages should not be overly opinionated in formatting I think gofmt, python black, etc have demonstrated that it's usually better to have a single standard then it is to fight endlessly about these details.
- booleandilemma 4y agoIt's funny you say that, because Go and Python are two of my least favorite languages, partially for reasons of formatting.
- pigsinzen 4y agoThey have demonstrated that some people have interest in controlling formatting. It would be a stretch to say they demonstrated that it’s better to enforce a standard. Black, itself, changed rules many times within a 1-year period to the point our own CI would fail on existing code that previously passed.
- __turbobrew__ 4y ago> CI would fail on existing code that previously passed. You problem isn’t that black changed formatting rules, your problem is that you didn’t pin CI dependencies. This isn’t a unique problem to black, any other tool used in CI pipelines can cause things to break if you don’t pin them.
- danuker 4y agoIndeed. Something wihout security impact will use pointless resources when you update. Do it rarely (or never if possible).
- mikebenfield 4y agoI disagree entirely. Ideally there should be one valid way to format your code, and robust tools to make that formatting happen automatically. Allowing alternatives yields zero benefit and causes pointless debates and diffs.
- lamontcg 4y ago> causes pointless debates yes, having languages establish an immutable standard for tabs vs spaces has clearly ended all debate over them.
- mikebenfield 4y agoBut it actually kind of has ended this nonsense in the go community, and to a lesser extent in the rust community.
- bobbylarrybobby 4y agoThe benefit is, what if I don't like four spaces as indentation? What if I like two? Why do other get to force their aesthetic preferences on me when there already exists the tab character, whose apparent width is configurable?
- deleted 4y ago[deleted]
- chrisseaton 4y agoDo the extra bytes matter?
- bobbylarrybobby 4y agoProgramming languages shouldn't even consider whitespace (except perhaps new lines) syntactically important at all, so the whole discussion is silly. Once you've decided whitespace is important you might as well make emoji part of the syntax.
- throw827474737 4y agoWhy not? Making identation part of the syntax allows more for less?
- ghoward 4y agoBecause indentation-based languages have very limited formatting they can do. They can't do any indentation formatting.
- bobbylarrybobby 4y agoYou cannot cut and paste freely when indentation matter
- throw827474737 4y agoYes ok, but this is not very limiting and doesn't make this approach a ridiculous and failed one to start with, as the OP originally suggested and those languages which do it disprove already?
- tmtvl 4y agoI disagree: if we make languages have NWS (Non-optional WhiteSpace) then we can easily disambiguate between: let traversed-distance := yard-length; And: let traversed-distance := yard - length; Which is valuable as kebab-case is best case.
- jimbob45 4y agoIf it helps, you can configure your text editor of choice to auto-swap tabs for spaces. However, I share your displeasure for the gesture.