Is Visual Basic a Good Beginner's Language? 1100
Austin Milbarge asks: "Ever since the .NET framework came along a few years ago, Microsoft had promised VB developers that their language would finally be taken seriously. To be honest, I never understood why some non-VB developers thought of VB as a 'toy' language, but that is for another article. Anyways, Microsoft made good on their promise and transformed VB from an easy to learn language into an object oriented power house, with lots of OOP functionality thrown in. The old VB has been discontinued, and the new VB is no longer a simple language. With all the fancy changes, is VB still the great beginner's language it once was? Would you recommend it to a beginner over C#?"
My experience (Score:1, Informative)
Free Pascal (Score:4, Informative)
Object Pascal is a good language for beginners. It has strong typing and object-oriented features, but the typing isn't strict to the point of being obnoxious like in Java. It is lower level, so you will deal some with pointers and memory management but it is harder to make a mess with than C/C++. You can also visually design the UI of your application, but the language isn't a disaster like VB (and doesn't run in a VM like C# or Java, so it's quick).
Edsgar Dijkstra (Score:1, Informative)
For other possibilites: I'll suggest Ruby. Not because it's a great language (all have their own issues) but specifically because of this "Poignant Guide"
http://poignantguide.net/ruby/ [poignantguide.net]. I found it a wonderful way of approaching programming from a very NON-technical manner... not just that it's amusing (the author has the same off-beat humor as myself), but because it relates common Object Oriented concepts to real world examples better than I've ever seen before (specifically the whole section on English grammer: verbs, nouns, adjectives becoming methods, objects and attributes).
Don't think of the anti-VB sentiment as "throwing the baby out with the bathwater" think of it as "no matter how pretty the architecture... if the foundation is crap, the building will fall".
Comment removed (Score:5, Informative)
Re:Bad idea (Score:2, Informative)
And how will a new programmer understand how to use that option, why it should be on, or even what it does? If you've got them in a classroom, you can force all the machines to be configured that way, but how much of their education will consist of them screwing around at home?
Not to mention the fact that newbies can be dangerously clever. If their program doesn't compile, they're going to work hard to make it compile. At some point they might start fiddling with compiler options. (*Shiver* I remember doing stuff like that. Not a good idea.) Once they figure out that turning off that option makes their programs compile (and run flawlessly!), they'll take it to heart that they always need to do that. They *might* read up on what the switch does, but since they don't understand it, they'll assume it's an "Experts Only" thing and keep it off.
Before you know it, all your classroom machines will have their settings reversed. Oi Vey!
Also don't think that what you consider to be the pinnacle of all languages to be the easiet for someone else to learn.
I actually recommend BASIC (the real thing) to start off with. See my other posts in this topic for more info.
Comment removed (Score:3, Informative)
Re:In the next episode of Ask Slashdot... (Score:3, Informative)
No, there was such a thing as Visual Basic for DOS. I wouldn't blame you for repressing any memory you have of it :). It's mentioned in this Microsoft Knowledge Base article [microsoft.com] about preparing Visual Basic applications for Y2K. I quote:
Re:Why not both? (Score:5, Informative)
There is a lot of devil in the details of that almost, however. C# has developer API comments yet VB.NET does not. VB.NET has more support for shadowing than C#. C# has useful convenience functions like using that VB.NET does not. VB.NET has convenience functions for late binding (considered harmful) and case-insensitive string comparisons that C# does not. C# has more object oriented features such as operator overloading that VB.NET does not. The list goes on and on.
Re:Bad idea (Score:5, Informative)
I totally disagree. Difficult? Complicated? Sure, but not mean. People who have learned assembler are the ones who understand why
will usually run faster than even though both are conceptually identical. There are many things that seem perfectly reasonable in high-level languages that turn out to be a really bad idea once you learn what's going on in the hardware. I'm sure it's possible to learn that stuff without hitting the metal a few times, but I've never, not one single time, ever met someone who's done so.Re:still C (Score:3, Informative)
If you don't know this yet: Use < for < and > for >
Re:Why not both? (Score:5, Informative)
Re:Why not both? (Score:3, Informative)
Re:Visual Basic is horrible; use Python (Score:4, Informative)
Re:Why not both? (Score:3, Informative)
That's not entirely true - VB has its own set of libraries, and the .NET systems were designed to be (as much as possible) language-agnostic, rather than "designed for C#". This is a pretty major benefit of the CLI - it was designed with many OO langauges "in mind", and works pretty much as well with all of the languages it ships with (and, happily, they mostly interoperate with one another).
I hate VB, but .NET does at least make it a fairly serious tool. Some people find Basic easier, or it's what they're used to, so I don't see a particular reason to stop them using it (I gave up trying to "educate" people years ago). VB.NET is, despite how it may look, a pretty clever language in a lot of ways.
I hate coding in it and reading code examples for it though. Makes my blood boil. But it's quite a difficult tool to dismiss.
No. Absolutely not. Learn Python or PHP. (Score:2, Informative)
The problem is that to do anything in the Microsoft family requires continual financial investment. Visual Studio itself (standard edition) is $299. As you learn to program, you'll probably want to program what's called "Client / Server" applications. You'll probably want to buy SQL Server ($6000 for the Standard Edition), Windows Server ($1000-ish). As you develop, you'll always find that you need other products that you don't have, and you'll always be trying to decide is it worth buying the product to learn how to do things.
Alternatively, you can learn how to program in the open-source environment. You'll find wonderful, free development tools. You'll find a community of people eager to help you learn (rather than paid support options). And, once you learn how to program this way, you'll be able to deploy real applications, without paying high licensing fees.
I remember, when I started my first company, we were a Microsoft shop, and I wanted to give away some of the technology I had written to non-profits, but I couldn't because they could not afford the licensing fees.
If you want to program a web-based application, I would install linux and apache-ssl and learn PHP. If you want to program an application to run on a client-computer, I would learn python. Both are very elegant languages that are easy to learn and have huge developer communities that are very helpful. These environments are very good investments of your time, easy to learn, and will prepare you to not have to change courses later on.
Java or C# (Score:2, Informative)
Now, the argument that will probably pop up to correct me is that VB.Net uses the
My next big rant would be that VB.Net will spoil a new developer on expecting everything to read immediately like plain English. Don't get me wrong, now, that's one of the nice things about VB. If Then... Gotta love that, except... If they get spoiled by this, then they are forever stagnated in VB. I have one developer I work with, every once in a while, who simply refuses to transition to any other platform just because he is locked into VB's syntax. A syntax which is unlike 90% or better of any other languages out there.
Java, C#, even PHP and Perl, share more in common in syntactic terms than VB does. Start a new developer out on a platform that will foster a better understanding of other platforms, instead of locking them in like VB tends to.
<Disclaimer>I made my living for years doing VB, but not by choice. I'm a dyed-in-the-wool C programmer, who prefers Java these days.</Disclaimer>
1999 called, and they would like there VB back... (Score:3, Informative)
Not anymore
* VB is badly OO and OO is a bad paradigm to first learn to program in (and those two wrongs don't make a right).
It is nolonger bad OO and OO is a good paradigm to learn to program with.
* VB ties you down to using Windows, and Windows is a bad environment to learn to program in.
Acutally, it ties you to
* VB does memory management the wrong way from a learning perspective. Rather than specifying allocators and destructors when neccessary you simply let objects fall out of scope.
Which is how things are done now. However, you can implement garbage collection for those time when it is critical to do it now. However that is an indicator of either poor design, or that you should be using code that is clser to the machine.
* VB does not have first-class functions and cannot fake them: function manipulation and functional paradigms (whether direct or through hacks to fake it like function pointers or true reflection) is crucial to learning to program well and should be started as early as possible.
You can do this in VB
* VB teaches bad, verbose naming and programming habits.
That has nothing to do with language, however accurate verbose naming is far better then short obscure names.
Verbose programming habits in application development is a good thing. Not the best, but certianly better then implementing somme little know technique that is hard to deciphire jsut ecasue it saves a 1/100 of a second.
Funtion oriented programming languages are a poor place to start. The habitrs generated in those create very bad habits in OO programming.
All but two of your recommendations are total useless for real worled practicality.
Delphi is alive and well (Score:3, Informative)
Beholdeth the Open Source Power, that it doth keep languages from the grave!
No longer accurate... (Score:3, Informative)
VB.Net:
Dim x(10) As Integer
'populate x
Redim x(20) As Integer
C#:
int[] x = new int[10];
Array.Resize(ref x, 20);
Personally, I'd have to say the C# variant is the simpler one now.
Visual BASIC as a beginner language (Score:4, Informative)
Visual BASIC.NET was a rewrite of Classic Visual BASIC, which added in C++ type error trapping, objects, and other things that many have criticised Classic Visual BASIC for not having. Many VB developers want Microsoft to continue to support Visual BASIC 6.0 or Classic Visual BASIC, but Microsoft wants to move on.
BASIC stands for Beginners All Symbolic Instruction Code, the first word is for beginners. It was not designed to be anything but a learning tool, like Pascal, Pilot, and many other languages were designed to be. Microsoft used it for early Microcomputers, and then made a GW-BASIC version of it for MS-DOS and then later QBASIC or Quick BASIC for MS-DOS 5.0 and above. Many considered GW-BASIC and QBASIC to be free versions of BASIC and developed for them. Microsoft released Visual BASIC 1.0 and many BASIC developers adapted to it. I recall learning MS-Access 1.0 and using a form of Visual BASIC for applications for it, which they called Access BASIC or something.
Borland picked up the Pascal craze, in colleges they taught Pascal for data structures courses. There was UCSD Pascal, but Borland came out with Turbo Pascal and it worked faster than most Pascal compilers. Object Pascal became Delphi by Borland, and it is still popular and a competitor to Visual BASIC. Free Pascal tries to use Object Pascal to be more like Delphi and the Lazarus project uses an IDE with Free Pascal to work like Delphi or Visual BASIC.
I think there is an XBASIC out there that works like Classic Visual BASIC. Someone made a GNOME BASIC. The Novell Mono project has a Visual BASIC.NET language which is used on Windows, Linux, Mac OSX, *BSD Unix, etc.
The whole argument against Visual BASIC is now moot. Classic Visual BASIC lacked proper OOP, but Visual BASIC.NET fixes that, but at the cost of learning new programming methods and syntax for Classic Visual BASIC developers. While designed for beginners, Visual BASIC has extended itself. Visual BASIC.NET uses a compiler very much designed like C# or C++ to compile into IL (Interprited Language) code (which is like assembly language) to run on the
You will be shocked to find that most businesses use Visual BASIC.NET for the same reasons that they used to use COBOL, it is easy to learn, uses English words, and almost anyone can learn it.
Still don't discount C#, C++, Java, Python, Perl, and many others, they can interface with Visual BASIC via the
Re:In the next episode of Ask Slashdot... (Score:2, Informative)
NO! (Score:2, Informative)
And worst in 2006...
Some reasons:
- Lack of natively data structures and powerful objects.
- To build new data structures you need to focus in the language and in the problem, not like C when you can focus on the raw problem/algorithm.
- No real OO, just COM Native.
- No multithreading.
- Bureaucratic syntax to do very simple things (i.e: adding a new element to a sized dimmed array, writing to files, etc)
- Weird syntax (like putting and underline to specify object's events)
But, it has some interesting properties:
- Rapid testing of COM/ActiveX Objects.
- Rapid development of COM/ActiveX Objects (for example: Office Addins)
But for learning... think in another language.
Re:TwIPS (Score:3, Informative)
Well, yes and no. I originally ran into TwIPS when taking programming classes at St. Louis Community College. Like, you, I've been completely unable to find any reference to it since then, so I wrote my own. I'd be happy to hand my code base over to anyone who feels like working with it, or drop it onto something like SourceForge.
The twelve instructions are Go, End, Move (copy, really), Jump, Conditional Jump, Subroutine Jump, Return, Add, Subtract, Multiply, Divide, and Print. Ok, that's really eleven, but I couldn't remember what the twelfth one was when I recreated it. It uses a 1000 character text array that acts as your entire memory space. You have to allocate buffers, create your initial variables and strings, and store all your code in that space. It will start execution at location 000, the Go was just something that I remember them including, so I did, too.
I don't think I have any of the exercises I had my students do written down, though, so you'd have to make up your own. It's not too hard.
Re:Visual Basic is horrible; use Python (Score:3, Informative)
Firefox has a great JS console with a log of recent errors, rather than a nasty modal window that pops up every time something goes wrong. And if your students are ever doing a DHTML project, the DOM inspector is a godsend.
Re:Why not both? (Score:3, Informative)
C# has useful convenience functions like using that VB.NET does not
VB.NET has imports which is mostly the same as C# using. It lets you short cut your code, but does not allow aliasing like C# using.
VB.NET has convenience functions for late binding (considered harmful) and case-insensitive string comparisons that C# does not.
VB.NET string comparison is case sensitive by default. Ex "abc" = "ABC" would evaluate as false. In C# or VB.NET you would perform case insensitive string comparisons the same way, either using string.tolower(or
C# has more object oriented features such as operator overloading that VB.NET does not
VB.NET in
C# has developer API comments yet VB.NET does not
There are about a dozen free addin for visual studio to perform this task.
Re:Good ... for what? (Score:3, Informative)
-VB.NET code will run on freebsd and linux
-VB.NET has no known "stability" issues, as it generates mostly the same bytecode C# does
-VB.NET is strongly typed as long as you set "Option Explicit On," which everyone does.
Now, I dislike VB.NET, but due to its syntax. Sub/End Sub instead of {} just bugs the shit out of me.
Oh no. Oh Hell no. (Score:2, Informative)
I don't have a link on hand. But I recall reading Microsoft reps touting VB.NET maintining the VB6 ability to "code and debug until the code works". To me that should be sufficient reason to not use VB.NET. If you want another reason, please excuse my following rant.
The language is not isomorphic. For example:
'2 ways to declare an array of types.
Dim s1 As String() = {"1", "2", "3"}
Dim s2() As String = {"1", "2", "3"}
'2 Different ways to instanciate a class
Dim o1 As Object = New Object
Dim o2 As New Object
'Support for
Dim n As Integer = 0
n += 1
'But not bits (booleans)
Dim f As Boolean = False
f And= True
'3 (unsafe) ways to convert to a char (and using reserved words for variable names?)
Dim [char] As Char
[char] = "C"c
[char] = CChar("C")
[char] = CType("C", Char)
Granted in the last case you see use of the "TCHAR" and other such macros in C/C++ code. But these are macros. And not part of the language.
MS also ported in many of the old global VB6 methods such as Trim(). Even though this is a redundant method of the String class. Format() is another example. But in that case the behavior differs from the the method of the same name in the String class.
From experience I've found it easy to transistion from one language to another. Except when that language had "quirks" like those in VB.NET.
VB.NET was a very successful way to move VB6 coders to VB.NET. But is it a Good Beginner's Language?
No. Hell no.
Re:Why not both? (Score:3, Informative)
For example if SomeClass implemented IDisposable:
using (SomeClass x = new SomeClass())
{
}
would be equivalent to
SomeClass x = new SomeClass();
try
{
}
finally
{
x.Dispose();
}
Re:Why not both? (Score:2, Informative)
I'm fairly certain that anomalous cohort meant using(){} blocks and not the using statement. Ignoring the collision in the keywords using(){} is a wonderful piece of syntactic sugar. Inside the ()s of a using block you can declare and instantiate a set of objects -- and when the closing brace of the using() block the objects are automatically Dispose()ed.
It seems silly at first -- until you stop to think of it. A VB app is required to Dispose() of its own temporary objects. On trivial objects this doesn't mean a whole heck of a lot -- they can sit hogging whatever trivial resources they want until the garbage collector gets around to noticing they've gone out of scope and does a GC pass on them. On more substantial objects this can mean quite a lot -- I want my DB connections freed up ASAP, for instance...
"Well, the VB coders can just Dispose() of their objects, no problem...." -- Sure they can -- but if they Dispose() of the object and then accidentally use it again they now have a runtime error to debug. If a C# coder puts the closing brace of a using(){} block in the wrong spot and tries to use one of the objects he instantiated in the ()s of the using(){} block it forces the error into compile-time where it's a bazillion times easier to troubleshoot.
Re:Why not both? (Score:5, Informative)
Scheme and this book [mit.edu].
Re:still C (Score:1, Informative)
Re:Bad idea (Score:3, Informative)
class DerivedClassName(Base1, Base2, Base3):
Granted, it's not the most useful implementation in the world, but python supports multiple inheritance.
This is crap. (Score:5, Informative)
Sorry, but this is a very wrong view of what computer science or programming really are. There are three things being mixed up here which are largely separate bodies of knowledge and any decent computer science program separates them out as such.
Algorithms - This is the core of Computer Science; learning to think like a programmer and to break problems down into logical chunks is tantamount to becoming a computer scientist. With this at the core, a language should then be chosen that most facilitates this. When I started college 10 years ago we used Pascal in our lab for our algorithms courses (which notably were just about implementing the theory we covered in the course), and that at the time was a very sane choice. Java's a pretty sane choice these days. Lots of things are really, but something like C forces people trying to learn how to think in algorithms to be side tracked by all of the tedious low level junk. (For reference, I'm a low-level C systems programmer at a large software company, so this isn't some "C sucks" wankery.)
Computer Organization - This is usually cross listed in electrical or computer engineering, and for good reason. This is where you figure out how hardware works. C and assembler (RISC works fine here) are appropriate in such a course. As this course naturally follows introductory algorithms courses, you can here put the theoretical constructs learned there in context.
Operating Systems - Memory management doesn't belong in either of the above and certainly saying that you learn "memory management" with C is pretty silly. You learn how to malloc and free stuff. Whoopee. "Memory management", in any sort of interesting way, is better treated in an Operating Systems course where you can track what exactly is happening down from the programming language, into the OS and finally at the hardware side. It can be put in context of what actually happens when you call malloc and what that means. Fundamentally, you don't understand anything more about memory management from a basic C course than if somebody tells you in a Java course "When you use 'new' some memory will be allocated, and when you're done with that object there's a thing called a garbage collector that will eventually come and give that memory back." Memory management is a non-trivial topic and one that certainly goes deeper than simple allocation.
So, is VB suitable for any of this? Not really. VB is kind of orthogonal. Like you said, it's fine for someone who needs to solve certain sets of tasks, but doesn't want or need to bother with really understanding deeper concepts.
Pascal is the best teaching Language (Score:1, Informative)
Re:Why not both? (Score:2, Informative)
Go look through the modules:
Modules, methods, properties named with underscores, camel case with upper or lower first letter, etc.
Batteries included, but they're all different sizes.
That said, I really dig Python in general.
Re:This is crap. (Score:3, Informative)
Getting the basics in C or C++ gives students the tools they need to pick up pretty much any other procedural language. Someone fluent in C++ can pick up Java in a day or two. Someone fluent in Java has to learn entirely new concepts (like direct access to memory) in order to pick up C++ or C.
I don't necessarily disagree with what you're saying, but from my personal experience, if I'd learned Java first instead of C++, I would've had a bitch of a time learning how to program in Objective-C / Cocoa, which is how I make my bread and butter currently. But really, I think that as far as problem-solving methodology goes, students should go through what the field of computer science has gone through. Start out with structured programming and then realize that there are certain problems that it cannot solve easily. Then introduce them to object-oriented programming so they can have a basis through which to appreciate it. I count being able to write a purely structured program as a good thing.