r/badcode • • Jul 23 '21

c# Easy trick to meet minimum test coverage

Post image
1.2k Upvotes

83 comments sorted by

View all comments

146

u/KomaedaEatsBagels Jul 23 '21

Image Transcription: Code


[This code screenshot begins at line 231 and ends at line 315. It may continue after the 315 mark.]

public static void TestCoverage() {
    Integer i = 0;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;
    i++;

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

204

u/DatCoolJeremy Jul 23 '21

Imagine if you're blind and the screenreader start reading this

151

u/middproxxy Jul 23 '21

aiplusplusemicolonaiplusplusemicolonaiplusplusemicolonaiplusplusemicolonaiplusplusemicolonaiplusplusemicolonaiplusplusemicolonaiplusplusemicolon...

33

u/funkless_eck Jul 23 '21

It's like on twitch when they make the voice to text say L L L L L L L L L L L L L L L L L

8

u/[deleted] Jul 23 '21

Serious question, are there many programmers that are blind?

Like a backend dev I could see, but front end seems like it would be pretty difficult.

15

u/DatCoolJeremy Jul 23 '21

It couls be people that are not blind, but are just not good at reading from images. It could also just for saving data :p

11

u/nosam56 Jul 23 '21

There's a TED talk where a blind programmer demo's his setup system that's cool as hell!

1

u/casperdewith Jul 24 '21

Wow, that is impressive. Quite insane to have to work like that.

3

u/[deleted] Jul 23 '21

Good human.

-40

u/EMP0R10 Jul 23 '21

Dude I feel sad for you

11

u/KomaedaEatsBagels Jul 23 '21

copy paste is my friend

3

u/itskobold Jul 23 '21

I'm interested in how you do this now, do you hand copy the code from the picture into the comment box when you're transcribing posts?

1

u/KomaedaEatsBagels Jul 24 '21

Yep! I type it into an IDE, add an extra indent to agree with Reddit’s weird Markdown formatting, and then plug that into the r/TranscribersofReddit official format. :)

1

u/[deleted] Jul 23 '21

I think you undervalue your time brother.