Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681387yOh god no.
String.split(“”).reverse().join(“”);
How is that hard to know verses a shitty unusable function? -
jmclemo66807yI don't see how that's a problem with CodeAcademy. They can't exactly be expected to check the actual implementation of a program.
-
C0D4681387y@jmclemo6
Why not?
They are one of the goto locations for nooblets these days so I should expect them to actually teach / show valid examples. -
jmclemo66807y@C0D4 how would you recommend checking an actual implementation without viewing it yourself? Yes, the example you posted would certainly pass the check, but someone who wrote that would be hard pressed to do other operations involving strings or arrays which is a roadblock they would quickly run into. Most likely they would then go to the forums on CodeAcademy and promptly realize what they misunderstood about the exercise. The point is that the coding exercises aren't the entirety of CodeAcademy's program. The forums / lessons are the actual "meat" of the program. Someone who has read those would realize that a solution like that isn't what was being asked for and would hopefully learn from that.
-
C0D4681387y@jmclemo6
How would they learn that is not correct when they are clearly being told it’s correct?
Yes they should go learn how to do it properly or in a more appropriate manner but if the tools they are using tells them that doing it in a stupidly bad way is correct why would they think to go look elsewhere?
As for checking the implementation, I would expect unit tests sitting behind this to validate the answers supplied. -
This is often countered by using hidden requirements. FreeCodeCamp has implemented these hidden requirements, which makes me believe they were edited out of this photo as they would have failed. I understand your point though.
-
rjedlin4517yThis is just a repost from /r/programmerhumor. The original title was just something like, "Hey, if it works, it works"
-
I don't see a problem; my reverseString functions are just 1 big switch statement with all the possible things you could reverse
-
okkimus19697yIs it the learning platforms fault if user missuses it? I bet the correct building blocks for the exercise were introduced before.
Though hidden tests would validate that function better. Just implementing a few more string tests which aren't shown to user would do the trick. -
lucaIO12227yOk but it's quite dumb to write this shit if you have just learned how to do it correctly
-
eastuger1197yThis is actually correct thinking. When developing in production one will often take shortcuts to produce working code, we've all done it.
And if those are the only requirements of the system, then why not. Just accept the K.I.S.S -
Prutser2227yWell... to be honest: the requirements are followed to the letter. They didn't specify that it should be possible to reverse a unspecified random input-string.
-
@Prutser That is exactly what I wanted to say, too. :)
He has only followed the spec. Maybe the function has the wrong name or the requirements engineer did an awful job but the developer implemented it perfectly. It is the easiest solution to fulfill the requirements. -
mundo0349797y@C0D4 cheating is always an option, it is really up to you to want to learn or to be a self-lying piece of shit.
-
@jmclemo6 you write one that works and test user results against its results. if it was me creating this dumbass exercise I'd write my own function generate random strings and compare results. whoever made this is a tard
-
@Prutser even tho they "followed requirements" that's still a dumbass code. what if the requirements had 64 words instead of 3 you'd write all 64 conditions
-
@filthyranter they dont even have to be randomized. When I learned Haskell at university, we had a set of public and a set of secret test cases. I think it was quite some fun getting that last hidden test case to work..
-
Prutser2227y@linuxxxxxx I'm not saying that it is the most elegant or most perfect solution to the given problem, but it is not wrong when looking at the (shown) requirements.
I hope that the person who constructed this would think of a better solution if the problem consisted of reversing 64 strings.
Edit: to be clear: i would not write the given code, cuz i think it is awful. I am just looking at it and comparing it to the (shown) requirements. -
awnumar2937y@JonnyCodewalker
1) The instructions were perfectly clear. Only an idiot or someone intentionally messing about could fuck that up.
2) How do you know that? From a cropped screenshot?
This is why places like CodeAcademy are terrible
rant