62
Japhy
6y

This is why places like CodeAcademy are terrible

Comments
  • 17
    Oh god no.

    String.split(“”).reverse().join(“”);

    How is that hard to know verses a shitty unusable function?
  • 16
    I don't see how that's a problem with CodeAcademy. They can't exactly be expected to check the actual implementation of a program.
  • 9
    @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.
  • 5
    @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.
  • 5
    @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.
  • 6
    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.
  • 2
    This is just a repost from /r/programmerhumor. The original title was just something like, "Hey, if it works, it works"
  • 12
    I don't see a problem; my reverseString functions are just 1 big switch statement with all the possible things you could reverse
  • 6
    Is 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.
  • 3
    @okkimus it is when they’re the one teaching it.
  • 2
    That's a plus for http://codewars.com: Randomized tests.
  • 3
    Except that is Free Code Camp, node Codecademy
  • 1
    Ok but it's quite dumb to write this shit if you have just learned how to do it correctly
  • 2
    This 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
  • 3
    Well... 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.
  • 2
    @Prutser yes it does, it was cropped
  • 2
    @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.
  • 3
    @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.
  • 2
    @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
  • 1
    @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
  • 1
    @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..
  • 1
    @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.
  • 1
    Not sure how this is CodeAcademy's fault. If someone's shit then they're shit.
  • 1
    @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?
  • 1
    @JonnyCodewalker

    > cropped
  • 1
    @C0D4 that one liner has terrible space/time efficiency
Add Comment