5

Is Python the Spiritual Successor to Visual Basic?

 3 years ago
source link: https://medium.com/young-coder/is-python-the-spiritual-successor-to-visual-basic-5b211be55bc2
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Is Python the Spiritual Successor to Visual Basic?

Two reasons that it is, and one reason that it isn’t

1*nmx7CXSWTB9SVyPdzo5nQA.jpeg?q=20
is-python-the-spiritual-successor-to-visual-basic-5b211be55bc2

Love it or hate it, Visual Basic was an iconic programming language that changed the idea of who can write code. I say was, because even though Visual Basic is still alive, it’s slid into a sad twilight period of minimal innovation and gradual irrelevance. And while Microsoft is investing in several thriving languages (C#, TypeScript, and F# come to mind), it no longer seems interested in pursuing Bill Gates’ old dream of a programming language for non-specialists.

Back when VB was thriving, it was often singled out as a good starting place for beginners. Today, if you ask what programming language a novice should learn first, you’ll get a variety of answers, but Python will be near the top of the list. (Just ask Google!)

Python and classic VB have some superficial similarities and some key differences. But in one way, Python carries on a key part of the VB dream. It manages to be both an easy-to-pick-up generalist language for new programmers, and a specialist language for important niches like data science and AI. And that tells us two things. First, there’s something special about these languages. And second, there just might be something we can learn by comparing them.

Code readability? It’s a red herring

One of the issues that often intimidates ordinary people about programming is the way code looks. VB and Python are often touted as “readable” languages, which is to say that their wordy syntax looks more familiar to newcomers, and gives them the impression that the code is easier to understand. Python also has mandatory indenting, which ensures functional code is always well formatted code. VB adds case-insensitivity, so inconsistent capitalization can’t cause any problems.

But developers know that the syntax of different languages is actually a minor issue. We might prefer for code to be more compact, concise, or arranged according to our personal taste. But once you understand the syntax of a language, they’re all equally easy to understand. It doesn’t take long to remember & means and and | means or. Curly braces { } and semicolons ; may look more technical, but they’re really just a type of carefully defined punctuation. In fact, a brace language is often quicker to read than Python or VB because the code is less crowded.

But even if Python and VB aren’t dramatically more readable than any other modern language, the perception that they are influences people. When a language advertises its easy syntax and its openness to beginners with a syntax that looks friendlier at first glance, it’s seen as more approachable. It’s more likely to be used in non-specialist settings and in education, to attract other like-minded people, to inspire communities, and to amass resources.

In other words, a language that’s perceived as simpler is adopted in different places and used in different ways. Culture matters.

The killer feature is empowerment

The magic of old-school VB wasn’t its verbose but easy-to-read syntax, or even its drag-and-drop Windows designer. The magic was that VB gave technically savvy non-programmers (people we used to call “power users”) a way to create code for their small projects. The killer feature was Office application programming, where VB developers could take control of Excel spreadsheets and Access databases with a library of objects in a VBA-powered macro. There’s a small army of people who learned Visual Basic just to automate Office.

Times have changed since Office ruled the corporate world, but there’s a similarity with Python and it’s data science specialty. Yes, there’s still a high bar to clear to become productive with data science in Python. But the language bypasses some of the low-level headaches and bookkeeping found in other languages (say, memory allocation and type management in C/C++). By staying out of the way and not adding extra complexity, Python manages to be an appealing choice for scenarios where users just need to get stuff done. Or to put it another way, it’s possible to be a data scientist who uses Python, rather than a programmer who knows a little bit about data science.

Closed-source, open-source, and community

When classic VB was in its prime, few people thought much about it being closed source. Being locked into the Microsoft ecosystem didn’t matter as much in a Windows-centric corporate world before mainstream OSS development. As long as Microsoft supported VB, and as long as the tool made life easier for its adopters, enthusiasm was high and the third-party community around VB continued to thrive.

Today, it would be madness to choose any proprietary technology over an open-source alternative. Even Microsoft has rebuilt itself to embrace cross-platform runtimes and open-source projects. Had they done that a decade ago, VB might still have its best years ahead.

Python, of course, has been open-source since its earliest days. Its first release in 1991 entered the same environment as VB, where it wasn’t quite clear how languages should evolve, expand, and fund their own development. But Van Rossum’s forward-thinking decision to distribute Python as open-source was part of a generational shift. Eventually, it left closed-source languages behind and paved the way for Python’s rise.

The final word

My personal opinions run strongly against against language fetishization. I believe that there’s a three-part recipe for programming success:

  1. Choose a tool
  2. Learn that tool
  3. Return to step one

There are occasional curve balls (functional programming languages, raise your hands), but at the end of the day an if statement is an if statement, and it’s all just carefully ordered commands for telling a box of metal and silicone how to behave. By the time you’re experienced enough to know the simplifications of one language (say, duck typing in Python), you’ll have no trouble understanding the corresponding complications of another (interfaces in C#). As long as you don’t skip step 2, and you occasionally return to step 3 for added perspective, you’ll do fine.

That said, there’s something special about a language that feels open to beginners, and something even more special about a language that’s simultaneously suited to beginner education and professional applications. I’ve seen that mix before in the fun but flawed VB language, and it’s echoed today in Python.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK