Cor Ligthert said:
Jon Skeet [C# MVP]"
It's in the Microsoft.VisualBasic assembly - in other words, an
assembly which is only there to support legacy VB stuff. Put it this
way: if VB didn't use it, do you for one moment think that Mid would
exist? I don't - it's there purely for VB.NET, nothing else (even
though other languages *can* use it). To me, that makes it a legacy
function.
When you make an application which is named "Jon".
And you have a main namespace that you call System.Jon
And a namespace Superior.ForMe
And you use them both those namespace in your application "Jon".
Is than the Superior namespace a part of "Jon" or is it only the System
namespace?
Eh? Sorry, I really don't see what you're getting at. (Of course,
creating my own namespace within System would be a very, very bad idea
to start with, IMO.)
Why if you want you can as I showed in my sample use the
Superior.Namespace
or any other namespace that fits you. Otherwise there was no reason to
call
that standard one the "System.Net" one. That name could be ommited.
I don't see where MSDN comes into your analogy at all. Any namespace
which should be considered as being good practice to be used by all
languages should be visible when I look at MSDN using the Visual C# (or
any other) filter, shouldn't it?
You are right, however I use seldom the Microsoft.VisualBasic namespace
(only for the convert). Which does not mean that other people find a lot
of
methods from it superior above the standard System.Net namespace.
That doesn't mean it's good practice to use them though. If they were
considered important enough to be in the .NET framework "proper", they
wouldn't be in a namespace which specifically refers to VB, would they?
For my you would not have to be ashamed of your preference. However, I
see
in your messages seldom a sentence like "In my opinion" when you are
talking
about something that is not in that preference. It is than stated as if
it
are facts. By instance this legacy, that is in my opinon not an Official
Microsoft statement.
I couldn't possibly make an official Microsoft statement. However, I
think it's not unreasonable to infer from the fact that MS chose to
include things like Mid and StrReverse in a namespace specifically
named after VB that they had VB users in mind, not C# users.
Do *you* always write "in my opinion" when you're doing something other
than stating absolute fact, by the way? I doubt it. Do you want me to
find examples where you've stated an opinion without specifically
labelling it as such? If you want me to label every single opinion as
being an opinion, you should do the same yourself.
As I have often said before, I never use the Mid or those commands,
because
I do not use commands which have a One as starting indexer. However as
far
as I know are only C derived languages using the "substring", so that
obvious it is not that everybody understand that.
Um, substring isn't a C function in the first place, so it can't be a
legacy C function.
However, the terminology "substring" to mean a part of a string is very
common in computer science, outside C/C++ languages. Try searching for
substring and various other languages (eg Perl, Ruby, Smalltalk,
Python) and you'll find plenty of descriptions which include the word
for precisely that reason. I don't think you'll find many using "Mid"
in the description...
Using String.Substring is the standard, idiomatic way of taking part of
a string. It's not a legacy function at all. Now, do you have any
actual examples of "legacy C methods"?