This blog is targeted at beginning / novice programmers for the Visual Basic (VB) language.

Showing posts with label IL. Show all posts
Showing posts with label IL. Show all posts

Saturday, March 10, 2007

What are the advantages and disadvantages of using VB.Net?

MSDN has a fairly decent comparison of VB.Net and C#. I would recommend checking out this link if you are torn between which languages to choose. http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87816.aspx

Advantages

  • Option Strict – Prevents unintended type conversions. This means that you cannot accidentally assign an ‘Integer’ value to a ‘String’ variable; however, this is not always foolproof. VB.Net does allow some unintended type conversions, such as an integer value could be placed in a ‘Long’ variable.

  • Named Indexers support – Examples would be properties with parameters.

  • Support of legacy keywords – Although some keywords have either been discontinued or their usages completely changed there still remains a huge amount of support of legacy keywords; this is useful for converting legacy projects to the current language specifications. Many will say that the VB.Net conversion wizard has many pitfalls; this is true, however, it does provide a starting point in the conversion process that many other languages do not provide.

  • Handling Pointers indirectly – This provides less opportunity of instability in the produced application; aka produced applications are more secure and stable.
    Cannot handle unmanaged code – This provides a more stable and secure production of code.

  • Easy to use Rapid Application Design (RAD) interface – Within a matter of minutes a complete Graphical User Interface (GUI) can be produced; thus requiring less programming time and less design time.

  • Project wizards – When creating a new project, or just adding a new form or button, the environment will automatically generate the default coding to have the objects appear; in some cases there are wizards that can provide default coding to have some functionality within the application. This translates to a working application can be designed and coded in a fraction of time than some other languages.

  • Large Talent Pool – Since there are so many programmers that know VB you can have a fairly easy time discussing obstacles you run across in your programming and find ideas on how to bypass them; in the same token you may also find a larger number of books that cover a wide variety of topics (general and specialty) and there are an enormous number of websites that cover a wide variety of topics and other means of support.


Disadvantages
  • Cannot handle pointers directly – This can be a disadvantage because there is more required coding and thought to handle a pointer. Additional coding results in additional CPU cycles; which in turn requires additional processing time; which results in slower applications.

  • Large Talent Pool – Since VB is so easy to learn there is a significantly larger pool of competition; thus, there can be more programmers applying for the same employment or project and this can ultimately drive the market value of the programmer’s services down.

  • Intermediate Language (IL) compilation – These types of compilers can be easily decompiled (aka Reverse Engineered); there is little that can be done to deter decompiling of the application, and nearly nothing that can be done to prevent it.

  • Just-In-Time (JIT) compiler – JIT compiling is the way the computer can interpret the IL compilation. This is essential to running the application. This means the target computer will be required to have JIT and that the application can receive performance degradation because of the extra CPU cycles required to use JIT.

  • Large Libraries – Because VB is an IL there is a large number of libraries required for the JIT compiler to interpret the application. Large libraries require more hard drive space, more computing time and most of all it can be a nuisance if the application is being deployed over the internet and the user must obtain these libraries in addition to the files of the compiled application.


These are just some of the advantages and disadvantages of using VB. You will find during your course of time in the programming world there are many opinions and each will have strong cases as to why to use or not use VB. I think the MSDN web article, before mentioned, says it best in that when comparing C# with VB.Net that it is a personal preference. In particular you should keep in mind that both languages have access to the same libraries and .Net structures. It will ultimately come down to syntax choices and in some cases what resources are available to you to learn the language. In both case commit to the language and look to learn others in the future to compliment what you already know.

Why choose VB.Net as your programming language

Quite simply put....choose it because it fits your personal preference. In order to answer this question there are a few things that must be understood.

There are a multitude of programming languages to choose from. It is important to understand the advantages, as well as the disadvantages of your chosen programming language. In most of my postings I will refer to designing applications; it is very important to understand that there are many different definitions in the programming world for the word “application”. In my references I will default to the definition of a software program that is intended for either productivity or informational purposes. This is very important to understand that these references are not aimed at designing games. Game programming has a whole different set of rules, methods and terminology.

You will find when talking with experienced programmers, most will have an opinion on why their chosen language is the ‘best’ language to use. From my past experiences I have found that most programming languages have its strong points for specific types of software programs. The one constant thing I have found is that just about all of the programming languages can be used to make at least 85% of the applications you will design (read the above paragraph for my definition / use of ‘applications’). I can say this with the utmost confidence because 85% of the software applications released do not require a complex set of graphics coding. You will find that Visual Basic.Net, Visual C#, C++, Delphi, and many other languages can accomplish the same ending results. The real differences in these languages are in specific features, methods of accomplishment, ease of Rapid Application Design (RAD), and coding language specifications.

You will also find that game programming has a much more distinct choice of programming language. Game programming will require a thorough understanding of the advantages vs. disadvantages of each possible language. This isn’t to say that using a program such as VB.Net isn’t suitable for creating the next top-end game; I am simply stating that you will find many more disadvantages to using a language such as VB over C++ for this type of programming.

There are no easy ways in determining what the best language is to learn; I suggest getting proficient in one at first and then slowly add on other languages that compliment your primary language. I cannot stress enough that you will find each language to have its advantages and disadvantages. I will provide a posting that will discuss these advantages / disadvantages for VB.

The major thing to keep in mind when choosing a language is your personal preference and what you feel will best suit your wanted results, rather it be to learn a language that has a smaller talent-pool to increase your market value as an employee, or you simple want to choose the language that has a huge support system (meaning many experienced programmers to talk to, many self-teaching books, etc) or you just want to choose a language that you feel is simpler to learn.

I would encourage learning VB as your first language because it is a verbose language. Once you have the basic understanding of the VB language you will find that you can read the language as though it were written as a book.