Sidechat icon
Join communities on Sidechat Download
Why do all the latest models write code that genuinely looks like these old stock images of “code”
71 upvotes, 7 comments. Sidechat image post by Anonymous in Computer Science. "Why do all the latest models write code that genuinely looks like these old stock images of “code”"
upvote 71 downvote

default user profile icon
Anonymous 8w

saves token count

upvote 1 downvote
default user profile icon
Anonymous 8w

If you write code in a block like above, it’s far more efficient to run. For whatever reason carriage returns have some kinda pause factor, while this just runs seamlessly. So it’s not token count in the traditional sense, but that it’s physically easier to parse for the program.

upvote 1 downvote
default user profile icon
Anonymous 7w

They’re Minifying prolly

upvote 1 downvote
default user profile icon
Anonymous replying to -> #1 8w

I can’t imagine cutting out white space would really save that many tokens right?

upvote 1 downvote
default user profile icon
Anonymous replying to -> #2 8w

Perhaps I’m missing something here but in most languages the lexer will remove whitespace such that the compiled/interpreted machine code is equivalent (i.e. executes the same at runtime). I’m not trying to be rude here, have you taken your university’s “programming languages” course (or something of the like)? You can go super in-depth on how the code you write actually gets translated to machine code and executed, but one undergrad class is enough to demystify a lot of things

upvote 2 downvote
default user profile icon
Anonymous replying to -> OP 7w

Little rude 😅 I’m doing about 100k a year as a web dev/admin/consultant while working on my masters? CSS and JS minification basically takes and eliminates “free space” in the file, like above. The part I explained poorly was it’s not that CSS files pause when parsing but that each carriage return adds significant size to the file which overall degrades page speed load times and first contentful paint. Minified code just loads faster. (Almost the same thing)

upvote 1 downvote
default user profile icon
Anonymous replying to -> #2 7w

I mean sure like minified pages have fewer bytes to download/transfer so it’s a bit faster for the specific case of a client loading a webpage downloaded over network, but that’s a much different concept than like literally the code “runs far more efficiently” or a “pause” on carriage returns. And it doesn’t really explain why LLMs do this shit in code that doesn’t need to be minified

upvote 2 downvote