MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/tldsou/x_or_x_thats_the_question/
r/badcode • u/heeryu • Mar 23 '22
27 comments sorted by
56
Not perfect, but yea I mean I’ve seen worse. Sometimes little refactoring on next day helps to clean up stuff like this.
2 u/heeryu Mar 24 '22 This is production code, that's the sad part. 2 u/R3D3-1 Mar 24 '22 Always fun, when there are no testcases though... In the whole project.
2
This is production code, that's the sad part.
Always fun, when there are no testcases though... In the whole project.
16
This one isn’t that bad. Either that or I misunderstood the problem
21 u/[deleted] Mar 24 '22 [removed] — view removed comment 3 u/heeryu Mar 24 '22 No return or breaks 7 u/the_other_Scaevitas Mar 24 '22 Yeah that’s what I was thinking 3 u/Teln0 Apr 03 '22 But if that part contains returns / breaks / continues, if process is still useless because it's then it's just unreachable 2 u/[deleted] Apr 03 '22 [removed] — view removed comment 1 u/Teln0 Apr 03 '22 if process is still useless since there are no labels between it and the censored block. + it looks like python so it doesn't really make sense anyway 1 u/Tordek Apr 17 '22 There are no "break outside the if".
21
[removed] — view removed comment
3 u/heeryu Mar 24 '22 No return or breaks 7 u/the_other_Scaevitas Mar 24 '22 Yeah that’s what I was thinking 3 u/Teln0 Apr 03 '22 But if that part contains returns / breaks / continues, if process is still useless because it's then it's just unreachable 2 u/[deleted] Apr 03 '22 [removed] — view removed comment 1 u/Teln0 Apr 03 '22 if process is still useless since there are no labels between it and the censored block. + it looks like python so it doesn't really make sense anyway 1 u/Tordek Apr 17 '22 There are no "break outside the if".
3
No return or breaks
7
Yeah that’s what I was thinking
But if that part contains returns / breaks / continues, if process is still useless because it's then it's just unreachable
2 u/[deleted] Apr 03 '22 [removed] — view removed comment 1 u/Teln0 Apr 03 '22 if process is still useless since there are no labels between it and the censored block. + it looks like python so it doesn't really make sense anyway
1 u/Teln0 Apr 03 '22 if process is still useless since there are no labels between it and the censored block. + it looks like python so it doesn't really make sense anyway
1
if process is still useless since there are no labels between it and the censored block. + it looks like python so it doesn't really make sense anyway
There are no "break outside the if".
4
Might be a break statement in there.
1 u/heeryu Mar 24 '22 edited Mar 24 '22 No break, no return. Just plain nested ifs.
No break, no return. Just plain nested ifs.
No return or breaks in the occulted code. Just plain nested ifs.
15
b || !b
15 u/BigusG33kus Mar 24 '22 bb || !bb 0 u/frostyfauch Mar 24 '22 this is such an underrated joke lmfaooo"to be or not to be....that is the question" 3 u/katatoxxic Mar 24 '22 edited Mar 24 '22 int question = (2 * 'b') | ~(2 * 'b');// question == -1
bb || !bb
0 u/frostyfauch Mar 24 '22 this is such an underrated joke lmfaooo"to be or not to be....that is the question"
0
this is such an underrated joke lmfaooo"to be or not to be....that is the question"
int question = (2 * 'b') | ~(2 * 'b');
// question == -1
What is that editor?
2 u/heeryu Mar 24 '22 Vim + coc
Vim + coc
What editor are you using?
3 u/heeryu Mar 24 '22 Vim + coc
Why is the letter p in the first if statement not highlighted?! Is that even a ASCII letter?
2 u/heeryu Mar 24 '22 Cursor is above p
Cursor is above p
Wouldn't setting it right before make the first if statement never execute?
This is why you type your variables in python
i dont know for sure but there might be some mistakes.
56
u/kksnicoh Mar 23 '22
Not perfect, but yea I mean I’ve seen worse. Sometimes little refactoring on next day helps to clean up stuff like this.
16
u/the_other_Scaevitas Mar 24 '22
This one isn’t that bad. Either that or I misunderstood the problem
4
u/umop_aplsdn Mar 24 '22
Might be a break statement in there.
2
u/heeryu Mar 24 '22
No return or breaks in the occulted code. Just plain nested ifs.
15
u/mr_flameyflame Mar 24 '22
b || !b1
u/HorseWizard31 Mar 24 '22
What is that editor?
1
u/_-Phage-_ Mar 24 '22
What editor are you using?
1
u/Dominio12 Mar 24 '22
Why is the letter p in the first if statement not highlighted?! Is that even a ASCII letter?
1
u/Furry_69 Mar 24 '22
Wouldn't setting it right before make the first if statement never execute?
1
u/Johanno1 Mar 24 '22
This is why you type your variables in python
0
u/Thecodingboy13 Mar 23 '22
i dont know for sure but there might be some mistakes.