r/badcode • u/10199 • Jan 23 '20
c# Junior dev on first week delivered this
https://gist.github.com/fjod/2f5bca02fd9e3ca5acad7beadc8c6b7337
u/TouchyUnclePhil Jan 23 '20
learning programming is hard and at least in my case its nothing short of a miracle im employeed after the god awful quality of teaching I had at uni, cut the poor kid some slack and help him figure out how much of a mess this is. Shaming a newbie on reddit isnt doing anyone any favours other than demoralising him if he found out.
31
u/katafrakt Jan 23 '20
Surely finding this on reddit in few hours will help him with his career and self confidence...
3
u/fynn34 Jan 24 '20
This is the reason for my downvote, I’m hoping to keep it off the poor dev’s reddit and hopefully keep from giving him a complex for the rest of his career.
16
8
Jan 23 '20
This still shows a high order of understanding of programming, it just missed a mark. It shows an understanding of (or at the very least an ability to use): Arrays, indices, iteration, offsets, and object orientation... in 3 lines. Is this the best way to solve the problem? Well, no, any experienced programmer can tell you that, but what I see here is a strong ability to program with a lot of potential, minus the experience.
3
2
u/totallysafefork Jan 23 '20
But... why?!
First the array of numbers from 1 to 6 inclusive, then initializing the iterator to 1 while ALSO making the set exclusive of the written upper bound. You could also include the definition of ret in the loop initializer... there’s so much wrong with this I can’t start.
9
u/SinisterMinister42 Jan 23 '20
I think we all went through that point of programming where we write some code, it doesn't work, write some more code, still doesn't work, and then we keep making changes that we don't even understand until we get the results we want. This code here looks like the result of that style of programming. It's not what a professional, paid programmer should be doing but I think we've all been there at one point.
7
Jan 23 '20
Those who say they haven't either are here for the memes or have never programmed themselves. Alternatively they're, you know, very self absorbed.
2
u/Taksin77 Jan 23 '20
I get the issue with the index but could someone be kind enough to explain in details. Pretty please. Not a c# programmer here.
1
3
1
1
59
u/Kortike Jan 23 '20
Sooo are you going to go over it with them or just post it on Reddit for karma?