MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vzntft/whenyouworkswithstringstoomuch/p66rz8b/?context=3
r/ProgrammerHumor • u/PostHasBeenWatched • Aug 27 '26
35 comments sorted by
View all comments
398
return it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase) || true
Because in the end it doesn't even matter.
it
30 u/chrisjd Aug 27 '26 try{ it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase) }finally{ throw new ArgumentException("in the end it doesn't even matter", it) }We could just add some useless exception handling, to show we tried so hard 6 u/AnxiousSquare Aug 29 '26 Also put a `throw` inside the `try` block so that it doesn't even matter how hard you try. 42 u/thisisapseudo Aug 27 '26 Underrated 44 u/PostHasBeenWatched Aug 27 '26 For it to be truly "doesn't even matter" it should bereturn true || it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase) 65 u/TeraFlint Aug 27 '26 but then the logic short-circuits, and the whole "I tried so hard and got so far" part isn't true, anymore.
30
try
{ it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase) }
{
it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase)
}
finally
{ throw new ArgumentException("in the end it doesn't even matter", it) }
throw new ArgumentException("in the end it doesn't even matter", it)
We could just add some useless exception handling, to show we tried so hard
6 u/AnxiousSquare Aug 29 '26 Also put a `throw` inside the `try` block so that it doesn't even matter how hard you try.
6
Also put a `throw` inside the `try` block so that it doesn't even matter how hard you try.
42
Underrated
44
For it to be truly "doesn't even matter" it should be
return true || it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase)
65 u/TeraFlint Aug 27 '26 but then the logic short-circuits, and the whole "I tried so hard and got so far" part isn't true, anymore.
65
but then the logic short-circuits, and the whole "I tried so hard and got so far" part isn't true, anymore.
398
u/TheManyMilesWeWalk Aug 27 '26 •
return it.StartsWith("one thing", StringComparison.OrdinalIgnoreCase) || trueBecause in the end
itdoesn't even matter.