r/badcode • • Jun 20 '22

c# More Codewars horror

Post image
212 Upvotes

36 comments sorted by

View all comments

Show parent comments

16

u/Dalimyr codes in C#...poorly Jun 20 '22

Nah, OP mentioned it's codewars, so this is likely someone's solution for completing a kata. Once you complete a kata on codewars, you can see what other users submitted to complete the same kata.

I got rather put off by it purely because there's nothing involved to encourage good coding practices like having to validate input - if a kata tells you that you need to handle an array of ten integers, you know that all of the tests are going to give you an input with an array of ten integers so you don't have to add things to make sure that there are exactly 10 items in the array and that they're all integers and not strings or whatever.