|
-
May 31st, 2007, 05:10 AM
#8
Re: [2005] BYVAL v BYREF
 Originally Posted by robertx
I know what your answer will be - why leave any opportunity for ByRef to cause an issue with a variable that was inadvertently and incorrectly changed.
Exactly. There are two schools of thought:
1. Leave everything open by default and only close what specifically needs to be closed.
2. Leave everything closed by default and only open what specifically needs to be opened.
Both can be used without any issues in any specific case, but overall the second option will lead to fewer issues. VB has always had a reputation as being a fairly lax language and this is just one example of why. The thinking has been that you make everything open by default and then the dunces will hit fewer roadblocks and be more inclined to keep using the langauge. That attitude has also let the dunces drive off more cliffs as a result. The C/C++ fraternity's attitude has long been that the dunces shouldn't be coding anyway. Note that I'm not saying that VB6 coders are dunces. I'm saying that VB6 made it easier for a dunce to be a coder. VB.NET does so too, although it has tightened up in comparison to VB6. Again, the switch to a default of ByVal rather than ByRef is an example of this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|