13
BlueSky
5y

I am currently refactoring some code which exists before my time in this company.
The code was so inefficient before. To put into perspective for every function call it used to loop through some data 100+ times .
I replaced it with a map and voila, no more loops anymore.
The person who wrote this code don't even realise how bad his code was. He sits besides me writing more stupid hacky code for other parts of the app.

Comments
  • 6
    Common, unfortunately. Had a girl on our offshore who was an absolute unit when it came to arriving at algorithms with O(c^n) complexity. I could tell she was really trying hard, but just had 0 algorithms experience.
  • 4
    Had a colleague that did the same.

    Even after 6 years, he never wanted to learn.

    Fortunately the boss finally grew tired and demanded that he started to work with the rest of us to avoid those errors, 2 months later he quit, problem solved.
  • 0
    One of my colleagues once asked me to walk him through a section of code, as he wasn't familiar with the new Java 8 stuff (this was when Java 8 was new, so completely fair enough.)

    The conversation went something like this:

    Bob: So yeah, this is the bit I don't get - is this a new Java 8 collection?
    Almond: What? You mean this lambda function?
    Bob: No, this collection here - a... Map? What is that?

    After a while of back and forth...

    Bob: Hmm, I see, that's quite clever. Bit beyond me though. Think I'll stick to the old fashioned way.
Add Comment