Billionaire property developer Christian Candy wins £2m stamp duty refund from HMRC after court battle with taxman over £68m Georgian mansion
Princes William and George are joined by the Duke and Duchess of Westminster to watch Aston Villa's thrilling Champions League battle against PSG - but royal fans go home disappointed after tense battle
The Nazi 'fashion house' where Jews were forced to make clothes for the rich... using fabric looted from murdered Holocaust victims
White Lotus star who complained about 'cruel' British teeth joke is ripped by SNL insiders
CodeSOD: Conventional Events
Now, I would argue that the event-driven lifecycle of ASP .Net WebForms is a bad way to design web applications. And it's telling that the model is basically dead; it seems my take is at best lukewarm, if not downright cold.
Pete inherited code from Bob, and Bob wrote an ASP .Net WebForm many many ages ago, and it's still the company's main application. Bob may not be with the company, but his presence lingers, both in the code he wrote and the fact that he commented frequently with // bob was here
Bob liked to reinvent wheels. Maybe that's why most methods he wrote were at least 500 lines long. He wrote his own localization engine, which doesn't work terribly well. What code he did write, he copy/pasted multiple times.
He was fond of this pattern:
if (SomeMethodReturningBoolean()) { return true; } else { return false; }Now, in a Web Form, you usually attach your events to parts of the page lifecycle by convention. Name a method Page_Load? It gets called when the load event fires. Page_PreRender? Yep- when the pre-render event fires. SomeField_MouseClick? You get it.
Bob didn't, or Bob didn't like coding by naming convention. Which, I'll be frank, I also don't like coding by naming convention, but it was the paradigm Web Forms favored, it's what the documentation assumed, it's what every other developer was going to expect to see.
Still, Bob had his own Bob way of doing it.
In every page he'd write code like this:
this.PreRender += this.RequestPagePreRenderThat line manually registers an event handler, which invokes the method RequestPagePreRender. And while I might object to wiring up events by convention- this is still just a convention. It's not done with any thought at all- every page has this line, even if the RequestPagePreRender method is empty.
Britain's 'bullying' school WhatsApps: How parents gang up on teachers, embarrass children and humiliate parents in cliquey group chats
M11 briefly closed as crash caused hour-long delays
Queen Margrethe is STILL the most popular member of the Danish royal family as she turns 85 - despite stepping down a year ago
TOWIE's Amy Childs shares heartfelt message after her mum is rushed to hospital
Who left Celebrity Big Brother? Trisha Goddard is evicted from the house after sparking race row by accusing Michael Fabricant of 'Islamophobia'
Stomach-churning 'Ozempic feet' is latest bizarre side effect of weight-loss drug... which stars show signs?
X Factor star Danny Dearden dead aged 34: Mel B pays tribute to mentee who passed away after finding fame on ITV show - as his tragic last post is revealed
Inside Katy Perry and Orlando Bloom's difficult talks - and why they decided to finally show daughter Daisy at Blue Origin space flight
Shocking photos show mother's downward drug spiral over two decades: From trying pills and acid for the first time to a £900-a-day heroin addiction
Digital marketing executive dies after running through glass door and severing an arm
The historic area that's great for commuters named the cheapest place to live in Essex
Police storm 'industrial scale' cannabis farm in Halstead with two men arrested
'Step back in time' - Medieval jousting to return to Essex castle this Easter weekend
Harold's final goodbye: Neighbours loses iconic character amid real-life cancer battle - as fans pay tribute to legendary actor Ian Smith
Older People Who Use Smartphones 'Have Lower Rates of Cognitive Decline'
Read more of this story at Slashdot.