I need to make a confession. Before I became a respectable developer working with such modern languages as C # and Java (and that turbulent chaos known as JavaScript), I was a keen fan of the incredibly popular and clumsy
Visual Basic .
My love was sincere. Back in childhood, I learned to program in the BASIC language. But not just BASIC. I started with a terrific Microsoft environment called QuickBASIC on an ancient DOS operating system. I still remember how I typed white text on her cheerful blue background.
For programming in 1988, QuickBASIC was a magic thing. You could write code without bulky line numbers, catch syntax errors in the dialing process, and run programs directly from the development environment without having to fuss with the command line. After finishing the program, you could share it with your friends with the help of these guys:
')
Nowadays, QuickBASIC has remained just one more curiosity from the distant past. Is it true though? An innovative project called
QB64 has created a modern replica of QuickBASIC. It runs on Windows, MacOS and Linux, and does not require an emulator. When you run the program in QB64, the environment performs a clever trick - first, it translates the BASIC code into C ++, and
then compiles it.
Classic VB and Visual Era
QuickBASIC was an impressive medium for distant text-based computer systems days. But that all changed when Microsoft released Windows and plunged PC users into the graphic world of buttons and clicks. Simultaneously with the release of Microsoft Windows 3.0 (the first version that achieved true success), Visual Basic 1.0 was released.
It was something completely new. The user could create buttons for programs,
drawing them on the surface of the window, like on an artist's canvas. To force a button to perform an action, it was enough to double-click on it in the development environment and write the code. And the code was not written in mysterious C ++ with heaps of classes, complex memory management and incomprehensible Windows API calls. You, as a civilized person, wrote code on a friendly-looking VB.
All these graphic gadgets were impressive, but the real secret of VB's success was its practicality. There was simply no other tool in which the developer could sketch out the full interface and start coding as quickly as in VB. And while historians like to speculate about the
visual part of Visual Basic, its inimitable skill had nothing to do with graphic widgets. VB became famous thanks to the legendary edit-and-continue function, which allowed developers to launch programs, find errors, fix them, and
continue working with the new code. This was strikingly different from almost all other programming environments known to mankind, forcing developers to compile work again and to start again after each change.
The original Visual Basic flourished for about a dozen years. Having emerged as a friendly environment for beginners, it has become a tool that has enough opportunities for serious programmers. By the time of release of VB 6 - the latest version of classic Visual Basic, in the world, according to rough estimates, there were ten times more coders on VB than on severe C ++. And they didn’t just create toy application layouts. Visual Basic made its way to the offices of companies and even to the Internet with the help of ASP (Active Server Pages), another monstrously popular technology. Thanks to it, you can create web pages that can communicate with VB components, communicate with databases and write HTML on the fly.
All this happened with virtually no structure, unless you decide to create it yourself. It was an unwritten Visual Basic rule - it gave you freedom, which you will regret later.
The problem of the classic VB
In many circles, the classic VB had a bad reputation. OOP fanatics often complained that VB lacks support for inheritance. (It was a strange complaint, because inheritance is often a great way for inexperienced developers to shoot themselves in the leg - this particular VB feature was
not required.) In fact, classic VB did not have a tendency towards object-orientation. By the end of his life, he had already supported interfaces, polymorphism, and class libraries. All of this was borrowed from COM, the fundamental part of component technology “stitched” in every version of Windows.
The real problem with the classic VB was that it was
too successful. He reduced barriers for new programmers so effectively that practically anyone could work in it. Carefree newcomers, tired employees of the companies and students solved problems that on any other platform would be much more difficult, and hung spaghetti code everywhere.
In other words, since VB was fairly easy to use, even if you did not study as a programmer, it was used by many people who
did not learn to be programmers. And VB did nothing to prevent them from rooting their bad habits.
VB.Fred and .NET platform
Fast forward to 2002: Microsoft is doing what Microsoft does best - destroying its own ecosystem of developers, introducing a completely new way of working.
This time the project was a large-scale change in the architecture of COM - component technology, which served as the basis for Windows (and indirectly also classical VB). It was an all-in rate for a megalithic company that had already made such risky changes several times.
Microsoft called this “reboot” the .NET platform for many dubious reasons, including because Internet technologies at that time remained fresh and exciting, and also because .NET included the web services feature that Microsoft firmly decided to promote. The product was created under the strong influence of Java and had a full range of tools for communicating with databases, creating websites, writing multi-threaded programs, setting up connections through sockets - for almost all applications that business developers could imagine.
The only problem was that in order to implement all these functions, Microsoft had to get rid of almost all the classic VB.
If you squint hard, the new version called VB.NET looked almost the same. But many large and small revolutionary changes appeared in it. Large: old programs on VB remained imprisoned in the world of old programs, and the surprisingly weak migration wizard could hardly fix it. Small: programmers on classic VB had to get used to the new way of counting the elements of arrays. They could no longer start with 1, like ordinary people. Now they had to start from 0, as official programmers.
Another important change: no more edit-and-continue function.
Developers love to complain, and VB developers are especially known for this. Almost immediately, a group of influential VB developers dubbed the new Microsoft programming environment VB.Fred to emphasize the fact that this new language is not Visual Basic.
What doomed Visual Basic to death
You can assume that the changes in .NET caused cracks in the VB foundation and led to the onset of an inevitable decline. But it was different. In fact, despite the fact that VB.NET moved in a new direction and made critical changes that made the “orphan” an absolutely good code of the classic VB, it gained immense popularity. This happened due to the fact that VB.NET gave something that developers previously could not achieve with classic VB - respect.
In the .NET world, VB and C # languages have the same weight. Each line of VB code can be translated into an equivalent line of C # code, and vice versa. Both languages have the same capabilities, use the same components, and compile into a completely identical form (into something called
an intermediate language ). VB is finally freed from its “ugly duckling” syndrome.
But turning into another respectable programming language created a problem. Lost the enthusiasm that made VB the favorite language of such a vast group of people. Not because VB has changed, but because C # has changed.
As soon as VB got the same power as C #, C # also took over the convenience of Visual Basic. For example, the presence of type-safe and .NET memory management functions meant that C # developers would no longer have to worry about memory leaks, like VB developers.
In other words, C # now has a “safety net” that protects amateurs, students, and newbies, while not weakening its power. Suddenly, VB has ceased to be something special. It has become just another tool from the skill set of a programmer.
The current state of Visual Basic
Today, Visual Basic is in a strange state. Among professional developers, it takes about 0% of attention - VB does not even appear in
surveys of professional developers or in
the GitHub repositories . However, it is still alive - it manages Office macros, old Access databases and ancient ASP web pages, and also attracts newbies to .NET. The TIOBE index, which assesses the popularity of languages by search results, still places VB on the
top five most discussed languages.
But it seems that the inertia of language development has recently ended. In 2017,
Microsoft announced that it would begin to add new language features to C # that may not appear in Visual Basic. This change does not return to VB the status of “ugly duckling”, but harms its status as part of .NET.
Frankly, the trend of pushing VB to the side of the road began a few years ago. Serious developers know that the key parts of .NET are written in C #. They know that C # is the preferred language for presentations, books, courses, and workshops. If you want to speak VB, it will not harm the applications you create, but may limit the ability to communicate with other developers.
One of the niches in which Visual Basic should feel natural is the educational market. But even there he remains a black sheep. Modern languages like C # and Python are simple and safe enough to be chosen as the first language to be learned. If you need something simpler for children, the market is full of tools for graphical programming like Scratch. The languages with braces: C #, C, JavaScript and Java also have their attraction. They have a similar syntax, and a person who has learned one of them will feel confident with the other.
In the area of web development, Microsoft looks into the void of missed opportunities. Who would not be seduced by the VB version, as easy to work as VB 6, but also capable of compiling into JavaScript and combined with the HTML form designer? Yes, you can’t create new Google Maps in such a tool, but it could revive the attractiveness of Visual Basic by allowing business developers, students and amateurs to create simple online applications without having to use cumbersome JavaScript. Instead, Microsoft created a VB-based product called
LightSwitch , which disappeared with the death of the Silverlight browser plugin. If Microsoft starts creating another product for the coding for the masses class, then it will most likely be a template-driven tool with a small amount of code like
PowerApps .
Visual Basic has always faced various dangers. But this time, it seems, everything is different. It seems that the sun is actually setting for one of the most popular programming languages in the world. If this is true, then Visual Basic will not fade out over the decades. It will become another legacy product, an underestimated tool without the love of users and the future. Whether we have lost something special, or have simply removed outdated technology from torture, you decide.