Err, perhaps it would be useful to say WHY it sucks? Otherwise, I have just
wasted 4 seconds of my life reading your message.
"Dave" <da...@nowhere.com> wrote in message
news:3f86c8f6$1...@news.starhub.net.sg...
thats just me though!
"Dave" <da...@nowhere.com> wrote in message
news:3f86c8f6$1...@news.starhub.net.sg...
The syntax in VB.NET helps some, as you have to type in declarations like so
in C#:
SqlConnection conn;
But, you can use fully qualified names:
System.Data.SqlClient.SqlConnection conn;
to get Intellisense. Or an alias:
using System.Data.SqlClient = sql;
VB.NET is easier here, as you type:
Dim conn As SqlConnection
and have a drop down.
Is this what you are talking about?
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
**********************************************************************
Think Outside the Box!
**********************************************************************
"Dave" <da...@nowhere.com> wrote in message
news:3f86c8f6$1...@news.starhub.net.sg...
":\\derian" <der...@someplace.com> wrote in message
news:O0jCLt0j...@tk2msftngp13.phx.gbl...
> i think thats the reason c# developers usually think they are better than
vb
> developers
> at least thats the way it is over here... all the # guys think they have
it
> so tough b/c intelisense doesn't change a word to uppercase
> and blah blah blah... since i'm relatively lazy, i like hitting ctrl +
> spacebar and having my class names typed out...
>
> thats just me though!
FWIW, ctrl + spacebar works just as well in C#. It even corrects the
capitalization, which is quite handy. Actually I consider myself both a VB
programmer and a C# programmer, which leaves me in the odd position of
feeling that I'm better than myself.
Regards,
Dan
ACK. C# sucks. VB.NET rules.
SCNR
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:#ZjVi31j...@TK2MSFTNGP10.phx.gbl...
Personally, all my development is in C#.... I like it :)
--
Tom Shelton
MVP [Visual Basic]
I use VB.NET and C#, but I don't like C#.
:-)
I hope this is a joke.
C# is a Police-trained German Shepherd. Sharp is a good word for it. Its
moves are clean and efficient. Cuddly it ain't - though it's quite beautiful.
You wouldn't have it for the children to play with - not because it's
dangerous (too well trained for that) but it just wouldn't be as much fun as a
Labrador.
I would recommend learning C# with as much fervour as I could muster. So
many of the things that VB obscures become clear when you do them in C#.
Part of this is the fact that a 100 line block of VB can be done in 20
lines of C# - so you can <see it all>. C# and elegance can be as one with each
other. I'd rarely say that with VB.
Regards,
Fergus
Regards,
Dan
"Tom Spink" <thomas...@ntlworld.com> wrote in message
news:OydjfK2j...@TK2MSFTNGP11.phx.gbl...
What functions are faster? Almost all of the VB.NET functions delegate
to actuall .NET functions anyway...
Are you sure?!
I know that (your test program), but I thought you wanted to turn to C# *shock*.
I don't see how they can be faster, since most of them are just wrappers
around the .NET framework classes... But, yes - if you like you can use
them. Just reference Microsoft.VisualBasic.dll, make your appropriate
using statements, and off you go.
I find the word "then" absolute unneccesary in Visual Basic (that is a word
that I always forget to write).
But I realy hate the == and the case sensitive (probably because that
strange document object model, that has the uppercases on the most strange
places).
You must understand that, it has a lot of plusses for me, one of the things
to that C is for what is the code, almost natural language independent. But
because of the framework it is not and has therefore almost no benefits
about that above Visual Basic.
But I love it, if a it is posible to make a program that don't need comment
blocks.
And I think that is better to do with Visual Basic than C#
Therefore I don't understand those people who ask for comments blocks in
Visual Basic,
(You understand than too why I don't like the regular expression).
Cor
I use the system.members, I don't like it that the index of the functions
start at 1.
But I was always arguing with Herfried about them, and thought why not it is
a benefit of a natural language when you can use more words to express
yourself.
Last week there was an arguing in this newsgroup with Jay B. and some others
about the regular expressions, the functions and the system members.
Jay B, said it was too discussed in the C# group but nobody did make a
testprogram, so I did.
With a String the Visual.Basic function Find was twice as fast as the
system.member indexof exactly on the same way used.
The regulair expression was 15 times slower than the indexof.
Only with a character, (that is not in the functions), the indexof was
faster.
I was perplex.
Cor
C++
++
Four "plusses".
ROFL.
Although in Tom's defense I have to say that there's Spock logic (range 0%
to 100%) and there's McCoy logic. The latter can have 'percentages' far in
excess of 100 - calculated, as it is, with emotionally fuzzy logic.
Regards,
Fergus
That's what I thought.
But this character counting loop
Do
iResult = InStr(iStart, strInput, strDelimiter)
If iResult = 0 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
is actually faster than
Do
iResult = strInput.IndexOf (sDelimiter, iStart)
If iResult < 0 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
(though not when IndexOf uses a Char)
Regards,
Fergus
Sure, I'm sure.
Take:
Public Property Foo As String
Get
Return m_Foo
End Get
Set
m_Foo = Value
End Set
End Property
vs
public string Foo { get { return m_Foo; } set { m_Foo = value; }}
for instance.
That's perhaps an extreme example (8 to 1), but C# has lots of space
savers.
Regards,
Fergus
Interesting... Did anyone look at the IL to see what was going on? Just
curious.
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:u%23tN5e3j...@TK2MSFTNGP11.phx.gbl...
I haven't done so and no one else mentioned it. If you find yourself
delving, it would be interesting to know, but STD_OUTPUT_HANDLE might keep you
too busy! ;-)
Regards,
Fergus
|| IMO the C# version is "unreadable".
That's useful to know - ponder and recall that feeling, then multiply it.
Many one-language-only speakers feel <that>, and more, when they see a page of
German or French, or English, or Russian, Greek, Sanscrit, Korean,
Babylonian....
Regards,
Fergus
Europeans once discovered a tribe of natives who had lived their entire
lives in the jungle. A few of these natives once had occasion to travel with
the Europeans and eventually came to areas of plains where herds of grazing
animals lived. They could be seen for miles around. The natives couldn't
believe how some of these creatures were so big and yet others (of the same
type) were so tiny. They simply couldn't understand how the images were small
because of perspective. They had never perceived anything like it in the
jungle where the longest as-far-as-the-eye-can-see distance is measured in
mere metres.
So it is with C# and VB.
======================================
The standard formatting of braces in C# is
string foo()
{
Code at this level.
}
I <hate> it - for my eyes are used to
string foo()
{
Code at this level.
}
The former makes me feel very uncomfortable because my eyes can't parse it
as readily as the style I've been using for all these years.
Regards,
Fergus
It's not unreadable because I don't "speak" C#, but my eyes need much
more time to understand the code.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet> (updated!)
ACK. One of our professors used this indentation style:
\\\
class Foo {
public void makeIt() {
doIt();
}
}
///
IMO really stupid because the eyes cannot parse it.
OT:
You always complain about my posts, so I will complain about your posts
too. In the usenet ">" is used to quote the text of the post you are
answering. Some newsreaders are able to parse the ">>>" at the
beginning of the lines and display them as vertical lines, the text is
sometimes displayed in different colors, depending on the quuting
depth.
When using non-standard quoting characters like "||" and large
indentations, the text will be "unreadable" with some newsreaders. My
newsreader, for example, displays the "||" as a smiley and is unable to
quote the text. I always have to remove the "||" and the indentation to
get it work...
"The Banana increased in size by 300%"
Anyways..... My statement was not meant to be taken literally, but as an
indication to my feelings on the fact that VB.NET is by far the best
language EVER.
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Daniel Pratt" <kolREMOVET...@hotmail.com> wrote in message
news:uZywMz2j...@TK2MSFTNGP12.phx.gbl...
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:#O0#0W3jDH...@TK2MSFTNGP09.phx.gbl...
It's not even well formed C, IMO. You should see some of my C++ code:
BOOL IsAdminOwnerW ( LPWSTR wszFile )
{
LPSTR szFile;
DWORD dwLen = 0;
dwLen = WideCharToMultiByte( CP_ACP, 0, wszFile, -1, NULL, NULL, NULL,
NULL );
szFile = ( LPSTR ) LocalAlloc( LMEM_FIXED | LMEM_ZEROINIT, dwLen );
WideCharToMultiByte( CP_ACP, 0, wszFile, -1, szFile, dwLen, NULL,
NULL );
BOOL bRet = IsAdminOwnerA( szFile );
LocalFree( ( HLOCAL ) szFile );
return bRet;
}
See? Spaces everywhere.
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:u#tN5e3jD...@TK2MSFTNGP11.phx.gbl...
Kirk out.
By far the best VB ever, for sure, but are you saying that it's better
than Lisp?
Regards,
Fergus
I am not alone with this feeling...
;-)
I _hate_ the spaces, I would write:
\\\
BOOL IsAdminOwnerW(LPWSTR wszFile)
{
...
}
///
Notice the 8 spaces used for indentation.
By far the _only_ VB.NET ever. VB Classic is a _different_ programming
language.
And FYI, Fergus, or should I say James T. Kirk? I checked the headers of the
messages and your IP addresses match. ;-)
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:exmHUP4...@TK2MSFTNGP11.phx.gbl...
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:uBdumY4j...@TK2MSFTNGP10.phx.gbl...
Ith there no eth in Lithp then?
Bones, I'm surprised - given that I mentioned you and Spock in a previous
post under my Fergus alias ....
Kirk out.
With Pleasure and Merriment ;-))
I felt more joy and amusement than straight humour and laughter.
Regards,
Fergus
Oh groan,
LocalFree( ( HLOCAL ) szFile );
No, no, please - no more, I can't take any more!!
LocalFree ((HLOCAL) szFile);
Oh, that's better. My eyes are in focus again.
or
LocalFree( ( HLOCAL ) szFile );
Look at those poor lonely brackets all out on their own. They shouldn't be
left to fend for themselves, they're too young.
LocalFree ((HLOCAL) szFile);
That's better - a responsible identifier to look after them.
Regards,
Fergus
In OE there is a drop-down listbox for choice of quotation character. The
choice is '>', ':' and '|'. I prefer the '|' because it produces clean
vertical lines. It's also easier to type, requiring only one hand. And I
prefer '||' because it seems clearer.
!! However, for you,
!! I am willing to change it.
!! Could you cope with '!!'?
To change the indentation I'll need more persuasion. Start talking. ;-)
Could you email me one of these posts as your reader shows it I'm curious
as to how these smileys look.
Regards,
Fergus
*Tom cries and breaks down into floods of tears, he will be scarred for
life*
I _hate_ spaces between identifiers and brackets, okay, perhaps I can make
my peace with getting rid of the spaces on the casting statement:
LocalFree( (HLOCAL) szFile );
But, I think it looks much cleaner (especially when you're injecting into
windows ;-)) to put spaces after the parentheses.
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:uAAzps4j...@TK2MSFTNGP09.phx.gbl...
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:uus02n4j...@TK2MSFTNGP10.phx.gbl...
I think that there is no newsreader available that knows that " ||"
is a single indentation level.
> !! However, for you,
> !! I am willing to change it.
> !! Could you cope with '!!'?
>
> To change the indentation I'll need more persuasion. Start talking. ;-)
Why do you use the indentation? I really like it in books, but news
posts are plain text files and it should be possible to show them on any
device.
> Could you email me one of these posts as your reader shows it I'm curious
> as to how these smileys look.
Yep... I will send you a screenshot.
Full ACK.
> LocalFree( (HLOCAL) szFile );
>
> But, I think it looks much cleaner (especially when you're injecting into
> windows ;-)) to put spaces after the parentheses.
I prefer this:
\\\
LocalFree((HLOCAL)szFile);
///
:-)
My bracket-matching algorithm is very fast...
I'm starting to get a foggy picture in my head of of just what the
capabilties of .Net are, and starting to realize that it would probably take
a lifetime to fully mis-understand it all.
Have a lot of friends that are very knowledgeable about computers, but know
squat about programming. I kinda get the impression that I am not taken
seriously when I mention that I am learning VB. Kinda like saying that I'm
studing the complete works of Dr. Suess for English Lit.
(Thats not what I'M saying - I know different!)
Right now I'm only in my 4th week of Advanced VB, and I still get this
strange humming in my ears when I think about abstract classes,
but I've kinda been toying with the idea of trying a C++ class, maybe next
semester. Would this make me more valuable in the job market, or would I be
better off just trying to master (Ha-Ha!) VB? Is it worth it? My professor
seems to think VB is the future, and fewer and fewer people are going to be
learning these other languages.
Opinions?
--
/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:%23Ldvcq2...@TK2MSFTNGP09.phx.gbl...
>
> VB.NET is a friendly Labrador which wags its tail and knocks things
over.
> It's just a bit boisterous and clumsy at times. Always seems to take up
more
> space than you'd expect. It does the most horrendous farts.
>
> C# is a Police-trained German Shepherd. Sharp is a good word for it.
Its
> moves are clean and efficient. Cuddly it ain't - though it's quite
beautiful.
> You wouldn't have it for the children to play with - not because it's
> dangerous (too well trained for that) but it just wouldn't be as much fun
as a
> Labrador.
>
>
The last time I rerouted a demijohn, I got very drunk very quickly, hic!
Regards,
Fergus
Why do I use indentation?
Lol. For a man who likes this:
LocalFree((HLOCAL)szFile);
no explanation will suffice because it involves mention of the word
'space'.
;-))
!! I think that there is no newsreader available that
!! knows that " ||" is a single indentation level.
People know it. I don't understand your statement.
!! However, for you,
!! I am willing to change it.
!! Could you cope with '!!'?
No comment ?
Regards,
Fergus
But I have to remove your quotes and insert standard quoting myself. I
prefer:
\\\
>>> Bla
>>> Foo
>>
>> Blaba
>> Foo
>
> Baz
> Bar
///
And I _hate_:
\\\
>> || Bla
>> || Foo
>>
>> BlaBla
>> Foo
>
> Baz
> Bar
///
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:ONz0lW$jDHA...@tk2msftngp13.phx.gbl...
Anyway, you could at least have a space between the cast and the variable?
> \\\
LocalFree((HLOCAL) szFile);
> ///
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:OWp1h5#jDHA...@TK2MSFTNGP10.phx.gbl...
Only with Option Compare Binary. It's about the same or somewhat
slower with Option Compare Text.
>Interesting... Did anyone look at the IL to see what was going on?
InStr (with Option Compare Binary) uses
CultureInfo.InvariantCulture.CompareInfo internally. Because
InvariantCulture is constant, it can be cached (and the VB library
does that).
String.IndexOf (and InStr with Option Compare Text) uses
CultureInfo.CurrentCulture.CompareInfo. CurrentCulture can be changed,
and so has to be retrieved every time IndexOf is called.
So for a loop like this one, it's better to manually retrieve the
appropriate CompareInfo to a local variable and call IndexOf on that
instead.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Herfried's Brain Supreme.
> Anyway, you could at least have a space between the cast and the variable?
>
>> \\\
> LocalFree((HLOCAL) szFile);
>> ///
Why?
ROFL
> Why?
Why Not? Because it looks pretty, and makes your code readable:
MessageBox((HWND)hWndMyWndPointer,(LPCTSTR)lpszSomeStringPointer,(LPCTSTR)lp
szAnotherUnnecessarilyLongName,(DWORD)dwCastingGalore);
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:uYr10VBk...@TK2MSFTNGP09.phx.gbl...
I prefer to add spaces after the "," characters. I prefer this:
\\\
MessageBox(
(HWND)hWndMyWndPointer,
(LPCTSTR)lpszSomeStringPointer,
(LPCTSTR)lpszAnotherUnnecessarilyLongName,
(DWORD)dwCastingGalore
);
///
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:OSdDEdCk...@TK2MSFTNGP12.phx.gbl...
I use multiple lines in VB.NET too when preparing code for publication
in a book (there must not be more than 80 characters in one line).
{ _
..., _
..., _
..., _
..., _
... _
}
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:e9KB3lDk...@TK2MSFTNGP11.phx.gbl...
Mattias,
You are d'Man! Thanks for that. I was going to start looking into it
this afternoon... Now I can go spend time with the fam instead :)
--
Tom Shelton
MVP [Visual Basic]
\\\
Dim astr() As String = _
{ _
"Foo", _
"Goo", _
"Bar" _
}
///
Oh do give me break. ;-))
Preferably after each comma, and closing bracket.
I take it Herfried, that you prefer crowds and parties to the life of a
loner. Me, I need my space!!
Regards,
Fergus
You knew I was going to say that? 'Course you did. There's the man who
does the straight lines, and there's the one who gets the gags! ;-))
Regards,
Fergus
Commas at the left are much neater.
Regards
Fergus
A reference by value to what, I wonder?
Regards,
Fergus
I was lining up with my mouse, but could not find what it was, and as you
know those OT threads from Herfrid become intresting when the start to
become long.
:-)))))))
Cor
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Cor" <n...@non.com> wrote in message
news:3f8a8c1c$0$14420$48b9...@reader20.wxs.nl...
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
" System.Reflection Master "
==== Converting to 2002 ====
Remove inline declarations
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:bmhlhs$mu7vn$2...@ID-208219.news.uni-berlin.de...
In C, we had to code our own bugs. In C++ we can inherit them.
maybe it's a misquote - but this is what I found.
--
/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
"Alexandre Moura" <amo...@online.microsoft.com> wrote in message
news:l7mQW6Ol...@cpmsftngxa06.phx.gbl...
Yes, that's the one I remember and it still makes me laugh!!
The .NET version doesn't have the same impact at all:
"VB.NET makes it possible to get a paper-cut - C# does too, and you
can also get a splinter."
Referring to your previous post, I'd certainly recommend learning C# as
well. It has advantages that VB doesn't, language-wise, but is not the strange
beast that C++ is, relative to VB.
One nice thing about C# is that some things which don't make sense, or are
a bit fuzzy, become much clearer when you learn the C# version.
Your professor is right about the numbers - but that's always been the
case with Basic versus the world of languages. He's wrong about it being the
future though, - it's just a part of the future.
I've heard rumbles that C# commands more dosh, but haven't confirmed this.
But in view of the numbers game, scarcity = value.
Regards,
Fergus
/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
"Fergus Cooney" <filt...@tesco.net> wrote in message
news:e5zq91Pl...@TK2MSFTNGP09.phx.gbl...
LOL. Sorry to any ardent VBers.
Microcomputers and networking systems??
C# all the way - unless you go for C++.
Regards,
Fergus