4 ms·
There is tension between having a single source of truth for source code, including an opinionated formatter; and allowing individual programmers expressive fac
by rendall 5y ago
There is tension between having a single source of truth for source code, including an opinionated formatter; and allowing individual programmers expressive facility to format and structure code in a way that makes most sense to them.
I've been thinking lately of a formatter that would resolve this tension. It would be a local, individual formatter, complementary to the global, opinionated, "Prettier" formatter.
When the source code was committed to remote for review, the opinionated formatter would do its thing, making sure the code was formatted properly according to whatever the team agreed. But locally, the code would remain however the developer liked it.
- hprotagonist 5y agoa recipe for merge conflicts. i think maybe your only hope is to somehow “version the AST”, and let formatting be a style sheet or something. But i’m 1. talking out my butt and 2. sure i’m missing something.
- rendall 5y ago> let formatting be a style sheet That's a good expression of the idea. If merge conflicts happen, we're doing it all wrong. Version control shouldn't even really be aware of this.
- Cullinet 5y agothe most extreme validation of typographical precision is the banknote. Discuss?...
- hprotagonist 5y agotree-sitter and git: now kith!
- fragmede 5y agoIt's a decent idea! One problem though is all of the non-code elements, aka comments and how they intentionally align up with the code (mixed with spaces and tabs), so the ideal format is the one the original programmer wrote it in, and the second programmer using a different stylesheet can't edit comments and have them end up pretty for the first programmer. (The solution, obviously, is to not comment any code >_< )
- Cullinet 5y agoI agree with the decency of the ide But isn't this the nearest argument why we should start publishing negative results papers? The most important thing that I have ever learned was a announcement made by Google about how their industry consortium seeking to trade print magazine advertising inventory, failed with reference to the nature of this failure. No matter how lacking in detail this notice was, no matter that I was sent down a seven years solitary and very lonely path of mercifully ultimate discovery, on the heels of my startups exit collapse due to my cofounder tragically dying but we'd have been sunk by the problems indirectly revealed in that Advertising Age news item. However painful, and I'm talking about therapy for years after I emerged from reclusion, and real health issues giving up running and my diet turning to junk energy hits...I have learned more from being told "no can do Z because of y" and I seriously think that we /seriously have to start already getting over the reasons why we don't talk about our failures/. I mean holy smoke wouldn't we ever run out of good conversation ever again if we could have a good old banter and brew over our cockups? I'm thinking that this is how women are so much more successful in reproduction if they actually want to. What could we do if we tried?
- VBprogrammer 5y agoWas this GPT-2 trying to write a HN comment?
- olvy0 5y agoI'm not sure. Their posting history has multiple posts of this type with disconnected sentences. With GPT 2 at least there is usually some continuity and a semblance of a shared context between the sentences.
- freedomben 5y agoAfter reading several of the comments, I think OP is not a native English speaker, and that makes for some awkward grammar/sentence structure.
- 5y ago
- anchpop 5y agoThis is exactly what Unison is trying to do