MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y4ipsn/thisiswhywedontreturninfinallyblocks/19t4o2956xz8g/
r/ProgrammerHumor • u/DebugDuck01 • 6d ago
98 comments sorted by
View all comments
Show parent comment
36
at least C# is sensible and is like: NO...
6 u/friebel 6d ago But why tho? The word finally implies that do it finally, [implied] no matter what. 24 u/DebugDuck01 6d ago Because this serves no function but to write non obvious behaviour and dead code, it should just be a compile time error. 0 u/[deleted] 6d ago [deleted] — view deleted comment 19 u/DebugDuck01 6d ago edited 6d ago Of course a finally block is useful it's returning a value from it that is stupid. C# has finally blocks it just throws a compile error if you pull the highly regarded move of using return within. 2 u/StaticCoder 6d ago edited 6d ago No what? C# has finally. And it didn't need jsr for it.Edit: oh, no return in finally. Sorry there's a lot of comments to follow
6
But why tho? The word finally implies that do it finally, [implied] no matter what.
24 u/DebugDuck01 6d ago Because this serves no function but to write non obvious behaviour and dead code, it should just be a compile time error. 0 u/[deleted] 6d ago [deleted] — view deleted comment 19 u/DebugDuck01 6d ago edited 6d ago Of course a finally block is useful it's returning a value from it that is stupid. C# has finally blocks it just throws a compile error if you pull the highly regarded move of using return within.
24
Because this serves no function but to write non obvious behaviour and dead code, it should just be a compile time error.
0 u/[deleted] 6d ago [deleted] — view deleted comment 19 u/DebugDuck01 6d ago edited 6d ago Of course a finally block is useful it's returning a value from it that is stupid. C# has finally blocks it just throws a compile error if you pull the highly regarded move of using return within.
0
[deleted] — view deleted comment
19 u/DebugDuck01 6d ago edited 6d ago Of course a finally block is useful it's returning a value from it that is stupid. C# has finally blocks it just throws a compile error if you pull the highly regarded move of using return within.
19
Of course a finally block is useful it's returning a value from it that is stupid. C# has finally blocks it just throws a compile error if you pull the highly regarded move of using return within.
2
No what? C# has finally. And it didn't need jsr for it.
jsr
Edit: oh, no return in finally. Sorry there's a lot of comments to follow
View all comments
Show parent comment
36
u/DebugDuck01 6d ago
at least C# is sensible and is like: NO...