Yahweh Posted May 24, 2007 Share Posted May 24, 2007 Here's a debate that could rival "vi vs emacs" in sheer pointlessness, but is there any reason to prefer the VB.Net syntax over C#, or vice versa?At least for me, I just got a job as a web developer for a banking company that emphasizes heavily on VB.Net, so I'll be using that syntax more often. I usually use VB.Net when I'm writing websites and desktop applications, and I use C# when I'm writing games.I prefer the VB.Net syntax for a few reasons:- Braces are the devil. A "}" can me end if, end loop, end class, end namespace, etc. I don't like having to scroll up to find the matching "{" to find out what kind of code block I'm working in.- I can declare optional parameters in functions and constructors. C#, for whatever reason, doesn't retain support for optional parameters, so you have to write a bunch of overloaded functions that all call each other to get the same effect.- Looping syntax is much more intuitive. When you say "For I = 0 to 5", you unambiguously get the numbers 0 through 5. Its a little more difficult to visualize what you get when you use "for (i = 0; i < 5; i++)" rather than "for (i = 0; i <= 5; i++)".- Case insensitive variable names and functions. Seriously, why would "mycounter" be a completely different variable from "myCounter"?C# does have some syntactical advantages with long lines of code, especially long regexes, because you don't need an underscore to continue to the next line. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.