Evoluator


Learning a new programming language is as hard as learning a new language. Most aspects of learning a new language could be point of simile when it comes to learning a new programming language.


Indeed before the brain starts making the necessary connections between its different parts it will take a while, however, a programming language like VB is much more simpler to learn because the language is some form of written English which large number of people know. This is one of the most important aspects of VB which makes is ideal for students. This is not a random fact as during the 1960s Basic (Visual Basic is some sort of Basic) was created to be the programming language that students learn and hence it took advantage of the fact that most English speaking students would already know the language which in turn makes learning a programming language with English as its infrastructure more simple

.

But why should we learn VB Or should we not Of course as discussed above learning VB is simpler than most other programming languages, however, is it capable of performing all the actions that one could perform with other languages Well the answer to this question is not as straight forward as one might think, but if the language is easy to learn why do other people learn other languages I think the reason for this is that other languages could provide a better efficiency and performance with some advanced features. So when some advanced coding skills is required VB comes to a dead end at the present time.


I¡¯ll give you a simple example from my personal experience. I coded two identical programs in VB and C#, so both were based on .NET 3.0 and compiled with Visual Studio 2008 beta 2. Then I created a .dll of both codes and linked them to one other code which was able to use the code in the .dll. I then calculated process speed for both codes the results are staggering (They are average results):


VB .NET: 520 KB/s

C# .NET: 934 KB/s


I have to say that the .dll only plays a small part in the program. So when the above data is analysed we could conclude that the .dll produces by VB runs slower than the one produced by C#. So ¡°why learn VB at all ¡±. I don¡¯t mean that one should not learn VB but I am trying to say is ¡°what is the point of learning VB ¡± While the same time could be spend learning a language like C or even better C++; which in turn would virtually work on any operating system!


If you are planning to learn VB ¡°DON¡¯T¡±. Because as you develop new coding skills you would find that VB is limiting your abilities. At this time you will be looking for a new language and indeed you need to start learning from scratch. This means all the time spend becoming fluent in VB was nothing but waste of time. This is only my personal opinion about the language. The first language that I have leant was VB. And I have to mention that I truly respect everyone that codes in VB and everyone else who doesn¡¯t.



I welcome any critisism, spelling mistakes or any other type of comments and I would like to think why I might be biased towards this isuee.



Thanks you






Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

Evoluator,

I love our discussions but this post is patently absurb. All languages have their tradeoffs and there's no doubt about that. I have worked professionally in many languages many of them much more complicated than vb and I still like vb.

The two most functionally similar languages in the world are C# and VB because they both use the CLR and the same CLR classes. There have been claims the C# is faster but it close scrutiny has shown that the claims did not bear themselves out.

You are learning VB. I've been writing vb for about a decade now and I'm still learning VB. But we are in different places in our learning and I don't believe you've had time to fully embrace the fundamentals in order to really critique vb. You're questions here have been at a pretty basic level as far as architecture and practice is concerned. There have been questions on Buffering both single and double, etc, etc, etc.

There is a lot that your post leaves in the question. Perhaps your post should be called, "Why I should have learned VB before I wrote a large project "

"Then I created a .dll of both codes and linked them to one other code which was able to use the code in the .dll."

This should be re-stated as:

"Then I created a .dll of both pieces of code and linked them to other code which was able to call the code in the respective .dlls.






Re: Visual Basic Express Edition Why you should not learn VB!

Evoluator


"This should be re-stated as:

"Then I created a .dll of both pieces of code and linked them to other code which was able to call the code in the respective .dlls."


Indeed I have had made an implicit assumption that this is the only procedure which I would have been able to use the .dll.


But my main concern is I have noticed great speed increase when the code is written in any C or C++, although it is much harder to code in C++, but my cryptography code which was written from scratch in VB is hoplessly slow that I couldn't even bother encrypting files larger than 1MB. But the same code only "translated" increased the speed twise!


I re-emphesize on "translated" because I didn't make any modification to the code. And if you argue there is better way of writtin the code in VB I will tell you that I have optomised the code in a way that most functions could not be stireped down further (not in bluck of code but rather the processes required). I challenge you to optomise the code further, if you are at all interested. You write the code in VB and I'll use C#, and see which code would be the fastest. Deal











Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

"But my main concern is I have noticed great speed increase when the code is written in any C or C++"

Of course you have. They are (usually in the case of C++) native mode code. But C and C++ are do not use the clr. They are not managed and are not particulary secure. They are also both very primitive. They may run faster.... but I can produce far more, more secure code in VB than you can in C++ and C.






Re: Visual Basic Express Edition Why you should not learn VB!

JohnWein

I use VB because I can produce a working program in about 1/4 the time it would take me to code the same program in C. If I need to speed up the program, I write the critical section in C. Using C and Assembly, I can code critical sections to run up to 100 times faster than managed code. I see no difference between coding in VB.Net and C#. I'm just more comfortable coding in VB. I can convert the VB code to C# using the Tangible Software Solutions translators. When I time VB.Net and C# code of the same function, I get approximately the same time to run the function in either language.





Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

I agree with everything John said. I've written thousands and thousands of lines in assembler, on mainframes. I don't like the Intel instruction set. But in my experience, I've noticed that if you have a DLL interface, to that fast code, the interface and context switching will slow you way down. So if you are going to do something in a DLL, design it so that do most of your repitive processing in the dll. Because calling a DLL over and over again will slow you down.

For the last thirty years there has been a debate as to whether humans can write faster code than a good optimizing compiler. I believe in the long run we can't and that we will lose out to a good compiler. At DEC our high level system implementation language had a seven pass compiler. It produced rather incredible optimized code. I understand that that the Microsoft compilers are two pass compliers and the claim is that you can get all the optimization you need in two passes. I remain in the question about that.






Re: Visual Basic Express Edition Why you should not learn VB!

Evoluator

Indeed,

John;

I have never critisised the VB programmers but VB learners. Since VB is extreamly simple in comparison to other languages, it gives you lazy habits which in turn could potential reduce the quality of the code produced. I have to mention C# as an example, but my main point revolves arround C++. Although it is harder to code but it is faster and more efficinet. Also with languages like C++ one could be more creative than VB.

ReneeC;

That is the point, I have actually maid some mistakes in my first thread here. The C# code used a .dll, while the VB was embeded code. This means that the C# code would have been even faster than the VB. This actually is the point I am trying to make: "Why learn a language that is slower than other languages Why not learn C++ from scratch "

As I said I don't disagree with people who actually code in VB, but the learners would learn a language and when they want to extend their abilities they need to learn a new one.

Am I making sence






Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

No you aren't making sense. No one but you is claiming that VB is slower than C#.

Why learn a case sensitive language Why learn a meat and potatoes language. I've ways thought C# should be outlawed.






Re: Visual Basic Express Edition Why you should not learn VB!

Carsten Kanstrup

The code speed has nothing to do with the language - it is the implementation, which counts. The language, which is slow today, may be fast tomorrow. For example, I have compiled exactly the same code in Turbo Pascal and Free Pascal and the Free Pascal code runs approximately three times faster!

Also, it is not a law of nature that VB is always managed. This is just the way Microsoft has chosen to do it. You can find almost the same VB syntax in Fortran 95 and can actually use Fortran 95 as a replacement for C++ for native applications. Intel has a very good Fortran 95 compiler, which integrates directly in the .NET IDE, and can be used for that (according to Intel). I will probably try this for programming drivers in the future.

I think that it is important to choose a language, which is as easy to overlook as possible, because the limiting factor is the human brain. Even the most cryptic language may be compiled, but if you cannot overlook what you are doing, there may be dozens of logical errors in the program meaning low reliability. Just look at Windows XP and Vista. They are programmed in C#. Are you impressed by the safety and speed I am not! Maybe a language with better readability could have reduced the number of safety holes

It is only if you want to be a professional programmer that you should consider C - simply because there are many more C applications than VB or Fortran 95.

Let me suggest the following to the VB team: Why not make it possible to use both VB and Fortran 95 syntax in the next version of the compiler The difference is so small that this ought to be quite easy and together we are much stronger and can make a real alternative to the terrible C style languages. Alone, VB will probably never be anything than a pure Microsoft language.





Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

" Intel has a very good Fortran 95 compiler, which integrates directly in the .NET IDE, and can be used for that (according to Intel). I will probably try this for programming drivers in the future."

WOW !!!!!!!!!!!!!!! I used to LOVE fortran but then I got into BLISS. Does this compiler cost anything

I'd never use Fortran for a driver... and then again, I'd never use C either. I have a hard imagining Fortran in OOP though. How do they deal with Fortran common Most people don't realize that member variables are the exact same thing.






Re: Visual Basic Express Edition Why you should not learn VB!

Carsten Kanstrup

http://www.intel.com/cd/software/products/asmo-na/eng/278834.htm

Unfortunately, it is not free - $280 to $1600 depending on version, but I have seen a benchmark of Fortran compilers and the Intel one (Visual Fortran 9) generated the fastest code (very optimized) and version 10 is probably not worse.





Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

That is really cool.

Did you know there is also a Cil compiler so you can actually write in the Clr Intermeditate language:

"The .NET SDK includes an assembler program for CIL named ilasm.exe. Programs written directly in CIL are just as managed and just as portable as programs written in C#. Of course, most .NET programmers don¡®t know any CIL at all, and even fewer know enough CIL to be able to actually code in it. However, it is sometimes instructive and revealing to examine the CIL that the C# com-piler emits, and in this book I¡®ll occasionally call your attention to it. "

Charles Petzold.

http://www.charlespetzold.com/dotnet/DotNetBookZero11.pdf






Re: Visual Basic Express Edition Why you should not learn VB!

Carsten Kanstrup

ReneeC

Thanks for the information and the book link.

It as actually a pity that there has never been any development in the assembler language. It is still Move A, B although you could easily write A = B (Intel) or B = A (Motorola) and still generate equally optimized code. When I program in assembler, all comments are in pseudo high level language and the program is fully structured with e.g. IF-Else-EndIf constructions. I will try to look at ilasm the next time I am going to do something very time critical.





Re: Visual Basic Express Edition Why you should not learn VB!

ReneeC

I have done assembler on the intel platform but I really didn't like. The VAX architecture was so vastly ahead of the 8086. It was not an acumulator architecture. You could do math from all registers and from memory and all registers could address memory. There were 400 instructions in the instruction set, (including a Polynomial F and packed decimal instruction as well as cotext switching instructions. Not only that there were movc3 and movc5 instructions capable of moving large numbers a characters in a single instruction. I've always felt vey limited programming in intel assembler.




Re: Visual Basic Express Edition Why you should not learn VB!

Carsten Kanstrup

Me too. The Intel architecture is absolutely awful. That's one of the reasons why I prefer e.g. the Motorola microprocessor family like 68000, ColdFire etc., which also have a general usable register set without accumulator and paged addressing, but it could easily be even more optimized and the assembler language is still very old fashioned.