45

Actually just 2 hours ago my boss showed me his "hack" which solved a problem he worked on half of the day.
My eyes suddenly began to itch heavily and I felt a strong urge to quit immediately.

The problem was no big thing and we actually spoke about it at noon and I made a proposition how he could solve it.
Turns out he .... aaaaaahhhh I better do not mention it, as it may summon evil spirits... sorry.

Comments
  • 21
    Oh c'mon! You can't build it up like that and not share it!
  • 1
    haha you got me there...
  • 18
    Okay for the sake of beloved Samael:

    Turns out he used a private counter variable to find out in an event handler function, if the event was fired artificially (in JS, dispatchEvent) by a parent component (Angular) or on mouseover/mouseleave by the hostelement.
    Basically there is a parent component (rectangle shaped) containing the child component (just a round round icon).
    When the user hovers either of both, the icon goes to its hover state.
    The same event handler is called either by dispatchEvent from the parent, or from the event on icon component itself.
    To distinguish between a parent-triggered event and the host-triggered event, he thought that it is a great idea to increase the (mouseover)counter by 1 in either case. If counter % 2 === 1, then it must have been triggered by the parent component, because the mouse "always" has to go first over the parent's rectangle before reaching the icon (which is obviously not in all cases true, e.g.: window switching etc.).

    That is the kind of code I sometimes have to deal with, after my boss "worked" on something.

    Don't get me wrong, I really love to work there and ge is a great boss, but the ocasional fucked up ideas I see turned into "code" can be seriously brain damaging...
  • 5
    @PonySlaystation i feel you, because i had the same type of boss. He's a good programmer sometimes, but sometimes he produces some horrible hacks.
    One time the applications license had to be decrypted before you can decrypt the license. (I take partial blamae for this)
  • 3
    😂
    Janky as hell and totally wrong, but amusing!
    Give that man a fake cigar. He's earned it.
Add Comment