Superfly1611
Regular
Hello all,
I've just been given the task of taking an existing vb.net web application - which works, I should point out - and refactor the codebase into something more maintainable.
Looking at the existing codebase is more like.... stairing into a bowl full of alphabet spaghetti. All in code-behind files, no object-orientation applied and full of inconsistencies.
My question: I'm a C# developer by trade - I have 1 small project of VB.Net to my name which I wrote 5 years ago...
Is there a best practice guideline for syntactically laying out your code?
For example:
All 3 code blocks compile and run - but is one of them better at performing the task? Is one of them widely considered best practice?
I know which one I prefer - but thats more because it reminds me of C# than anything else.
Any feedback would be welcome.
I've just been given the task of taking an existing vb.net web application - which works, I should point out - and refactor the codebase into something more maintainable.
Looking at the existing codebase is more like.... stairing into a bowl full of alphabet spaghetti. All in code-behind files, no object-orientation applied and full of inconsistencies.
My question: I'm a C# developer by trade - I have 1 small project of VB.Net to my name which I wrote 5 years ago...
Is there a best practice guideline for syntactically laying out your code?
For example:
Code:
Protected Overrides Sub CreateChildControls()
Dim repeaterControl As Repeater = FindControl("repeaterControl")
End Sub
Code:
Protected Overrides Sub CreateChildControls()
Dim repeaterControl As Repeater
repeaterControl = FindControl("repeaterControl")
End Sub
Code:
Protected Overrides Sub CreateChildControls()
Dim repeaterControl = FindControl("repeaterControl")
End Sub
All 3 code blocks compile and run - but is one of them better at performing the task? Is one of them widely considered best practice?
I know which one I prefer - but thats more because it reminds me of C# than anything else.
Any feedback would be welcome.