"VB" without Microsoft.VisualBasic...?

P

Phill. W

Is anyone writing VB.Net (2003) code /without/ referencing the
Microsoft.VisualBasic namespace(?), regardless of whether its
Import'ed or not?

The Powers That Be here are trying to introduce a "standard" that
we should be writing our "VB" programs /without/ using this
namespace at all and relying instead solely on CLR functionality.

Comments and Opinions please...

TIA,
Phill W.
 
D

Dick Grier

Hi,

My only comment would be, "Why?"

IMO, one should use whatever namespaces are available that enhance
productivity. Tying a VB programmer's hand behind his/her back is not
likely to meet that goal. One could argue that he still has one hand
available, so... However, I don't type very well -- using only one hand
slows the process even more.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
V

Vijay

Really you can write without VB Namespace, just referencing the CLR i.e the
..NET Framework classes. But you will writing more code and re-writing a lot
of functions, classes defined in the VB Namespace. If you chose that you can
do it.

Vijay
 
F

Fergus Cooney

Hi Phil,

As a programmer who prefers C#, I try writing my VB code without
using old-style VB stuff (ha, it's not <that > old, yet). I like to
use the System namespace.

One advantage of this is that if at any stage I decide to port the
VB to C# it takes less editing.

However, that's purism not pragmatism - fine for your own
projects, not so effective at work. I'll echo Dick's view - If it
works, and you need it, and finding a 'pure' way is going to be
costly, - Use it.

Regards,
Fergus
 
J

Jeremy Cowles

The Powers That Be here are trying to introduce a "standard" that
we should be writing our "VB" programs /without/ using this
namespace at all and relying instead solely on CLR functionality.

Who told you that?
(please post references)



~
Jeremy

"Success is as dangerous as failure.
Hope is as hollow as fear."
-Lao Tzu
 
J

Jay B. Harlow [MVP - Outlook]

Phill,
I minimize my use of Microsoft.VisualBasic, For reason's similar to why
Fergus lists.

Being an OOP programmer, why would I want to rely on a Procedural library?

Why call a function "Format(obj)", when the object has the ability to format
itself "obj.ToString("c")"? Considering that I can add ToString to my
objects, to further the self formatting pattern. I cannot call the VB.Format
function with one of my objects.

A number of the functions return Object, IIf for example, which makes for
all sorts of nasty casting when you use Option Strict On. You are using
Option Strict On! aren't you?

However I don't see a real need to 100% eliminate the assembly, As Vijay
stated, there are useful functions in there that you may wind up
rewriting... Some of the string functions are useful, unfortunately most
have a "off by one" problem when compared the String Methods.
(Microsoft.VisualBasic is largely one based, while the framework is largely
zero based).

Microsoft.VisualBasic.ControlChars are handy constants.

There are certain constructs in Microsoft.VisualBasic that I avoid
(including but not limited to):
Microsoft.VisualBasic.Collection
Microsoft.VisualBasic.FileSystem
Microsoft.VisualBasic.ErrObject
Microsoft.VisualBasic.Interaction
Microsoft.VisualBasic.DateAndTime
Microsoft.VisualBasic.VBMath

As most of them have cleaner more efficient implementations in the Framework
itself.

Microsoft.VisualBasic.Strings is not my first choice, however I will use it
if the Framework makes what I want to do awkward...
The Powers That Be here are trying to introduce a "standard" that
we should be writing our "VB" programs /without/ using this
namespace at all and relying instead solely on CLR functionality.
IMHO rather than say yes or no on the entire assembly, go through Type by
Type and say yes or no. On Types where it has some good & some bad, state
where its appropriate to use the some good in that Type. Even on the ones
that you say don't use, consider stating where it may be appropriate to use
it.

By Type I mean Class, Module, Enum.

Just a thought
Jay

Most of my code I rarely directly use the namespace, VB itself will use it
for some of its constructs.
 
M

me

what a good idea!
perhaps yopur bosses could consider eliminate the use of
the System namespace too, there wouldnt be too much extra
code for you to write!
 
C

Cor

The meaning is something the same as this

However, that's purism not pragmatism - fine for your own
projects, not so effective at work. I'll echo Dick's view - If it
works, and you need it, and finding a 'pure' way is going to be
costly, - Use it.
 
F

Fergus Cooney

Hi Guy,

Very interesting and informative the article is, too. My compass
begins to swing slightly the other way.*

Regards,
Fergus

*Nick, Chris, I know there's plenty of opportunity in that one. Don't
you dare!
 
F

Fergus Cooney

Hi Cor,

Which means that the Gates of Heaven will be here on Earth.

Regards,
Fergus
 
C

Chris Dunaway

Maybe we can in future let the Vatican make the rules for programming
languages.

I don't know, I think programming in Latin would be a real pain!! :)

Chris
 
C

Chris Dunaway

Maybe we get Gates on the Vatican when it becomes vacant

If that happened, then using a Mac or Linix or any OS not from MS would
become a mortal sin!

Would the message be "Use Windows or go to hell?"

:)

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top