r/cprogramming • u/KattyTheEnby • Feb 21 '26
This subReddit Is NOT for "ALL Things C" - Because The Mods Will Remove Your Post If You Want to Ask for Opinions + Question About Code-Style Preference
So, recently, I made a post in this subReddit because I wanted to ask all ov you all – the amazing C programmers ov Reddit – about your opinions on how procedural-style code should be structured. And I thought asking the C community would be a great thing, since C is a very procedural language…
… however, my post was removed with no explanation other than "Post is off topic", even though my post was trying to be meaningfully engage with the C community about their thoughts on procedural programming, but I was told by the mods than many ov you – fellow communitymembers ov this subReddit – reported my post as being off-topic, probably for no other reason than to take my question down.
I wanted to make this post to shed some light on the poor moderation from u/zhivago and/or u/Willsxyz, whichever ov them specifically is behind agreeing with the people whining about my post.
Now, this is what I wanted to ask about the whole time: for procedural-style programming, is it preferred to avoid hidden state mutations by, for example, returning signals and handling state directly with that signal, rather than handling state in (the) abstractions – or by some other means?
For example, consider this game ov hangman written in C:
void main() {
// ...
while(true) {
writeMenu(&game, &stdoutWriter);
// ...
processNextLine(&game, &stdinReader);
}
}
typedef struct Game {/* ... */} Game;
void processNextLine(Game* game, Reader* inputReader) {
int bytes_read = readUntil(inputReader, &game->commandBuffer, '\n');
// ...
if(!game->started) {
// ...
switch(cmd) {/* ... */}
}
// ...
}vs. the same program structured like this:
void main() {
// ...
while(true) {
writeMenu(&game, &stdoutWriter);
// ...
Signal sig = processNextLine(&game, &stdinReader);
switch(sig.type) {/* ... */}
}
}
typedef struct Game {/* ... */} Game;
Signal processNextLine(const Game* game, Reader* inputReader) {
int bytes_read = readUntil(inputReader, &self->commandBuffer, '\n');
// ...
if(!game->started) {
return GameSignal { try_command: text };
}
// ...
return GameSignal { try_to_reveal: char };
}
typedef union SignalPayload {/* ... */} SignalPayload;
typedef enum SignalType {/* ... */} SignalType;
typedef struct Signal {
SignalType type;
SignalPayload payload;
} Signal;Please let me know what your thoughts are.
This post, in my opinion, is pretty on-topic to the C programming language, and thus this subReddit as a whole, so I should not see this post taken down (for that reason), or hear about anything reporting this post.
I can't wait to hear the good opinions ov the nice, C-programming people.
Cheers!
4
u/Willsxyz Feb 21 '26
Tell me OP, what's the point of all this Signal nonsense apart from needless complexity?
10
u/EpochVanquisher Feb 21 '26
I thought your original post was off-topic, and the mods made the right decision by removing it. I understand why you are complaining, but I wanted your post removed, and so did other people.
The posts should be more related to C. It was just not enough related to C.
You could have thought, “oh, I understand why people wanted this post removed,” but you are instead fighting it.
3
u/Key_River7180 Feb 21 '26
Based on the comments, post on a sub with relaxed rules.
3
u/GamerEsch Feb 21 '26
Your post gets deleted, but spammers get away with 3 or 4 posts about their A.I. generated shit code. The mods should get their priority straight.
13
u/johntrytle Feb 21 '26
Just post in another sub dude it's not that serious
1
u/Poddster Feb 21 '26
I'd have allowed it. We used to allow it, back in the olden days
Frankly there's not a lot to places left for this kind of thing. That's a shame, especially with AI chomping at junior developers feet.
Try /r/learnprogramming, /r/codereview or post on stack overflow or code review stack exchange?
1
u/Fast-Form-7770 Feb 23 '26
I get your frustration, a lot of subreddits have terrible moderators, but I will say that this one isn't as strict as the other ones tbh, maybe you caught one having a bad day or something.