Daticus

I think microsoft should make the end of line statement, (i.e. the ";") optional. If you program VB.net like I do and is inevitably forced to write/read C# code, having to write the ; after each statement is annoying. I know C/C++/java etc all have it but in an enviroment like Visual studio where the IDE makes life so much easier the end of line statement is unnecessary. Who agrees with me



Re: Visual C# Language Make end of statement ";" optional?

Gabriel Lozano-Moran

I remember from VB that if you want to span multiple lines you then need to use the underschore character. To make sure that the text stays readible within a certain width I often span a single line of code over 2 or more lines. I like the fact that you have to explicitly determine where the line of code ends.






Re: Visual C# Language Make end of statement ";" optional?

Daticus

I know that people with a C like language background would most likely not agree but I don't mind the underscore for spanning multiple lines of code in VB, though it too can be annoy sometimes it does make code more clear (like oh, this line of code spans 3 rows). But remember I'm talking about people that comes from VB, not from C/C++ etc. People like me who aren't as used to the ; statement. Don't get me wrong, I've done the whole fortran, c, java, c++, etc and had to write many of assignments with ;, I'm simply stating it should be optional.





Re: Visual C# Language Make end of statement ";" optional?

CalvinR

I think that's a horrible idea, if we were to do that then we would be forced to only have one
statement per line, I'm sorry but I prefer to be able to format my code however I want to. If it was optional they would have to make major modifications to the compiler, which I imagine they are not willing to do.





Re: Visual C# Language Make end of statement ";" optional?

James Curran

The IDE has nothing to do with it. The end-of-statement character is needed to parse the language. The under-score continuation character in VB is just the type of hack needed when you don't use a terminating character. It's just one of the many patched to VB needed to mantain the syntax created 40+ years ago, when a line of BASIC code had a line number, could only have one statement (the only possible thing that could follow a THEN was a line number)






Re: Visual C# Language Make end of statement ";" optional?

ShellShock

The lack of a line terminator is just one of the many examples of sloppy grammar design in VB, and which is one of the many reasons I prefer C#. Making syntax optional is a poor design decision, as some developers will supply the optional bits and some won't and some will sometimes supply it and sometimes not. On a large programming team this inconsistency results in a mess. Code standards are not the answer - it is much better to enforce rules via the compiler (which can be 100% strict and correct) rather than some error-prone, ad-hoc human standard.



Re: Visual C# Language Make end of statement ";" optional?

Daticus

ShellShock wrote:
The lack of a line terminator is just one of the many examples of sloppy grammar design in VB, and which is one of the many reasons I prefer C#. Making syntax optional is a poor design decision, as some developers will supply the optional bits and some won't and some will sometimes supply it and sometimes not. On a large programming team this inconsistency results in a mess. Code standards are not the answer - it is much better to enforce rules via the compiler (which can be 100% strict and correct) rather than some error-prone, ad-hoc human standard.


Ok, then just make take the ; out. VB isn't poor, and its those kinds of "hacks" that has made it popular and successful. Just look at the express versions of C# and VB, VB has two fold more traffic, which means VB is more popular with up and coming programmers. Like them, I love VB, but I also program in java, php, C/C++ and none can compare to vb.net. The syntax and the features of Visual Studio makes vb.net the ideal choice for RAD. And its very evident when you search job sites (hotjobs, careerbuilder, etc). The only reason why C# has a following is due to its legacy syntax. People who are use to C derived languages find C# better to understand and follow, and because of that, that is why companies hire C# programmers.

The old gap of language power from vb6 to C style languages are over, viva la vb.net!!





Re: Visual C# Language Make end of statement ";" optional?

Gabriel Lozano-Moran

The reason that VB was popular was because it was an easy to learn programming language. Because it was so easy to learn a lot of hobbyists that didn't have proper training could "develop" software often using bad practices like Cowboy Programming and using bad practices without realising that. A lot of this userbase has shifted to C#, including myself, havint to realise that a lot of things that you did in the past are considered bad practices. In school it is even recommend to not teach students Visual Basic just because of this reason. Using the ; line terminator forces you as a developer to think about properly terminating every line. I don't like introducing the things from VB that make VB developers lazy developers and putting these things in C#.




Re: Visual C# Language Make end of statement ";" optional?

Daticus

Gabriel Lozano-Moran wrote:
The reason that VB was popular was because it was an easy to learn programming language. Because it was so easy to learn a lot of hobbyists that didn't have proper training could "develop" software often using bad practices like Cowboy Programming and using bad practices without realising that. A lot of this userbase has shifted to C#, including myself, havint to realise that a lot of things that you did in the past are considered bad practices. In school it is even recommend to not teach students Visual Basic just because of this reason. Using the ; line terminator forces you as a developer to think about properly terminating every line. I don't like introducing the things from VB that make VB developers lazy developers and putting these things in C#.


You're one person, sure, there are exception. Almost nothing is absolute. But we're talking about vb.net, a modern OO programming language. It has all the classes that C# uses, yet it is more natural to read and write. I admit there are still syntax that I do not like (like arrays using () instead of [], some arrays look like function calls). But I for see vb becoming the language of choice within the coming years.





Re: Visual C# Language Make end of statement ";" optional?

Gabriel Lozano-Moran

Did you know that plans were to name it not Visual Basic.NET but Visual Fred instead because fundamentally VB and VB.NET or two different things In the end they went for Visual Basic .NET. If you have been programming for years using On Error Goto and using labels, did you know that it is still possible to use this in VB.NET This is an example of a bad practice. Did you know that studies show that people that have learned programming in VB have much more difficulties learning OO languages than others Did you know that C# was the language of .NET until management decided that they couldn't let the millions of VB developers in the cold and decided to go for VB.NET last minute I don't want to make this a VB.NET vs C# thread but please stop making a VB-like language from C#. Seriously if you want to learn and work with C# forgot everything you know about VB.




Re: Visual C# Language Make end of statement ";" optional?

James Curran

Daticus wrote:

Just look at the express versions of C# and VB, VB has two fold more traffic, which means VB is more popular with up and coming programmers.

True (probably, I don't know the actual numbers). However, you're missing the big picture here. Of all the world's programmers, 90+% use some form of Visual Basic (VB.Net, VB6, VBScript, VBA, WordBasic, AccessBasic, Excel Macros, etc). So, the fact that it's only 2:1 actually represents a movement towards C#.

Daticus wrote:
And its very evident when you search job sites (hotjobs, careerbuilder, etc).

I have not seen that. From what I've seen, C# is about equal or slightly ahead of VB.

Daticus wrote:
The only reason why C# has a following is due to its legacy syntax.
And one can say precisely the same think from VB.Net






Re: Visual C# Language Make end of statement ";" optional?

CommonGenius.com

 Daticus wrote:
You're one person, sure...

You're just one person too.

 Daticus wrote:
its very evident when you search job sites (hotjobs, careerbuilder, etc)
I just finished a job search in the DFW area, a very hot programming market. My primary job search tools were Monster.com and CareerBuilder.com. The number of jobs for C# developers outnumbered those for VB.NET at least 2 to 1, probably closer to 3 to 1.

 Daticus wrote:
[VB.NET] is more natural to read and write [than C#]

That is purely your opinion. I learned to program using BASIC and then Visual Basic, and after several years learned C++, and then several years later VB.NET and C#. I VASTLY prefer C-style syntax; VB syntax is unnecessarily verbose and geared towards casual and hobbyist programmers who need explicitly spelled out keywords instead of symbols and punctuation to be able to follow the code. C syntax is cleaner and easier to read and write quickly, making IT the ideal choice for RAD programming (of course, this is just my opinion, but that is exactly my point; preferences in syntax are just that, preferences, and you cannot say categorically that one syntax is better than another).

 Daticus wrote:
But I for see vb becoming the language of choice within the coming years.

Apparently you are unaware that Microsoft has been debating for several years completely dropping support for VB in all its forms. They have not been able to do it yet, because of the large legacy base of VB code (in all its various forms); in fact, because of this legacy base, they will probably not be able to drop support for it any time soon. But no one but the oldest, most die-hard MS managers actually believes that VB is a viable long-term application programming language. VB was invented as a training and prototyping language, and it has never risen above its origins, despite the attempts by anti-C developers to make into something its not.

As to the original point of this post: the semi-colon, though occasionally annoying, is an essential part of languages using C syntax, and makes it possible to cleanly write multi-line statements. Any talk of trying to remove it is pointless and only serves to start debates on which syntax is better.






Re: Visual C# Language Make end of statement ";" optional?

Daticus

We can argue and argue but only time will tell. Hope you guys brush up on you vb skills, as that will be the language of choice for .net. Especially as more and more people are able to program (its becoming easier).





Re: Visual C# Language Make end of statement ";" optional?

Tom Meschter MSFT

Making ";" optional is not as simple as it might sound. We need some way to definitively mark the end of the statement; if not ";", then something else. Using a line break as a statement terminator would break a great deal of existing code, so we can't do that either. All issues of VB.Net vs. C# aside, whatever benefit there might be in this idea, it doesn't come anywhere near the cost.

-Tom Meschter
Software Dev, Visual C# IDE






Re: Visual C# Language Make end of statement ";" optional?

ShellShock

Hope you brush up on your C# skills, as that will be the language of choice for .net.

It must be expensive for Microsoft to maintain two different syntaxes. I predict they will eventually drop one, and it will be VB.

My opinion is as valid or as useless as anyone else's.