• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Writing a useful program in Visual Basic

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
If there are actual advantages, I'd certainly like to know what they are, simply because I'm under the impression it's little more then a stylistic choice.

Here is a great list of language and syntax differences: C# vs. VB.net

I think the big "advantages" in VB.net are:
* The "with" keyword.
* The "optional" keyword.
* Exception filtering
* Simpler code for event handlers (but more complex in understanding).
* VB.net allows for text or binary comparisons (but is slower in execution, so this could be a disadvantage too)
* Not case sensitive.
* Visual Studios provides a settings framework (less language specific, granted).
* Verbal Syntax
* The "My" namespace (handy, but not really part of the framework)

On C#'s advantage list (note: I don't know C# nearly as well, so I maybe missing some):
* Unsafe (unmanaged) code
* Case sensitive.
* Less universal switches such as binary/text comparison.
* Anonymous Method (I personally dislike these as they add to the confusion in exchange of less lines of code)
* Symbolic Syntax
* Single statements on multiple lines is easier to write
* Multi-line commenting.
 
Originally posted by: jman19
Originally posted by: PhatoseAlpha
I figured the anti-vb sentiment was a legacy thing, harkening back to when it was a purely interpreted language and very slow.

That is likely it...

I think a lot of the people who started with a C background look down on VB and its history...

Bingo! Most of the people who hate VB or .NET haven't even used it(.NET), or at least haven't used VB since VB6.
 
Originally posted by: Noobsa44
* VB.net allows for text or binary comparisons (but is slower in execution, so this could be a disadvantage too)


You mean like String.Compare in C#?

I used to use VB6 a lot. I started moving to VB.net (programmed a bit in it, nothing too huge) and then a friend of mine told me to try C# and I've never looked back.
 
You mean like String.Compare in C#?

In visual studios .net 2005, when in a solution's properties, if you go to the compile options you will see "Option Compare" which allows you to compare by either text or by binary. I believe this only affects string comparisons performed like this: "if(str1 = str2) then" That way you don't have to always do something like String.Compare or "if(str1.toLower = str2.toLower)" then if that is what is need in your application. As best I can tell, C# does not support this as C# solutions don't even have a Compile options tab.
 
I can't stand the VB/C snobbery. Programming is programming. If you get the job done, what does it matter what it was coded in?

<--- REAL Basic 2006 user. Programmed in C, Pascal, REXX, Perl, MRL and all sorts of other crap to some degree in the past.
 
Yeah really depends what you need done. If you want a simple calculator, vb will do, if you want a complex statistics program that uses lot of processing, you'll want C or C#. If you want cross platform then C/C++ is way to go, if speed does not matter but compatability does, then java is probably better then C/C++. Oh and mono does not count, thats emulation and you get huge overhead and possibly other issues involved. C# is native on only windows unless MS releases their compiler under other OSes. So really the languages all have their pros and cons depending on situation.
 
Back
Top