Technical support This forum is closed.
Version 1.x > Technical support > TWEAK: Remove Microsoft.VisualBasic dependency View modes: 
User avatar
Member
Member
wtijsma - 12/28/2004 9:59:43 AM
   
TWEAK: Remove Microsoft.VisualBasic dependency
I know this is nothing I should be worried about,
but I would like to remove Microsoft.VisualBasic dependency...

things like this:

if (SortField == null || Strings.Trim(SortField + "") + "" == "")

could easily replaced by this:

(SortField == null || SortField.Trim() == string.Empty)

generally, always try to use 'OrElse' and 'AndAlso' (if I remember correctly, I don't do VB) because it wil prevent the next statement from being executed (so in this case the SortField.Trim() will never be executed if SortField is null)

Please try to use the .NET constants: Environment.Newline instead of "\n" and Constants.vbCrLf , string.Empty instead of "" for better readability and compatibility.

Again, I would really prefer some shared CVS, because I'm fixing all these things if I encounter them, but if I do that, the next version will just override my changes.

User avatar
Guest
admin - 12/28/2004 3:25:57 PM
   
Re: TWEAK: Remove Microsoft.VisualBasic dependency
Hi Wiebe,

We will try to avoid similar nasty code practices in future. We plan to make a code review after version 1.6 during which we will improve existing code and remove similar things.

User avatar
Member
Member
wtijsma - 12/28/2004 3:32:25 PM
   
Re: TWEAK: Remove Microsoft.VisualBasic dependency
Thanks, but don't worry too much about it... just a matter of taste, it doesn't cause any problems...

You know for all the visual basic functions there's a .NET standard alternative (string.Trim(), string.ToLower() string.ToUpper()