Post Aztsf1QZktIiSDC7KS by VileLasagna@mastodon.gamedev.place
(DIR) More posts by VileLasagna@mastodon.gamedev.place
(DIR) Post #Aztr1COVSjZUvefp8i by eniko@mastodon.gamedev.place
2025-11-04T11:01:26Z
0 likes, 1 repeats
i have a personal coding rule that the if branch is the exceptional case and the else branch is the common pathis this weird? (y)es/(n)o/(c)ancel
(DIR) Post #Aztsf1QZktIiSDC7KS by VileLasagna@mastodon.gamedev.place
2025-11-04T11:12:05Z
1 likes, 0 repeats
@eniko This is pretty handy especially for basic error checking:```if (bad) return -1;<implicit else from here onwards anyway>```So it's way less weird than it sounds
(DIR) Post #Aztsf2eRCpz2FUghZg by m0xEE@nosh0b10.m0xee.net
2025-11-04T11:17:57Z
0 likes, 0 repeats
@VileLasagna@mastodon.gamedev.place @eniko@mastodon.gamedev.place+1It's the most proper place to do return, throw an exception or terminate the whole program if data passed to you is thoroughly insane — this way the "else" branch would have no indentation, which is easier to read.
(DIR) Post #AzttFpm62kRL1moWh6 by Zergling_man@sacred.harpy.faith
2025-11-04T11:28:36.827967Z
0 likes, 0 repeats
@m0xEE @eniko @VileLasagna import thisflat is better than nested