Follow

Indent with semicolons

int main() {
;;;;int a;
;;;;for (a = 0; a < 10; a++) {
;;;;;;;;printf("%d\n", a);
;;;;}
}

(is it illegal to recycle your old tweets as toots)

@sir

indentation brains:

little brain: tabs
big brain: 2 spaces
exploding lsd brain: 4 semicolins
@sir NO WAY! You can be a time crystal for all I care!

@sir

> (is it illegal to recycle your old tweets as toots)

no - some of the best thoughts are old thoughts, and the more of birdsite is indexed within the fediverse the less reason we have to ever go to birdsite.

That said. There's a tradeoff. It's a tradeoff that Reddit found early on in its history -if you do nothing but post things people could reasonably know, you move the fediverse closer to being a no-content coffee shop magazine. Be mindful and you'll be fine.

@sir as long as you aren't manually cross posting

@sir You wanna see something even worse?

twitter.com/xaprb/status/91774

(For the visually impaired or birdsite avoidant: The code is indented with whitespace, but all the semicolons and braces have been aligned to the right of the code at 60 columns or so, all collapsed together.)

@sir Okay, I can reproduce with clang and gcc…
WTF, I guess I’ll have to re-read the C specification…
@sir Which means it can only replace tabs when you do “tabs for indentation; space of alignement”.

@sir @lanodan it won't compile with -Werror and all the options under modern gcc ( all/extra/pedantic/i forget the others to get _actually_ everything ) but. that's not a standards thing,... 🤷

@sir @lanodan ( or it used to not i'm pretty sure? although what gets warned for style evolves over time. )

@lanodan @sir ; just denotes end-of-statement. empty statements are valid.

@kaniini @lanodan @sir Reading K&R at the moment, much of the example code uses empty statements legitimately. It drives me mad.

Stop trying to jam all of your code into a `for` statement dammit!

@kaniini @lanodan @sir Oops, pinned toot, didn't realise I was replying to something that's 9 months old...

@lanodan @sir as far as I know this is legal C but of you deactivate the optimiser this will be verry slow becouse every semicolon is an "nan" command which basically means that the cpu chust waits a command cycle without doing anything usefull

@sir *waits for the new semicolon war to start* "How many semicolons do you indent with?"

@sir You don't need semicolons at line ends then.

@sir

BTW my favorite coding style is semicolon-less and curly-brace-less.

#define for for(

int main()
{ int a
; for a = 0; a < 10; a++
){ printf("%d\n", a)
;}
}

;{}) thingy is inserted automatically based on the indentation.
And I've configured editor to hide first 8 characters of each line.

@jerky @sir I am not sure if I should be horrified or in awe

@jerky @sir

Emojilang
🔢 main()
🔢 a
🚸 a = 0; a < 10; a++
🤢 "%d\n", a)

@sir that is terrible and wonderful and awful and useful and omg

@natecull @sir
I work with someone who maintains that, in a comma-separated list, the comma should be at the beginning of the line for readability purposes.

@sir no, but using empty parentheses in function declarators is discouraged

@kiilas don't forget the missing return statement

@kiilas I'm afraid that when I imported this from twitter I didn't take advantatge of the larger character limit to correct my compromises

@sir semicolons, haskell style,
int main() {
int a
; for (a = 0; a < 10; a++) {
printf("%d\n", a)
;}
return 0
;}

@sir You should have marked this NSFW. My boss could have seen me looking at this smut! ;p

@sir you've done it
you've solved the indent war
world peace will be upon us if you can solve the editor war as well
@sir this actually looks really cool, i might have to learn it
@sir i know, i've been meaning to for a while now lol
Sign in to participate in the conversation
Mastodon

cmpwn.com is a private Mastodon instance for friends of SirCmpwn.