Tag Info

New answers tagged

2

I have solved this in the past by creating a public module called Globals.vb that contains one or more VB Structure types that logically group variables together. You can then create a single public instance of each structure. For example, an ApplicationState structure variable could have collection-oriented properties for your employees and teams. This ...


0

Convert the hexadecimal number to base 36. Example here. According to that page, Your input yields 1DWCLWKQZK16WMKIIEYVLLXA9E4OQ64P80KDOH4ALCYRCYCTKRUHQRXTM6HLDEV78E6APXQV1JG in base 36. Here is a Stack Overflow question that has an arbitrary base conversion function in c# (alas, couldn't get the online converter to properly convert it to VB). ...


2

Seems as if your main difficulty is that you're using arrays instead of lists. Lists do not have the problem of requiring an initial size; you can grow them or shrink them as needed. I also have the impression that you think you have to store the entire content of the web site in a single data structure. You don't; a relational database like SQL Server ...


-1

And there's virtually no performance penalty... But to clarify, accessing a property is slower than accessing its backing variable. A property's getter and setter are methods that require a Call and a Return, whereas a property's backing variable is accessed directly. That's why, in cases where a property's getter may be accessed many times within a ...


4

It is a subjective issue. On every new project we (myself and some colleagues I know) start, we set warnings to compile errors by default. We end up with a clean code base, easy solution. (Plus, we also enable FxCop, StyleCop issues as errors, very low cost if you do it from the beginning). Every warning has some impact on quality, maintainability, ...


1

There might be some reasons to evaluate both statements when dealing with sideeffects: if you want both to happen! The best example I can come up right now is logging: you have two checks (both have to be true) and want to log both checks and their results (as a sideffect in the check) - in this case VB's AND is a good idea.


3

C# doesn't have "And" and "Or". It has "&&" and "||". "AndAlso" and "OrElse" were added to Visual Basic to provide a [new] syntax for "short-circuiting" the evaluation of conditions (which C# has always done, but Basic didn't). There was a lot of "discussion" early on about whether the existing operators should be reworked to support this but, ...


-1

After allowing this question to live online for a while, and also working with peers on research and usage regarding Casting and Converting, the answer has become clear. The question was: Is there any time CType() is the proper option over other methods? The answer is: No. From this point on, never use CType(). The only argument is: "What if you don't ...



Top 50 recent answers are included