I'm looking for coding style opinions.
It looks to me like most VB/VBA coders use the command-style syntax for
calling subs or functions being treated as subs in a particular context ...
Foo "ABC", varDest
Occasionally, I see code using the Call syntax instead.
Call Foo("ABC", varDest)
I used to find that wierd, but now, I'm wondering if it isn't really the
superior style. Basically, I find myself starting to use named parameters
more (whenever it isn't blatantly obvious what the parameters must be by
looking at the call line), and I think Call reads easier in these cases. So,
do be consistent, I'm thinking I might just start using Call in all cases.
Foo Src:="ABC", Dest:=varDest
vs
Call Foo(Src:="ABC", Dest:=varDest)
Your thoughts?
It looks to me like most VB/VBA coders use the command-style syntax for
calling subs or functions being treated as subs in a particular context ...
Foo "ABC", varDest
Occasionally, I see code using the Call syntax instead.
Call Foo("ABC", varDest)
I used to find that wierd, but now, I'm wondering if it isn't really the
superior style. Basically, I find myself starting to use named parameters
more (whenever it isn't blatantly obvious what the parameters must be by
looking at the call line), and I think Call reads easier in these cases. So,
do be consistent, I'm thinking I might just start using Call in all cases.
Foo Src:="ABC", Dest:=varDest
vs
Call Foo(Src:="ABC", Dest:=varDest)
Your thoughts?
Comment