When writing vb.net classes, I'm told that the only "things" that should be accessed by "the public" are properties and methods.
ie there shouldn't be any
Public Sub MySub()
declarations in a class. There might be private sub's within a VB class but the theory explained to me is that any public method should return a success/fail flag indicating that only public functions should be used (along with property set/get).
Is this best practice?
Do ppl use Public Subs? Is that considered bad form?
Is it better form for every method to be in the form of a public sub with parameters (including error codes). If a sub needs to return anything, it does so via parameter or by setting a property that can be read after calling the actioning sub? If that were so, then Public Functions wouldn't be needed within a class?
![]()
I bet someone will say "depends on the problem".
![]()




Reply With Quote