Live data from Hacker News

Formatting a 25M-line codebase overnight

stripe.dev

111–115 of 115 posts

Re: Formatting a 25M-line codebase overnight

#111
post #87
post #7

I’m shocked at the 25M line part! That is a completely unfathomable amount of code for one codebase. I really want to know more about that.

Imagine lots and lots of models and stubs generated from swagger, protobuf, sqlc etc.

Normally you don't want to format automatically generated code, you adjust the code generator instead.

Re: Formatting a 25M-line codebase overnight

#112

Earlier quoted context omitted.

For you, the person reading and writing the code

People are still reading the code?

I do... I guess people not reading their own code is why products are so buggy and crap these days

Re: Formatting a 25M-line codebase overnight

#113

Man must me nice to have the time to put so much work into tabs.

The practical case is less time spend on rebasing/formatting code - IMO formatting standard is very helpful as then it's the same as storing AST. There's also better preserving of git blame and that's likely why they have done it as single operation as otherwise you would have everybody messing with that part and now you know there's single commit that touched everything and if blame is on it then you check previous edit.

Re: Formatting a 25M-line codebase overnight

#114
post #74

Surely, it no longer needs to be human-readable, and the era of write-only code is finally upon us with the dawn of AI writing our mealtickets. Why bother formatting 25m lines of slop, and why is AI wasting tokens on making code look human-readable anyway?

Every LLM I have ever asked about this says they perform better when they receive pretty-printed code because it is easier to see structure and priorities. It has been an almost universal recommendation for me, and it makes sense since LLMs are just mimicking human expression.

That doesn't make sense.

A compiler doesn't need pretty code to compile; in my tests, when I ask an LLM to deobfuscate code, it doesn't skip a beat.

Post reply on HN