Comparing languages

snarfblam

Ultimate Contributor
Joined
Jun 10, 2003
Messages
2,097
Location
USA
I'm tired of it. Comparing languages, that is. All the C++ programmers think that VB is the devil, and VB programmers think that C++ is impossibly difficult. Half of these people never even give the other language a chance. I use VB because it suits my needs. Not because C++ scares me. You run into people who will tell you things like C++ is simpler than VB or worse yet that it is better in every way. And its not just C++ programmers ragging on VB programmers. Here, sometimes, it's C# and VB.Net. Elsewhere, its Java and ActiveX. Its PHP and ASP. Its Windows and Linux (well... that one I can kind of see). Each language and platform has its purpose, and it just seems to me that it shouldn't be too much to ask for an unbiased comparison of the two, rather than an insistence that one or the other is unequivocally better under all circumstances.

In case anyone is wondering why I made this post, this is why...

C syntax is about as simple and idiot-proof as it can get
Is it easier to make templated, carbon copy form programs in VB? yes
Is it easier to make any other kind of program in VB? definatly not.
they're [C/C++] just superior languages
Sure -- slapping together pre-existing code to create a cookie cutter program is much faster to do in VB (that's pretty much what it was designed for)
Start with C/C++ rather than wasting time with VB before switching over.
 
man I so agree...

I use C#, not because I think it is so superior to any other language, but because that is what all of the developers where I work use and have used for 2 years. My comfort level with it has grown to the point that I don't want to go to another language.

Years ago, I did everything in perl on unix machines (web development) and at the time It was the same way...my comfort level was very high so I didn't want to change to another language. If you asked me then, I would of said that you could put a man on the moon with perl it's that good. :D But, isn't that the stance of everybody "defending" their language of choice? Sure.

I think that is what is really happening here. People have different viewpoints and seem quite zealous about a particular language because that is what they are most comfortable with. Of course others will disagree, and that's why there are the comments that you quoted.

Whatever, man. Just use what you like. Have an opinion, you're allowed. Just remember, whatever you say now about how much you like a particular language or think it is superior to another...you'll probably think something different in a few years.
 
Some people seem to hold their choice of language in almost religious like regard, if you do no use their favourite then you are wrong / stupid / smell funny or whatever other argument comes to mind.
Each language / toolset has it's uses - I wouldn't consider a device driver a project to attempt in VB (or any other .Net or VM based language) it would require ASM / C / C++ to really be effective.
Similarly most business orientated applications do not need the speed (real or assumed) of C / C++ but will benefit from the RAD featurers of .Net / Java etc.
C syntax may be simple, pointers and pointer arithmetic on the other hand is not, the fact you require it for something as simple as string manipulation sways me from using either C or C++ unless there is no other option (I'm too lazy is my problem).
The trick is to use whatever gets the job done best, being willing to change and learn new languages just adds more capabilities to your own skillset. Remeber the old adage - if you only have a hammer then all problems are nails. If you only know one language you have to solve all problems with that on language.
If you want to find a few more choice quotes on language zealotry search these forums for 'Delphi'...
 
Each language and platform has its purpose

Marble Eater, I have read many posts from you, and you seem very knowledgeable.

If you were talking to a less knowledgable person than yourself ( which you are in me )

Would you give some examples of the types of real world applications that are best suited for VB.net?

In other words what was VB.net made to do?
 
Sorry to but in, but I think this except from an essay I read really fits this post:
Programmers get very attached to their favorite languages, and I don't want to hurt anyone's feelings, so to explain this point I'm going to use a hypothetical language called Blub. Blub falls right in the middle of the abstractness continuum. It is not the most powerful language, but it is more powerful than Cobol or machine language.

And in fact, our hypothetical Blub programmer wouldn't use either of them. Of course he wouldn't program in machine language. That's what compilers are for. And as for Cobol, he doesn't know how anyone can get anything done with it. It doesn't even have x (Blub feature of your choice).

As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down. Languages less powerful than Blub are obviously less powerful, because they're missing some feature he's used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub.

When we switch to the point of view of a programmer using any of the languages higher up the power continuum, however, we find that he in turn looks down upon Blub. How can you get anything done in Blub? It doesn't even have y.
 
realolman said:
Would you give some examples of the types of real world applications that are best suited for VB.net?

I've got to be honest. I use VB because I find it to be easy, yet powerful enough to suit my needs, and I am to lazy to learn anything else. I started programming when I was little, probably about ten years old or so. From Applesoft BASIC I moved to QBasic to Visual Basic to Visual Basic.Net. The .Net framework has so many features and VB.Net has all the language features that VB6 was missing, so at this point, it seems like VB will suffice for nearly anything I want to do. Unfortunately, I have very little experience with other languages.

To answer your question, VB is probably best known for RAD. Commercial applications written in Visual Basic are uncommon, but one can quickly whip up all kinds of smaller apps in it. This is perfect for a company who wants to create apps for its own use. And with the .Net framework, there is a class for most anything you will need, minimizing the number of extra libraries you will need (this was often not the case in VB6). VB is also great for hobby programming.
 
I'll toss in my cents here...

thenerd, excellent post. I think you nailed the issue square. The problem of language superiority lies in how we think about the solutions in the language we write. I learned C/C++ first. I am extremely comfortable with memory management and pointers (even pointer arithmetic). When I first picked up VB .Net I couldn't get my head around the variable declearation concepts in the language. Once I finally figured out that all variables were really pointers in disguise, I started to understand things a little better. In the meantime, I hated VB and ended up writing a lot of VB code that is basically just like C++. Eventually I figured it out but the Garbage Collector still makes me feel really lazy.. At least C# lets you use semi-colons..

Anyway, I was biased against VB in the beginning becuase I could do really amazing things right now in C++ and I had no clue how to do the same thing in VB. It was extremely agrevating. Also, I like the curly braces and codey sytax...VB is pretty wordy.

So...I agree, to each his own and each language has it's place. VB seems to be really good for UI development (C# for advanced custom jobs) and for really cranking out a lot of code fast (mmm...code completion). The avaialbe code base in .Net (and Java) is amazing (slaps the C++'s Standard Template Libraries down hard). But at the same time, a real time system will still have to be done in C++ (not java or .net) at least for a few more years (VM can't hack it yet). And you can't understimate the power of a good ole Perl script...

The Pragmatic Programmer says to learn one new language every year. I think that is great advice so you will know what tools you have available and what the best tool for the job actually is. Then you'll never argue about which is better again -- you'll start agruing about which creates the more elegant solution...
 
mskeel said:
But at the same time, a real time system will still have to be done in C++ (not java or .net) at least for a few more years (VM can't hack it yet).
Have to disagree with you. I've been using .NET since before it was released and I think it's quite capable of handling pretty much any business application and many game genres.

Upon what are you basing your statement?
 
I think we might be talking about different things -- a small miscomunication. There's real time and then there's REAL TIME. No offense to all the hardcore gamers out there, but no FPS online or otherwise has real time requirements. I'm talking about systems that have actual requirements for real-time operation (not simply fast). Often such systems also have high availability and stability requirements. Some examples of systems that fall under this category include air traffic control systems, missile guidence and tracking systems, and navigation systems -- things that deal with a continous, high flow of data and MUST handle it as it is entered into the system. Generally speaking such a system will be running on a real time operating system such as LynxPC, though it can run on any OS and if you throw enough hardware at it, sometimes become real-time.

Anyway, the point here is that, while the CLR is great and runs nearly as fast (equally for all intents and purposes) as native code, no regular VM can meet these real time requiremetns. There are groups working towards making both .Net and Java capable of handling real time requirements, but you cannot make a real time application with the VS .net you bought off of Amazon. Currently, C/C++/ADA are the industry standards, though someday (soon) Java and .Net will become the new vogue in real time system development -- once they are a legitimate option.

.Net/Mono is not stable enough, the JIT Compiler isn't fast enough, and the garbage collector just adds to the mess. Now if you want to talk about unmanaged code, that's another story..

I'm not an expert on the subject but I do deal with it often. Machaira, you are correct, .Net is just fine for games and business applications. But that wasn't what I was referring to, again, I think we were just using the same words to describe different things.
 
Just a nitpick:
VM isn't an accurate term for the CLR and with nmake, JIT compilation doesn't even enter into it.

I work for an AGV company (Automatic Guided Vehicle). We have sites with hundreds of vehicles and applications such as hospitals, newspapers, automotive manufacturers, banks(mint/vault), nuclear power(fuel handling), etc. (not quite as hardcore as missile systems but heads roll if there're any problems) In 2003 we moved to .NET (CE for the actual robots) and currently we're preparing for .NET 2.0 (already running sims on BETA 2). So my point is that .NET can handle huge amounts of data and processing with 0 tolerance for failure or slowdowns.
 
mskeel said:
Once I finally figured out that all variables were really pointers in disguise, I started to understand things a little better.

When I started VB (VB6 to be specific) reference types gave me quite a headache until I started to learn C++. When I began using pointers I had quite the epiphone, and ever since, I've had a perfect understanding of reference types. I think every VB programmer could benefit from learning some C++. It teaches you some programming techniques and concepts that are very applicable to VB. (And then again, virtuals in C++ confused me until I began using the VB syntax [i.e. overrides, overridable, mustoverride], which makes the mechanics of virtual functions painfully obvious)
 
IngisKahn said:
Just a nitpick:
VM isn't an accurate term for the CLR and with nmake, JIT compilation doesn't even enter into it.

What exactly does nMake do? I keep seeing references to a VC++ page on microsoft which talks about projects - but I can't find out what it does exactly - especially in reference to .Net
 
Denaes said:
What exactly does nMake do? I keep seeing references to a VC++ page on microsoft which talks about projects - but I can't find out what it does exactly - especially in reference to .Net

nmake (n = native) precompiles assemblies and stores that with the GAC. Any serious .NET project should include a call to nmake in the installation app.
 
IngisKahn said:
nmake (n = native) precompiles assemblies and stores that with the GAC. Any serious .NET project should include a call to nmake in the installation app.

This would be something you do on a target persons PC when they install it, not on your own PC durring development then?
 
IngisKahn said:
Correct. One of the reasons for this is that the compiler can optimize for a specific processor instead of just compiling for metapc.

Does that work (or any similar alternative) for OS X or Linux for Mono? Or is this just PC & .Net?
 
IngisKahn said:
Just a nitpick:
VM isn't an accurate term for the CLR and with nmake, JIT compilation doesn't even enter into it.
No matter which way you put it, the .Net platform is a virtual machine similiar (not identical) to the java virtual machine. The .Net platform taken on the whole is a virtual machine. Why else would it take C#/VB/C++/J#/Fortran/python, compile it into MSIL (just like bytcode for the JVM), and require that users have the .Net framework installed on their machines for it to run? Mono is just another version of that same virtual machine that runs on multiple OS platforms as it is meant to be. When you run a .Net application, you aren't running it on WindowsXP or Linux, you are running it on .Net. An articulate fellow who put it quite well...second post.

nmake sounds really cool, but isn't that used mainly for C++? I know you can compile MSVC++ to run both natively and/or on .Net but I didn't know you could do that for C# and VB.

IngisKahn said:
In 2003 we moved to .NET (CE for the actual robots)
That sounds totally hard core. It's actually pretty cool that you guys are going full .Net. I've been dong some more research on this since the topic came up and the .Net CE seems to be the way to go for real time stability etc. out of all of them (Java is a long ways off, but the articles I found might have been old). With the project I'm working on they elected to use .Net C++ and compile it to native code. Becuase of the size of the project and the real time requriements. We basically take the same code and run it under the MVSC++ compiler and g++ for Solaris compatibility.

If you guys really want to compare a language that will blow your mind, take a look at Kennedy-Carter's xUML. Basically, it takes a subset of UML and a "programming language nuetral" intermediate language, ASL, and you are supposed to be able to create UML models and "compile" them into programs. The whole concept is "The model is the code" so you save costs on documentation maintainence and can compile verified and validated business rules (model) into any language for any platform. Check out Model Driven Architecture (MDA) for some more info on that. It's pretty wild, but I'd rather stick with strait up virtual machines for platform independence.
 
IngisKahn said:
As for the VM discussion, this is a good read: http://msdn.microsoft.com/library/?...rld06012004.asp
A good read. Thank you for sharing. I stand corrected...slightly. The whole time I was thinking managed code and really didn't think about how you can blend managed and unmanaged code -- something that is not a desirable property in a true virtual machine. I'm coming from a platform independence perspective where pure managed code is good becuase then you can run it on different operating systems, etc... Something you would have to use strictly managed code for which would, as the article points out, make it just like Java. In this situation, everything I have said is true...but .Net on the whole is not that, it is the managed and the unmanaged, you have direct access to the Windows API's if you need them. You are completely correct, where I was maybe only 1/4 of the way there.

Which brings up an interesting comparison between Java and the .Net languages. From that article... "However, many third-party Java Application Servers create a competitive advantage by judicious use of "C" function calls directly down (through Java Native Interface or JNI) into their host operating systems value-added services that are not exposed by the Java Application Platform (the Java Class Library)." So in the .Net langauges, the power is provided to make low level system calls if you choose to do so, where as in Java it is not provided at all and you must hack the functionality in with other languages. Interesting...
 
Back
Top