Could this copy/paste redundancy prove costly?
-
Recently a contractor(my View about Contractors - are supposed to good programmers!) worked in our project. Code written in C#-VS2005 He wrote
public void RegisterEvents() { obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); /// few more handlers }
My question: Would registering the same event twice call the handler twice when event is raised? -rt -
Recently a contractor(my View about Contractors - are supposed to good programmers!) worked in our project. Code written in C#-VS2005 He wrote
public void RegisterEvents() { obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); /// few more handlers }
My question: Would registering the same event twice call the handler twice when event is raised? -rt -
Recently a contractor(my View about Contractors - are supposed to good programmers!) worked in our project. Code written in C#-VS2005 He wrote
public void RegisterEvents() { obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); /// few more handlers }
My question: Would registering the same event twice call the handler twice when event is raised? -rtContractors aren't magic bullets for organisations. Like every other profession, some are good and some are bad. Remember that a lot of people are attracted to contracting for the perceived high remuneration and you can see why there is a lot of chaff among the wheat.
Deja View - the feeling that you've seen this post before.
-
Recently a contractor(my View about Contractors - are supposed to good programmers!) worked in our project. Code written in C#-VS2005 He wrote
public void RegisterEvents() { obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); /// few more handlers }
My question: Would registering the same event twice call the handler twice when event is raised? -rtYeah it should get called twice I find a number of contractors are hackers because they just code to the contract with no thought to maintainability. I'm sure there are some good ones out there, but they are much more immediate result oriented, which can lead to bad code. I've seen it a few times, not to say permanent coders can't be hackers too. Tim
-
Recently a contractor(my View about Contractors - are supposed to good programmers!) worked in our project. Code written in C#-VS2005 He wrote
public void RegisterEvents() { obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); obj.CenterChanged += new CenterChangedEventHandler(OnCenterChanged); /// few more handlers }
My question: Would registering the same event twice call the handler twice when event is raised? -rtYes. But wasn't there a compiler warning or at least a peer code review to stamp out this? :sigh:
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
Yeah it should get called twice I find a number of contractors are hackers because they just code to the contract with no thought to maintainability. I'm sure there are some good ones out there, but they are much more immediate result oriented, which can lead to bad code. I've seen it a few times, not to say permanent coders can't be hackers too. Tim
True. Their sense of commitment to the organization is less since they know they would escape after a while. We need to be careful in getting the proper deliverables from them since our project is billed by them.
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
Contractors aren't magic bullets for organisations. Like every other profession, some are good and some are bad. Remember that a lot of people are attracted to contracting for the perceived high remuneration and you can see why there is a lot of chaff among the wheat.
Deja View - the feeling that you've seen this post before.
I just posted a reply to the other thread in this message, which I guess applies to this too. http://www.codeproject.com/Feature/HallOfShame.asp?msg=2053494#xx2053494xx[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips