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
-
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... -
@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) -
Root825087y😂
Janky as hell and totally wrong, but amusing!
Give that man a fake cigar. He's earned it.
Related Rants
-
Awlex74am "I need to brush my teeth before going to sleep 😵" *goes to bathroom* *washes hands* *goes to bed* ...
-
l0om44100% Real. And it's not even the worst on the site.
-
Codazed11Being 100% serious, I saw a guy in my Computer Programming I class using MS Word to write code that he would c...
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.
rant
wk99
problem solving
good night