I just bumped into some kind of code and got quite a bit of shock:
Code snippet 1:
Class ABC
Private Event Event123()
Private Function ParentMethod()
RaiseEvent Event123()
End function
Private Function ChildMethod() Handles Event123
... code here
End function
End class
(Note the functions and event are private, the code is used within the class only.) (Also, note that the code is in VB, but this pattern can be applied to other languages as well.)
Normally I would just directly call the ChildMethod from the ParentMethod, like below:
Code snippet 2:
Private Function ParentMethod()
ChildMethod()
End function
I'm wondering, is the code snippet 1 some kind of best/recommended practice? Why?