71

So embarrassed to see my code way back from my internship period 🙈🙈🙈🙈

Comments
  • 16
    @Alice Because of the lack of spaces? Claustrophobic bracketing, could that be a thing?
  • 8
    Meh, there's worse. If you want to feel better Google "hadouken code"
  • 4
    I see a lot of "my code use to suck" posts, is that visually speaking, functionality, optimisation or all? I'm relatively newbie and to me a working code = good code. (I know about some of the conventions of good code writing, that's why I am curious of the reasoning of most posts).
  • 1
    @securiter I'm fairly new myself so I can only say so much, but I think it's a bit of all of the above. The readability is important, but also being able to cut down on unnecessary code, D.R.Y. (Don't Repeat Yourself)

    The more code there is, the more data there is for the computer to go through, and the slower the program is going to be. For small programs it doesn't matter as much, but when you get to the big projects it can make a world of difference.
  • 2
    @Navigatr also apart from explicitly repeating yourself, having good (concise) conditions that encapsulate the majority of the scenarios you might encounter eliminates the need for excessive/redundant handling (like it seems in your code). It all goes back to readability as you mentioned.

    Although sometimes, readability can be forsaken for performance. But it’s rarely ever the case that these two are mutually exclusive.

    Also, please refactor this if you still have access to it. I saw up to 3 semi-colons on the same line. Please give them each their line. 😭
  • 1
    I have seen much worse yr than this
  • 3
    @Navigatr Focus on readability unless you actually know that you can make the program run faster. The code is optimized at compile time anyway if a good language is used.
  • 1
    So the company you did intern didn't use any sort of prettier, beautify, eslint, jslint at all?😨 Interesting
  • 2
    @sunfishcc it was 5 years ago. The company was in its initial phase 😅
  • 2
    I've been working at the same place for 20 years. When I see some of my early code I just wanna laugh at myself until it hurts.
  • 2
    @kinginthenorth cool. I don't think I can code 5 years ago. Was focusing on making pizzas in domino's 🍕
  • 2
    Rainbowy! ❤💛💚💙💜
  • 0
    Anyone want to post a better way to this?

    Asking for a friend...
Add Comment