Hacker News new | ask | show | jobs
by moffkalast 1136 days ago
> OK, this is not the biggest thing, but why on earth does Bard use indentation with 2 spaces instead of the standard 4? This drove me up the wall, so I tried all sorts of prompts to get Bard to use indentation with 4 spaces but they all failed.

This is also interesting with GPT-4. I've been using it to generate tons of code and sometimes it indents by 2 spaces, sometimes it mimics what I give it first, but often times to reverts to 2 spaces regardless even if told to explicitly indent differently. Rather annoying indeed.

ChatGPT needs a plugin that automatically sends the output through this site lol: https://www.browserling.com/tools/spaces-to-tabs

2 comments

Two spaces is less tokens, might actually be a good thing overall to limit token usage so you can fit more code in the context window. It’s easy enough to have your IDE convert it to your preferred format after generation. But I am a diehard fan of tabs over spaces, so I guess I’m used to converting incorrectly formatted code anyway ;-)
First time I've seen a good argument for tabs over spaces. Richard Hendricks would be proud
You can just ask it to use your preferred indentation style. Personally I prefer 2 spaces so even if 4 spaces is apparently “standard” I’d like it to use 2
That's what I'm saying, it always eventually relapses back even if you do, sometimes even after a single reply. Makes more sense to just postprocess it afterwards immediately.