Why is VB being forsaken?
-
Have you figured out stringbuilders yet or are you still concatenating in VB with "+"?
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
In VB, it's "&", not "+", and I use
StringBuilder
(orString.Format()
) in new code. I almost never use string concatenation. I have a rule that dictates never go back and change existing code (if I didn't originally write the file) unless changing the method is a part of the maintenance process. At that point, I may replace existing string concatenation with appropriate code, depending on a) how big the method is, and whether or ot I'm under an extreme time crunch.".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
Have you figured out stringbuilders yet or are you still concatenating in VB with "+"?
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
sure we do. string builders and generics are our friends, yes. (but we use a "&" ... we reserve the "+" for addition)... funny you ask because as i jump from project to project, I find myself concatenating string in sql with the "&" and in vb with a "+" kind of like when your grandma would call you and rattle off a list of your cousins prior to getting your name right, lol
-
There are tons of new tutorials for VB.Net, MS have just released Light Switch, and all the demos are pretty much exclusively in VB.NET. It won't die, MS make programming for all types of people, including people that shouldn't be programming, but they can, because of VB and VB.net. I'm not slating VB.Net, We use it for our major project without issue, and you've got to admit, XML literals are ace. We also use C# for another project, and I really miss the WithEvents keyword :)
...and automatic event wireups ;)
-
All the programming I have done has been with VB then VB.NET. Microsoft keeps continues to develop and release it along side C# and the rest. However, over the last few years, I have seen very little new information out there regarding VB. Very few articles on Code Project and other sites. Oh, and I'm a subscriber to MSDN magazine and I haven't seen a single line of VB.NET code in .. in .. I can't even remember the last issue. I can say at least the last four issues there hasn't been anything in VB.NET. It's all been C#, C++ and even F# but no VB! Is Microsoft trying to push it to the side so it whithers and dies and hope that no one notices or pays attention? Even here on Code Project I've noted next to nothing new on VB. Every week I get the newsletter with all the new articles and rarely do I see anything on VB.NET. There may be one article among the 30 C# articles but that's on a good week. So, what am I supposed to do? Just stop using it, pick up a "Learning C# For Lonely, Left Behind VB.NET Programmers" and just think of VB.NET as fond memories of long ago? I have a hard time with such a concept. VB.NET has evolved into a good language and is capable of doing pretty much anything C# can do (using the .net framework, of course) so why isn't it promoted more by MS and others?
I started VB with 1, after years of programming in FORTRAN, COBOL, Clipper, and QuickBasic. I never did use procedural programming, but did modular programming. That made the transition to OOP inVB4 through 6 pretty easy. Since my VB6 programs were OO, they ported easily to VB.NET. I also learned C# several years ago. I program in C# where I work since C# is the comfortable choice for the decision makers with a Java and C background. I program in VB.NET for my own development. I find VB.NET to be more productive, even in complex n-tiered apps. VB.NET does everything C# does, so why should I program in a 1960s throwback style when I can program in a simpler, more powerful syntax? I hear the anti-VB folks talk about C# being more "elegant". Huh? What does that mean? My wife and daughter are elegant. I don't want my language of choice to be girly or curly. :) I think "elegant" is used in the context of programming languages when one is unable to give a coherent reason for using a language. Simply put, if Java or C/C++ is your background, then use C#. If VB6 is your background, then use VB.NET. If you want to be mire hirable, know both well. After all, 80% of being an excellent .NET developer is knowing the framework.
-
Sure and there's no Optional Parameters in C#. Mouse-sized differences do not hide the mountain sized similarities.
Jacek Gajek wrote:
& is a string cont op in VB
"&" has a different purpose than "+"
dim z as string = 1 & 2
is a legit statement in VB and will return "12" "&" was BASIC's equivalent of "Concat" in assembler, while "+" was the equivalent of "add". Since BASIC was intended to be a simpler and more easily readable version of Assembler, it made great good sense to have different operators. Although I stopped worrying about it a long time ago, the idea of adding two strings together struck me as very odd when I first was exposed to it. Adding is what you do to numbers, concatenating is what you do to words. Usually, if you are doing a number of manipulations of a string, you are far better off with stringbuilder - something that was created for VB.NET and ported recently to C# ;)
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
Re StringBuilder versus appending text in VB... in VB6, there were several examples of doing an initially large string variable where you kept track of your own location within the string and used mid$ to place an appended string at the end of what was already there. This was only about a hundred times faster than stringA = stringB & stringC stuff. But, VB.Net obviously includes StringBuilder. The reason I (a former Microsoft Visual Basic MVP) went to C# was the arguement that learning the framework and OOP through C# was a better way than relying on VB6 preocedural styles to get into Dot Net. Best decision I ever made.
-
Yes, but using the plus sign could get you in trouble if your strings were just numeric values.
-
Yes, but using the plus sign could get you in trouble if your strings were just numeric values.
-
I started VB with 1, after years of programming in FORTRAN, COBOL, Clipper, and QuickBasic. I never did use procedural programming, but did modular programming. That made the transition to OOP inVB4 through 6 pretty easy. Since my VB6 programs were OO, they ported easily to VB.NET. I also learned C# several years ago. I program in C# where I work since C# is the comfortable choice for the decision makers with a Java and C background. I program in VB.NET for my own development. I find VB.NET to be more productive, even in complex n-tiered apps. VB.NET does everything C# does, so why should I program in a 1960s throwback style when I can program in a simpler, more powerful syntax? I hear the anti-VB folks talk about C# being more "elegant". Huh? What does that mean? My wife and daughter are elegant. I don't want my language of choice to be girly or curly. :) I think "elegant" is used in the context of programming languages when one is unable to give a coherent reason for using a language. Simply put, if Java or C/C++ is your background, then use C#. If VB6 is your background, then use VB.NET. If you want to be mire hirable, know both well. After all, 80% of being an excellent .NET developer is knowing the framework.
Hummmmm! Interesting! I started with VB in 1994 and move to c# in 2000, then back to VB and again back to c#. If you are a vb developer I feel you will be able to make an easy transition to c#. I see they both are very similar in performance, and different in syntax. However, if you have developed web sites, chances are you have used JavaScript. I personally like C# better because I think it is more standard and in a certain way close to Java and JavaScript. As far as VB being retired, I do not think so. As far as c# being more popular, yes of course. At the end , the choice is yours.
-
All the programming I have done has been with VB then VB.NET. Microsoft keeps continues to develop and release it along side C# and the rest. However, over the last few years, I have seen very little new information out there regarding VB. Very few articles on Code Project and other sites. Oh, and I'm a subscriber to MSDN magazine and I haven't seen a single line of VB.NET code in .. in .. I can't even remember the last issue. I can say at least the last four issues there hasn't been anything in VB.NET. It's all been C#, C++ and even F# but no VB! Is Microsoft trying to push it to the side so it whithers and dies and hope that no one notices or pays attention? Even here on Code Project I've noted next to nothing new on VB. Every week I get the newsletter with all the new articles and rarely do I see anything on VB.NET. There may be one article among the 30 C# articles but that's on a good week. So, what am I supposed to do? Just stop using it, pick up a "Learning C# For Lonely, Left Behind VB.NET Programmers" and just think of VB.NET as fond memories of long ago? I have a hard time with such a concept. VB.NET has evolved into a good language and is capable of doing pretty much anything C# can do (using the .net framework, of course) so why isn't it promoted more by MS and others?
I dont care what others say but I still vote for VB. I can program with VB and C# with equal ease but prefer the former because it lets me concentrate on my programming and logic rather than syntax. This actually saves me a lot of time with capitalization of variables. Think of it and calculate. if you have one capital for a variable and you have 10 variables and use it 10 times in your class, that means in C# you are using the "shift" key 100 times more. doesnt it give us that much more time? VB does it for you. So what if isnt OOPS strictly. It gets the work done and thats it. And it lets me get the work done easily. And if MS were to dump VB I will write my own compiler for it and sit on a hunger strike till they give me the code for the compiler.
-
Norm .net wrote:
A VB Luddite?
or a C# luddite. There are a lot of folks who having gotten used to curly braces never want to learn another syntax rule in their lives.
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
That was me. Until I learned SQL, which is fun.
-
All the programming I have done has been with VB then VB.NET. Microsoft keeps continues to develop and release it along side C# and the rest. However, over the last few years, I have seen very little new information out there regarding VB. Very few articles on Code Project and other sites. Oh, and I'm a subscriber to MSDN magazine and I haven't seen a single line of VB.NET code in .. in .. I can't even remember the last issue. I can say at least the last four issues there hasn't been anything in VB.NET. It's all been C#, C++ and even F# but no VB! Is Microsoft trying to push it to the side so it whithers and dies and hope that no one notices or pays attention? Even here on Code Project I've noted next to nothing new on VB. Every week I get the newsletter with all the new articles and rarely do I see anything on VB.NET. There may be one article among the 30 C# articles but that's on a good week. So, what am I supposed to do? Just stop using it, pick up a "Learning C# For Lonely, Left Behind VB.NET Programmers" and just think of VB.NET as fond memories of long ago? I have a hard time with such a concept. VB.NET has evolved into a good language and is capable of doing pretty much anything C# can do (using the .net framework, of course) so why isn't it promoted more by MS and others?
-
That was me. Until I learned SQL, which is fun.
To add my opinion to this topic. I for one like VB. I have used VBScript, VB, VB6, VBA, and VB.Net. It is easy to use since it is more readable than C# and other cryptic type code. I don't think VB is going away any time soon and here is why. VBA which is a subset of VB is in many applications Excel, Visio, Access, AutoCAD, and many others just to name a few. I work with VBA more than any other language these days. I can learn another language if I choose to I just can't be an expert at every language so I choose VB as my language of choice. VB.Net can do what C# can do so it is a wash and just a preference. When VB dies that is when I will move to C# or the new language at that time. I suggest stop comparing languages and use the one that you like and can get the job done that you are coding. If C++ is better then use it, if F# is better than use it, pick the right tool for the job.
-
All the programming I have done has been with VB then VB.NET. Microsoft keeps continues to develop and release it along side C# and the rest. However, over the last few years, I have seen very little new information out there regarding VB. Very few articles on Code Project and other sites. Oh, and I'm a subscriber to MSDN magazine and I haven't seen a single line of VB.NET code in .. in .. I can't even remember the last issue. I can say at least the last four issues there hasn't been anything in VB.NET. It's all been C#, C++ and even F# but no VB! Is Microsoft trying to push it to the side so it whithers and dies and hope that no one notices or pays attention? Even here on Code Project I've noted next to nothing new on VB. Every week I get the newsletter with all the new articles and rarely do I see anything on VB.NET. There may be one article among the 30 C# articles but that's on a good week. So, what am I supposed to do? Just stop using it, pick up a "Learning C# For Lonely, Left Behind VB.NET Programmers" and just think of VB.NET as fond memories of long ago? I have a hard time with such a concept. VB.NET has evolved into a good language and is capable of doing pretty much anything C# can do (using the .net framework, of course) so why isn't it promoted more by MS and others?
jim norcal wrote:
So, what am I supposed to do? Just stop using it
Yes. Speaking from my recent and on-going experience of working, or attempting to, with a VB.NET project, the code is poorly sturctured, undocumented, unsecure and performs poorly. In general it has been my experince that C# developers are more versed in OO and actually code using these principles. In this recent project there are ~5000 lines of VB.NET in two files. I reengineered using C# with a nTeired approach so that it now has 17 files with ~3000 lines, including unit tests. This is why VB.NET can, and should, be phased out. Not that the language itself is bad, the developers using it, IMO, mostly, don't have the skills, training, or experience to write software in the best manner. C# is also more closely related to other langauages, such as JavaScript, so the transition between them in a web application would be much easier and developers more productive.
I know the language. I've read a book. - _Madmatt
-
I dont care what others say but I still vote for VB. I can program with VB and C# with equal ease but prefer the former because it lets me concentrate on my programming and logic rather than syntax. This actually saves me a lot of time with capitalization of variables. Think of it and calculate. if you have one capital for a variable and you have 10 variables and use it 10 times in your class, that means in C# you are using the "shift" key 100 times more. doesnt it give us that much more time? VB does it for you. So what if isnt OOPS strictly. It gets the work done and thats it. And it lets me get the work done easily. And if MS were to dump VB I will write my own compiler for it and sit on a hunger strike till they give me the code for the compiler.
kenSemantics wrote:
VB does it for you.
Yes VB does a lot for you, but that is a problem. It allows for stupid things to be done without the developer having to actually think about what they are doing.
I know the language. I've read a book. - _Madmatt
-
Re StringBuilder versus appending text in VB... in VB6, there were several examples of doing an initially large string variable where you kept track of your own location within the string and used mid$ to place an appended string at the end of what was already there. This was only about a hundred times faster than stringA = stringB & stringC stuff. But, VB.Net obviously includes StringBuilder. The reason I (a former Microsoft Visual Basic MVP) went to C# was the arguement that learning the framework and OOP through C# was a better way than relying on VB6 preocedural styles to get into Dot Net. Best decision I ever made.
Alan Meadows wrote:
learning the framework and OOP through C# was a better way than relying on VB6 preocedural styles
One of the books I'll never throw away was my autographed copy of Deborah Kurata's "OOP in VB6" Now she was ten times the programmer than most of us (including myself) ever hope to be, and she had no problem programming in OOP or in teaching others (again including myself) that nothing in VB6 forced a procedural programming style on the developer, except laziness Since starting to work in .NET, I have seen many examples of people using C# and VB.NET to behave in a procedural manner because they are ignorant. (Most of em are written by converted COBOL programmers.) My point is that the language then, and then language now, does not make you into an object-oriented programmer - only the willingness/eagerness to learn something new (which requires the ability to admit you don't already know everything - something that I have long noted is a problem among programmers and other IT folk.) I congratulate you on your willingness to learn something new, even if I don't think yours was the only way to do it.
Alan Meadows wrote:
Best decision I ever made.
A decision each of us makes for himself. Mine was to learn C# and make sure I stayed current in both languages. The framework is the same in both languages and once you know both, one is far more hire-able.
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
-
db7uk wrote:
indeed. but who in the world concats numbers and strings in that manner anyway.
Your personal experience does not sum up the total of all of humankind. In case you have no knowledge of your tools, every computer that runs assembler deep down in it guts, operates in exactly the manner you seem to think doesn't exist
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
-
db7uk wrote:
indeed. but who in the world concats numbers and strings in that manner anyway.
Your personal experience does not sum up the total of all of humankind. In case you have no knowledge of your tools, every computer that runs assembler deep down in it guts, operates in exactly the manner you seem to think doesn't exist
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
-
jim norcal wrote:
stop using it
Absolutely. I'm a C/C# guy, but I've been doing VB.net for just about a year now and it's just horrible. Whenever I try to write C# I have trouble. Just last week I tried to access an item in a Dictionary with parentheses instead of brackets and couldn't understand the error it caused. VB use has even affected my health -- I've never had indigestion, but I was diagnosed with gastritis last week. C# is just a way better language. :thumbsup:
Agreed. Compared with the clean syntax of C#, VB.NET is horrid. Though, aside from these aesthetic, the major issue I've encountered is with the skills and abilities of those using VB compared with those coming from OO backgrounds.
I know the language. I've read a book. - _Madmatt
-
In VB, it's "&", not "+", and I use
StringBuilder
(orString.Format()
) in new code. I almost never use string concatenation. I have a rule that dictates never go back and change existing code (if I didn't originally write the file) unless changing the method is a part of the maintenance process. At that point, I may replace existing string concatenation with appropriate code, depending on a) how big the method is, and whether or ot I'm under an extreme time crunch.".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997John Simmons / outlaw programmer wrote:
In VB, it's "&", not "+"
No actually, in VB.NET it's both.
John Simmons / outlaw programmer wrote:
I use
StringBuilder
'Twasn't always the case, though, was it?
John Simmons / outlaw programmer wrote:
I almost never use string concatenation.
I use it constantly, but then we probably work on very different types of programs.
The 3-legged stool of understanding is held up by history, languages, and mathematics. Equipped with these three you can learn anything you want to learn. But if you lack any one of them you are just another ignorant peasant with dung on your boots. R. A. H.
-
jim norcal wrote:
So, what am I supposed to do? Just stop using it
Yes. Speaking from my recent and on-going experience of working, or attempting to, with a VB.NET project, the code is poorly sturctured, undocumented, unsecure and performs poorly. In general it has been my experince that C# developers are more versed in OO and actually code using these principles. In this recent project there are ~5000 lines of VB.NET in two files. I reengineered using C# with a nTeired approach so that it now has 17 files with ~3000 lines, including unit tests. This is why VB.NET can, and should, be phased out. Not that the language itself is bad, the developers using it, IMO, mostly, don't have the skills, training, or experience to write software in the best manner. C# is also more closely related to other langauages, such as JavaScript, so the transition between them in a web application would be much easier and developers more productive.
I know the language. I've read a book. - _Madmatt
For anyone reading Mark's response, it's important to note his qualifier, "In general". What he says is true. This is not to say that every VB programmer is less sophisticated than every C# programmer; there are some very good developers who happen to prefer VB. However, in the general sense, my experience has also been that people who develop in VB don't have has strong a grasp of the underlying fundamentals as those in C#. Thus, their applications are not as robust. For me, it seems as if the tools which go along with VB just don't work quite as well as with C#. Intellisense, for example: it seems as if, once I've made a syntax error in VB, inellisense just quits working, and it's more forgiving in C#.