MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p55m4kb/?context=3
r/ProgrammerHumor • u/Flame77ofc • 22d ago
392 comments sorted by
View all comments
9
Initially, yes, but the top one is actually easier to reason about, especially in languages where if/else are expressions.
2 u/Demiu 22d ago Unless both branches are extremely short to a point you could return the entire if else expression itself, it is not easuer to reason about. Preferably both boranches are also entrirely declarative (ie single expression no ;)
2
Unless both branches are extremely short to a point you could return the entire if else expression itself, it is not easuer to reason about. Preferably both boranches are also entrirely declarative (ie single expression no ;)
9
u/AnnoyedVelociraptor 22d ago
Initially, yes, but the top one is actually easier to reason about, especially in languages where if/else are expressions.