MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/msv49l/when_your_teammate_refactor_your_code/guykj37/?context=3
r/badcode • u/Bence675 • Apr 17 '21
216 comments sorted by
View all comments
298
This is why I like languages with nice pattern matching, as it can often make code like this compact in a nice way. Something along the lines of
match (condition1, condition2) { (true, true) => do_anything1(), (false, _) => do_anything2(), }
1 u/fugogugo Apr 18 '21 what language is this? 1 u/cherryblossom001 Apr 18 '21 Looks like Rust. 1 u/Rigatavr Apr 19 '21 I think this one is actually from python 3.10
1
what language is this?
1 u/cherryblossom001 Apr 18 '21 Looks like Rust. 1 u/Rigatavr Apr 19 '21 I think this one is actually from python 3.10
Looks like Rust.
1 u/Rigatavr Apr 19 '21 I think this one is actually from python 3.10
I think this one is actually from python 3.10
298
u/[deleted] Apr 17 '21
This is why I like languages with nice pattern matching, as it can often make code like this compact in a nice way. Something along the lines of