|
It appears with the garbage VB and supposedly identical C# you concocted that you are a master of master of all things! We should bow to you and our soon-to-be VB.NET overlords!
Oh, but wait, what's this? Surely this doesn't work?! You can't have expressions in a C# switch statement!!!
Sorry, but YES YOU CAN, if you know even 1% of C# BASIC syntax...
switch (L1)
{
case int xx when xx < 50 || xx == 42:
for (int x = 0; x < 101; x++)
for (int y = 0; y < 101; y++)
for (int z = 0; y < 101; z++)
{
L1 = DoSomethingWithL(x, y, z, L1);
L1 = (L1 == 2 ? L1 = 3 : L1 = 0);
}
break;
case int xx when xx > 390:
L1 = 0;
break;
case 70:
L1 = 32;
break;
}
If you love VB.NET, then USE it, we don't care. Just stop embarrassing yourself by trying to "Prove" how much better VB.NET is.
I am proficient in both languages and I prefer C#. That doesn't make me better or worse than you.
All you do with these threads on "VB is better!!!" is tick people off. If that's how you get your jollies, I feel for you.
'nuff said.
Sincerely,
-Mark
mamiller@rhsnet.org
|
|
|
|
|
Mark Miller wrote: Sorry, but YES YOU CAN, if you know even 1% of C# BASIC syntax
This C# code you made is valid only in Visual Studio 2017 and C# 7.0, few people know that
But the equivalent VB.net is so since 2002
So you have made a stupid and impolite declaration about my C# knowledge
Pattern Matching in C# 7.0 Case Blocks -- Visual Studio Magazine[^]
|
|
|
|
|
Your reply proves my point, so thank you for responding EXACTLY the way I knew you would.
I'll not bother replying again, so rant away! Very few are listening.
Sincerely,
-Mark
mamiller@rhsnet.org
|
|
|
|
|
Mark Miller wrote: Very few are listening.
Sincerely,
-Mark
OK, anyway you are breaking this site rules beeing so impolite, this an evidence of possible disguise of lack of knowledge about what you are saying.
|
|
|
|
|
Not very readable though is it?
modified 6-Sep-22 21:01pm.
|
|
|
|
|
Depends on who reading... I have no problem to see what happening there... even easier than reading the if/else version...
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018
|
|
|
|
|
Exactly. The experienced may be able to understand it; me, as a hobby coder, finds it a lot harder to read and understand what is going on 😀
modified 6-Sep-22 21:01pm.
|
|
|
|
|
1000x times yes. Oh goodness, I'm spending lines, LINES on syntax that explicitly marks the beginning and end of each statement. OH NO, STOP THE PRESSSES, CANCEL C#, READABILITY IS OVERRATED, all bow to the mighty "more lines on screen = good" crowd.
|
|
|
|
|
They are equivalent in the sense that they both target the .NET Framework.
They are NOT statement-for-statement equivalent. Read Comparison of C Sharp and Visual Basic .NET - Wikipedia[^]
There are features of both languages that you cannot use or find an equivalent for in the other.
|
|
|
|
|
Dave Kreskowiak wrote: They are equivalent in the sense that they both target the .NET Framework.
Not only this, They are equivalent in the sense that they both can do the same things with equivalent (almost) amount of code (amount of lines).
|
|
|
|
|
That is most assuredly not true. You would know this if you bothered to read the link I gave you.
Again, when are you going to learn to read without bias?
|
|
|
|
|
|
|
Which has NOTHING to do with C# and VB.NET being developed separately and your comparison of the two being "equivalent".
|
|
|
|
|
Equivalent, huh?
OK, give the me the VB.NET equivalent of C#'s "checked" and "unchecked" keywords.
|
|
|
|
|
That is true only because MS deemed it so. They have less support for VB, the business language that built MS. It is a quality language as is c# only with out the } and is intelligent enough to know when the statement ends unlike is single letter counterpart.
|
|
|
|
|
So what made MS "deem it so"?
As for "smart enough", I'd rather code to the explicit rather than the convention.
|
|
|
|
|
Is that so? Than what is the "_" used for in VB.NET?
Sincerely,
-Mark
|
|
|
|
|
Popular with non-programmers.
|
|
|
|
|
Minion no. 5 wrote: Popular with non-programmers.
C# language is at the #6 position in that index, Java #1, Python #4... they are not programmers?
Tiobe Index is the most popular comparator of programming languages on the internet, it is cited by thousands of magazines and articles in many years.
|
|
|
|
|
Yeah and we told you that their methodology doesn't mean the language is popular IN USE. The TIOBE index is based on search results for keywords. That in no way means the language is more popular in actual use.
Am I a hater of VB.NET? No. I started .NET developement in 2001 with VB.NET, using the command line compilers and Notepad. There was no Visual Studio .NET at the time as the .NET Framework was still a beta.
I can write code in COBOL (blah!), VB5, VB6, VB.NET, C#, C, C++, C++/CLI, Java, Javascript, VBScript, VBA, ...
It doesn't matter what the language is, the money I get for writing in it is still green.
|
|
|
|
|
Dave Kreskowiak wrote: It doesn't matter what the language is, the money I get for writing in it is still green. Big thumbs up on this!
I'll work in any language if someone wants to pay me to do it.
|
|
|
|
|
He was saying the TIOBE Index you're shoving in everyone face is popular only with non-programmers.
Again, learn to read.
|
|
|
|
|
And here I thought every grad student was learning VB.net from day one to graduation!
/...
Just kidding, they're actually only learning Javascript: the VB of the Web.
|
|
|
|
|
georani wrote: VB.NET is like C# but a bit more verbose and almost like natural English, so anyone can understand VB.NET code.
I always say that's a terrible analogy as spoken language has many nuances that a reader can only understand if provided enough context. You can write something useful with a programming language within a few days or even hours--minutes in some cases. You need weeks, if not months or even years, to become proficient with a spoken language. If that's how VB.NET's defenders choose to extol its virtues, then they're starting off on the wrong foot.
I want my programming languages to clearly reflect the writer's intent without any guesswork. Comparing it with English is not how to sell a programming language to a developer. That's called dumbing it down to help those people not working in this field understand what's being discussed.
modified 14-Oct-18 10:01am.
|
|
|
|