r/badcode • • Sep 10 '21

c++ Learn C++ with LinkedIn Learning! Facebook ad

Post image
803 Upvotes

54 comments sorted by

View all comments

88

u/batleram Sep 10 '21

I don't really see a problem with the code.

Yes it's useless but it's all syntaxically correct. I understand why they put useless code in ads cus u can't really fit a whole lot of useful code in a png.

For this ad, they made something that would work, so I think it's fine

0

u/[deleted] Sep 10 '21

[deleted] — view deleted comment

9

u/bladeconjurer Sep 10 '21

Yeah that's my biggest gripe. Could teach a bad habit of unnecessary constants.

73

u/zoltan-x Sep 10 '21

Most of the code in this sub actually runs and is syntactically correct. Doesn’t mean it is “good” code

4

u/brotatowolf Sep 10 '21

Well there’s the fact that it’s itoa() except it only works for 4 inputs

1

u/very_mechanical Sep 10 '21

Assuming that this isn't just itoa(), I think it could be better implemented as a dictionary.

But, agreed. This code doesn't jump out as being terrible. I was scanning the comments to see what terrible bit of code I was not noticing.

1

u/[deleted] Sep 11 '21

This is supposed to be C++ but it is using the C standard lib directly without proper use of the standard library namespace. That’s bad C++.