Remix.run Logo
l-albertovich 2 days ago

Just for fun I reformatted it minimally in the conservative way I write code that is intended to be easy to read and understand to improve the odds of future contributors (or future me) introducing a bug in it due to misunderstanding it.

It's painfully verbose but I think it's worth it considering that we're in 2025 and we're not limited to one character variable names.

https://gist.github.com/leonardo-albertovich/984fff0825ff8fe...

teo_zero 2 days ago | parent [-]

Sorry but you didn't just reformatted it, you added new variables and return statements that were not in the original code (and even introduced bugs like row 41).

As of short variable names, I'd argue that they are actually more readable than long ones when they're the iterator of a loop:

  while... XNextEvent(... &e)
What else can "e" stand for in the body of this loop?

Longer lifetimes and not-as-obvious scopes do deserve longer names.

Finally, I strongly dislike this kind of reversed conditions:

  if (const == var)
To paraphrase your own words, we're in 2025 and we should not be limited by our fear of forgetting one "=".
l-albertovich 2 days ago | parent [-]

Oh no, I accidentally duplicated a function call while quickly rewriting the code for fun, what a terrible sin! (as a side note, I didn't even compile the code but I after quick check I don't see any notes on the man page that suggest that the accidental spurious repeated call could cause a problem)

I understand that you might not like that style but I think you're comming a bit too strong on this, especially considering how carefully I worded my message in terms of not hurting any feeling and being clear about this being MY preference.

I guess I shouldn't probably even answer but it saddens me and makes me a bit angry to get a reminder of why I don't usually participate in social media.

teo_zero 2 days ago | parent [-]

It was not my intention to make you sad or angry. I assure you that I have nothing against who uses a different coding style than mine. But consider that, just like you, I too have the right to tell the world what my preference is. Should I have softened my post with more "IMHO", "I feel", "my taste"? Probably, and I apologize.

Please don't stop participating in social media just because a halfwit like me hasn't agree with you once!

l-albertovich 2 days ago | parent [-]

You know it's not about the disagreement, it's about that toxic need to be a smart-ass that's so prevalent in social media (including this platform).

I would've loved to engage in a conversation about coding styles such as MISRA, CERTs or even the small tweaks such as the one that offended you so deeply but you wasted the opportunity to engage in a constructive convesartion and instead chose to nitpick the "reformatting" thing (seriously, I just moved things around slightly, it's the same thing) or the nothing-burger "bug"...

I don't know, maybe I misinterpreted you and if that's the case then I apologize but when I saw that code and felt the urge to play/doodle I thought it could be a fun way to connect with someone over something silly and I just got disappointed.