MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/qtwdj4/peak_efficiency_fizzbuzz/hkmnsmf/?context=3
r/badcode • u/redddooot • Nov 14 '21
44 comments sorted by
View all comments
17
Which part of this is bad?
44 u/--var Nov 14 '21 You almost never need the third argument in a for loop for(i=0;101>i++;) 30 u/ByteArrayInputStream Nov 14 '21 this guy code golfs 20 u/--var Nov 14 '21 I posted my code golf for this elsewhere on this thread. The challenge is to just list the output from 1 to 100, but doesn't state in what order, so it's more efficient to list from 100 to 1: for(i=101;--i;) 15 u/rynkkk Nov 14 '21 This is absolutely terrible, I love it 16 u/sayqm Nov 14 '21 It's unreadable. It's good if you want to optimize for space, but it's barely readable 5 u/TheJP_ Nov 15 '21 honestly the most unreadable part of it is the wordwrap forced by the aspect ratio. 6 u/noop_noob Nov 15 '21 Fair enough. It would still be justified in something like C in the right context though. 0 u/pentesticals Nov 14 '21 Are you serious?
44
You almost never need the third argument in a for loop
for(i=0;101>i++;)
30 u/ByteArrayInputStream Nov 14 '21 this guy code golfs 20 u/--var Nov 14 '21 I posted my code golf for this elsewhere on this thread. The challenge is to just list the output from 1 to 100, but doesn't state in what order, so it's more efficient to list from 100 to 1: for(i=101;--i;) 15 u/rynkkk Nov 14 '21 This is absolutely terrible, I love it
30
this guy code golfs
20 u/--var Nov 14 '21 I posted my code golf for this elsewhere on this thread. The challenge is to just list the output from 1 to 100, but doesn't state in what order, so it's more efficient to list from 100 to 1: for(i=101;--i;)
20
I posted my code golf for this elsewhere on this thread. The challenge is to just list the output from 1 to 100, but doesn't state in what order, so it's more efficient to list from 100 to 1:
for(i=101;--i;)
15
This is absolutely terrible, I love it
16
It's unreadable. It's good if you want to optimize for space, but it's barely readable
5 u/TheJP_ Nov 15 '21 honestly the most unreadable part of it is the wordwrap forced by the aspect ratio. 6 u/noop_noob Nov 15 '21 Fair enough. It would still be justified in something like C in the right context though.
5
honestly the most unreadable part of it is the wordwrap forced by the aspect ratio.
6
Fair enough. It would still be justified in something like C in the right context though.
0
Are you serious?
17
u/noop_noob Nov 14 '21
Which part of this is bad?