what about that…?
dim arr as object(0)
what about that…?
I build the parts in C#, and use VB for glue.
“If arg is Nothing Then Return” is valid (or something like it… point being you don’t need end if)
“The English language is not case sensitive, nor are the humans that speak it.”
I’d be forced to disagree. I’m sorry for the mental image in advance, but there is a big difference in meaning in the following two sentences:
“I helped my uncle Jack off a horse.”
“I helped my uncle jack off a horse.”
Try this in C# with the same amount of code:
Private WithEvents Timer1 as new Timer
Private WithEvents Timer2 as new Timer
Private Sub Timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick, Timer2.Tick
thanx for giving me knowledge abt c#
I think C# developers are paid more because many of them come from a C++ or Java background which lends itself to a much better object oriented background. Many VB coders have an extremely hard time truly understanding and applying OO principles. Just wrapping a bunch of functions in a class is not OO.
Also, someone coming from C/C++ will likely have much more technical depth – having dealt with all the threading and memory management complexities that .NET makes easy.
It’s more than what language one uses… its the experience they had prior to picking up VB.NET. I think you’ll find few C/C++ and Java developers picking up VB.NET by choice. Actually, many VB’ers only know VB.
I have been reading a lot about which language is better-
VB vs C# ?
Most techies have strong view points, but they are all based on ‘geeky emotions’ rather than logic or even common sense.
People say they should use C# because Microsoft is using it, or because it looks complex, or they have to type less, or that C# looks like a computer language and VB does not, or that C# programmers are smarter or that C# programmers are generally C++ programmers and hence they must be good because they can understand all that ridiculous code.
Well, if writing cryptic code = smarter people, then the richest people in business would all be C++ programmers or the leaders of this world would all be ex-programmers. I am not sure if that IS the case.
How many CEOs of medium/large companies are ex-programmers (except for a few CEOs of tech companies)? How many presidents,prime ministers are ex-programmers? None.
By the way I am a programmer myself, and have been for 20 years, and probably a geek too, in many ways.
What is the point? It is simply that we, the programmers, often enjoy writing and looking at cryptic stuff. It gives us a feeling that no one else can read it, and hence we must be smarter. And in doing so we fail to look at the ‘big picture’. Big picture could mean many things- What works better? How to save time? What is better for the business? Why are we developing this application? Is there a better and simpler way? And so on.
I think a ‘good’ development language is one, which allows us to perform the most common (needed) functions in the shortest possible time, and offers a short learning curve, and is relatively easier for another programmer to comprehend.
Based on that- VB is much better, for ALL business needs. May be or may be not for systems programming-- I do not know.
Here is a link from Microsoft. They do not say, one is better than another, but read and decide for yourself, which is easier AND better for business-- the most common use for programming languages.
I have neither programmed in VB or C# before, but one need not be a rocket scientist to realize which offers shorter development lifecycles. It is certainly VB.
I am not saying C# is ‘bad’, it is just that it still contains most of the ‘primitive’ stuff- bad syntax, confusing pointers which are probably never needed in 99% of the applications, hard to read, etc. etc. Remember, C was developed for controlling telephone switches, and at least to me, it still looks that way!
Thank you for reading this long note.
Talked to an old pro. (A guy over 50 with a lot of consulting experience, obviously a C/C++ programmer) Anyway, he said that C# “scales better”. Knowing that they are different wrappers on the same CLR, I did wonder if anyone was asserting that out here in the real world…
I didn’t find anything like that in this discussion.
For my own development, I have a bit more of a comfort level in VB, so I use that, but it wouldn’t bother me to use C# either, finding it readable enough.
I wonder if some truth lurks in his statement; maybe the pointers and whatever else is not used, not needed, and poorly understood by the VB programmers is where that extra power of C# is.
I just read the MS paper linked to in the post prior to my first one. MS does say there is (almost completely) no difference. Somehow that falls short of completely convincing me that VB would scale as well. I really don’t care that much, most of my projects are simplistic, and will continue using VB based on my familarity.
personally i dont think it is that big of a deal.
Use what you want to, or what your told to.
i do alot of asp.net and we use c# for the framework code, and vb for aplication specific code.
my favorite quote “who cares let the IL do its job”
Please stop with the “vb is better then c# is better then java is better then c++ …” my compiler can beat up your compiler arguments. The right tool for the right job. (John Holmes say that?)
A professional application should be able to scale, be maintainable, and cost effective. Simply put, if it is works for the business solution at hand use what is best.
I personally think VB.anything is a waste of money and time, my opinion right or wrong. Given that, I would never pay for nor write in VB.NET.
But, given the scope and scale of projects today, coupled by the wide range of programmer’s skills, forcing a group to use something because it “seems” better or because someone read it is “cooler” then what they are used to is a death march waiting to happen.
Syntax is syntax and for the most part is nothing but sugar for the head, get through it and you know the language. The real solutions come from the logic you can implement with it. Abstraction, templates, OO, and patterns can be implemented in ANY language, including cobol. The higher the language, read abstracted, the easier to implement, but not always the best choice. The best solution is the most maintainable.
Don’t believe it? Remember that bit of perl code you hacked together last summer as a quick way to learn the language? Well, it is central to your day to day operations now and you need to add functionality. (insert homer response here - DOH!)
Now, there are times you have to use a real language, yep that was a shot :-). Embedded is one that requires speed, scaleability, and hard core knowledge of the compiler and system. NEITHER VB nor C# cut it in that world unless your running a MS OS. Even then, you seldom see anyone use them, even MS.
VB .vs. C#, both are syntatic candy inside of the .NET framework which is on top of the CLR which runs using IL. When you get that far abstracted, arguing about the sugar is just silly. Like arguing about which spoon to use to eat desert.
What your comfortable with is what is best in the general case. (Unless it is VB.NET )
This argument is asinine and a bunch of hot air blowing. I program with VB, C#, Classic ASP, Java, Perl, PHP and old school C. IMO the difference between C# and VB are strictly personal ease of use. If you think that C# developers are smarter or that VB programmers can’t understand OO then you’re likely going to become one of those jackass managers that no one wants to work for. The biggest plus that I can see for C# is that it’s syntatically closer to Java so it makes bridging the gap between the two languages much easier. And for the record, stupid knows no bounds… I’ve met plenty of bad coders in every language I’ve used. Basic happens to have more because beginners do use it, why? Because it’s a very inviting language that’s much more intuitive to a newbie.
Microsoft in their quest to be everything to everyone made the language a preference and the Framework the important piece. Kudos to them for that… after all, a compiled WebPart written in C# can live in the same environment as that compiled WebPart written in VB. Anything I can write in either C# or VB I can write in the other and I haven’t run into a single example of something that can’t be done in both. C# vs. VB, Republicans vs. Democrats, Ford vs. Chevy, .NET vs. Java, Linux vs. Windows, Microsoft vs. Google, there’s so much polarization it makes my head swim sometimes.
"Well, if writing cryptic code = smarter people, then the richest people in business would all be C++ programmers or the leaders of this world would all be ex-programmers. I am not sure if that IS the case."
Smart and rich (and/or powerful) simply are not the same things.
"How many CEOs of medium/large companies are ex-programmers (except for a few CEOs of tech companies)? How many presidents,prime ministers are ex-programmers? None."
Programmers personalities are seldom suited to these kind of jobs.
"I think a ‘good’ development language is one, which allows us to perform the most common (needed) functions in the shortest possible time, and offers a short learning curve, and is relatively easier for another programmer to comprehend."
Agreed, and therefore this language will certainly not be a form of BASIC.
"Based on that- VB is much better, for ALL business needs. May be or may be not for systems programming-- I do not know."
Yet you have 20 years of programming experience. Surely you’ve at least looked at system programming in all that time?
"I have neither programmed in VB or C# before, but one need not be a rocket scientist to realize which offers shorter development lifecycles. It is certainly VB."
Well that is complete crap and I’m betting you are actually a VB programmer.
"I am not saying C# is ‘bad’, it is just that it still contains most of the ‘primitive’ stuff- bad syntax, confusing pointers which are probably never needed in 99% of the applications, hard to read, etc. etc. Remember, C was developed for controlling telephone switches, and at least to me, it still looks that way!"
The is completely wrong. Not only are pointers extremely useful in certain situations but the are well hidden in C#. The majority of code will not even contain a single unsafe block.
And C was most certainly NOT developed for controlling telephone switches. It was developed as the language to develop the UNIX operating system. You can also bet that the operating system you are reading this with was developed in C; whether it is Windows, Mac OS X, Linux, Solaris, BSD, BeOS, etc.
If you want to fit in at a party with bankers you wear a suit. If you want to fit in at a party with bikers you wear a black t shirt and ripped jeans.
If a company is going to pay more for C# and thinks that C# is worth more then it’s sometimes only because those who say how much to pay for a position are older folks who came up through the ranks when C/C++ was the god. They see curly braces in your IDE and they think you are smart … like them :). Like a biker seeing the oil stain and the banker seeing the rolex. Humans like what they are like.
Jeff Ricther once told me over bad coffee worse cake in New Orleans that “there is no difference at all between VB.Net and C#” and yet in that same conversation he said that C# was “better”. “Better” because it was easier for him, it was like what he liked. (In the preface to the VB edition of his first CLR book he mentions that his view of VB was changed in that project because of his having to experience VB from a professinal perspective. ‘They are the same’ becuase more than just words… becuase he swas forced to really give it a personal try)
I did VB for a long long time, since VB2Pro for DOS. I don’t do it all that much any more (becuase I figured out how to make more money by simply doing VB with different syntax (more to come)). BUT I will ALWAYS love VB for what it gave me as an entry into programming, as a great tool that I wsas thrilled to use to show up VC++ people with when they said out of ignorance that VB could not do this or that annd I made it do sometimes even what they couldn’t do on time, And I will always respect its history and what IT gave to computing.
Many if not most of the best IDE productivity enhancements came out of VB’s IDEs (and remember I saw them all) from all the way back before Java, before Delphi and before VC (because you will recall that the product VB came before the product VC). Intellisense… what respectable IDE would be complete without it? It came first in VB’s IDE, background compilation that IS a great thing (just see the ReSharper fans going ga ga over it) was part of VB at least back to 3. Dot syntax code completion… VB’s IDE.
Step back a bit and think Products because VB is NOT and never was a language, it was - and its main power was - that it was a complete packaged tool; IDE + Syntax + Runtime. Prior to VB.Net VB could only be made in the IDE. “Tool” as in a set of program (IDE) and syntax (scripting for that program) to get things done.
Folks, you’re being hoodwinked in this battle. The CLR is a great big huge runtime with all the garbage collection and abstraction for productivity … that’s VB, that is the real power of the heart of VB. And before you foam at the mouth… be a Scientist, do a little non-emotional history checking on the VB Product and think it over.
But keep up the fight for both sides because the more you dig in and LOVE AND KILL FOR your C# and the other guy LOVES AND KILLS for his VB … Microsoft takes home the money from both of you. And the more money they make the better chance they’ll keep making both to keep us fighting, to keep one Product team making something cool in a release while another makes something else for their Product then the next release they do what the other did because of the whining of the core audiences and both gbet better than the other in stages yet they both drive theo other to get better, etc etc.
The day MS decides to stop making one of them is the day we all lose. Becuase then we’re locked into just one and like all single products that will stale mighty quick.
VB was not B.A.S.I.C., VB was and is a productivity tool for computers, primarily for business commputing. And if you can see that angle where that underlying truth is what VB really was and what really made it so incredibly wildly popular makes this thing a smart MASM guy once told me make a lot of sense:
“C# IS VB… with curly braces”
Use the one that makes you money, nothing wrong with money and nothing wrong with letting a boss believe that you’re “smarter” becuase of using one syntax instead of another … BUT use the other to know what yours still lacks and demand that yours gets it (and dmand that your other one gets things new too). Woe to the person who doens’t use both, opportunities might be missed to do what is really cool: .Net.
Well done Jeff Atwood for all your pointless comments.
Amusing that VB people are struggling so badly to defend their flawed language.
Well let’s try something else rather than talking about syntax - how about the fact that C# programmers won’t be getting RSI quite as badly as you guys. Why? Because they don’t have to type twice as much code to get the job done.
I’ve used C# for 2 years, and VB.Net for a year, and I HATE VB.Net - it’s awful. I come from a background in script languages similar to VB but anybody with half a brain can see that C# is the way to go. It’s easier to write, less syntax, and its keywords and statements are all more obvious than their VB equivalents.
For example - public internal VS public ‘friend’
I have neither programmed in VB or C# before, but one need not be a rocket scientist to realize which offers shorter development lifecycles. It is certainly VB./p
“I am not saying C# is ‘bad’, it is just that it still contains most of the ‘primitive’ stuff- bad syntax, confusing pointers which are probably never needed in 99% of the applications, hard to read, etc. etc. Remember, C was developed for controlling telephone switches, and at least to me, it still looks that way!”
“I have neither programmed in VB or C# before, but one need not be a rocket scientist to realize which offers shorter development lifecycles. It is certainly VB.”
mike on September 11, 2006 06:17 AM
The last sentence is pretty obvious - that you’ve programmed in neither. How, therefore are you qualified to make judgement on this? Anybody who’s done programming in both languages would discount your first statement as complete nonsense.
VB does not offer shorter development lifecycles, as it allows non type-safe operations, so in fact your developers are likely to spend far more time debugging. I suggest you go and read up on this.
Visual Basic is a BASIC language. Generally the code I’ve seen put together by VB programmers looks like amature crap. It lets you get away with murder - as a language it does not encourage discipline. VB should be used for 1 thing - M$ macros. I used to program in a VB style language and VB (Lotus Script). After learning to program in Java and PHP I left my job because VB style scripting made me want to puke.
Any language based around C is better.
a++ vs a=a+1
a-- vs a=a-1
a+=4 vs a=a+4
a*=4 vs a=a*4
a=a==1 ? 0 : 1;
if a=1 then a=0 else a=1
Etc, etc, etc
a+=4 and a*=4 is recognised syntax in vb aswell.
I started with VB6 but then a few years later moved to VB.NET and used
it to the point when I couldn’t use it anymore for what I was doing.
I moved to C# because of the fact I could use unsafe code, pointers in paticular,
something VB doesn’t look like it will ever support.
C# also prepared me for C++, a skill I would definately need to use
in the future.
Most .NET developers tend to use it for mostly ASP.Net but I on the
other hand use it for heavy desktop development, as you see in my new blog,
so the more native-like power I get from my language the better.
Otherwise I don’t see any reason VB.Net should be considered any better
than C# or J# or any other language for that matter.
On a side note I will admit Phalanger (MSIL compiler for PHP) is looking sexy, especially if
it were to be used as a scripting language inside of a text adventure
engine or something.