5 ms·
If Visual Basic is supposed to be for beginners, it's surprisingly complicated. It has both value types and reference types and both can be passed either by re
by ptx 4y ago
If Visual Basic is supposed to be for beginners, it's surprisingly complicated.
It has both value types and reference types and both can be passed either by reference or value, giving four ways of passing parameters compared to Python's one way.
It has both early and late binding, compared to Python which again has only one kind.
It has "default properties" on objects, which lets you sometimes use some objects directly in place of some of their properties but sometimes not.
It has different syntax for function calls in expressions and statements, combined with a completely redundant third way (the "call" statement) that confuses matters further.
And in addition to being both statically and dynamically typed (with "Object" declarations) it's also both strictly and loosely typed (with Variant values).
- mynameisvlad 4y agoIt was also created 16 years before the first version of Python, 36 years before Python2. It was written in time with completely different paradigms and the two languages weren't even built with the same design considerations in mind. Obviously, newer languages are going to tend to be easier to work with for beginners, that should be a given. We've made massive improvements in the field in the last few decades.
- quietbritishjim 4y ago> Obviously, newer languages are going to tend to be easier to work with for beginners, that should be a given. The whole point of this comment chain is to discuss whether BASIC was easy to use so it's clearly not a given.
- mynameisvlad 4y agoHow does BASIC being easy to use or not have anything to do with newer languages being easier to use? Newer languages have the benefit of hindsight and rapidly improved technology. Better graphics, more power, fewer of the heavy limitations that came with early technology. Between the time that BASIC and Python first came out, we went from System/360 mainframes to Windows 3.0 on our home desktops. Obviously newer languages are going to be able to take advantage of this increased power and wider abilities of computers. It should be plainly obvious to anyone who takes more than a second to think about it.
- Dylan16807 4y ago> How does BASIC being easy to use or not have anything to do with newer languages being easier to use? Because "easy" is a somewhat relative term. The category will shift over time.
- mynameisvlad 4y agoDid you bother to even remotely read the comment you replied to, which says the same thing? The category shifts over time, sure. But what does that have to do with BASIC being easy or not? They're two separate topics.
- Dylan16807 4y agoLet me be clearer. The category changes and the changes can often be applied retroactively. "In hindsight, that wasn't actually easy. It was a massive opportunity for highly motivated learners, but the amount of motivation needed was more than what can fairly be called easy." I'll compare to an early bicycle with no pedals. They were a breakthrough at the time, but in hindsight they hadn't reached "easy". And just like making a better bike, plenty of the issues with BASIC could have been fixed on the equipment of its heyday. And it's not just that things improved over time and you need to be new. There are very old bikes that are plenty easy. But it took a while to figure out.
- ptx 4y agoScheme was created 16 years before Visual Basic and has none of these problems, so I don't see what the age of the language has to do with how difficult it is to understand. (Also, Python and Visual Basic were actually both created in 1991, so they're contemporary.)
- deleted 4y ago[deleted]
- mynameisvlad 4y agoBasic was created 11 years before Scheme, and VB was itself derived from Basic, so would have had much of the same design decisions and considerations as a result.
- ptx 4y agoThe question I was addressing was whether it was "easy to understand". I'm sure there are explanations for why it's such a complicated language, such as e.g. the "call" statement probably being there for compatibility with QBASIC which required it in some corner cases.
- deleted 4y ago[deleted]
- mcbishop 4y agoA strictly-enforced style guide can remove that confusion. My struggle with VBA is mostly around idiosyncracies in the Microsoft Excel object model (e.g. a "window" object has members for both the entire workbook and for a single worksheet).
- CydeWeys 4y agoAnd don't forget subroutines vs functions. Yet another pointless distinction that makes things harder and resists refactoring.
- lproven 4y agoFunctions return a value. Subroutines don't. Is that a pointless distinction? Why?
- CydeWeys 4y agoIt is. The way the two are defined/called us different, making refactoring a nightmare if you ever have a subroutine that later needs to be converted to a function to return a value. There's a reason other languages don't make this distinction. In every other language I'm aware of, it's all functions, and some return values and some don't, and refactoring between the two is easy.