this post was submitted on 28 Feb 2024
616 points (97.1% liked)

Programmer Humor

18961 readers
372 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
616
wait what (pawb.social)
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/[email protected]
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 5 months ago (3 children)

How can it tell the difference between spaces used for indentation and spaces used for alignment, if you use the same character for both?

[–] [email protected] 8 points 5 months ago

I guess the indention sizer thing knows how the formater works and adjusts accordingly. I can't imagine it would be too much of a problem.

Iirc Jetbrain IDEs has a feature called dynamic tabs/space (or something like that) which uses exclusively tabs until it needs to align something and a tab doesn't fit, so it uses a few spaces instead.

[–] [email protected] 3 points 5 months ago

Maybe alignment more for the righthand side of assignments. If you have a block of variables with different name lengths, or within a constructor / function call.

[–] [email protected] 2 points 5 months ago

All parsers ignore a shitload of whitespace already. Just compare unformatted code, COMPLETELY unformatted code, code without character returns, and it'll become obvious how any given language is interpreted around whitespace.

Also fun to see just how infrequent a semicolon is 'actually' needed to tell when the end of a statement is here.