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#?"
still C (Score:4, Interesting)
Re:still C (Score:5, Funny)
%
Segmentation Fault
%
Re:still C (Score:3, Funny)
#include
int main()
{
printf("Hello world\n");
}
$ gcc -o test test.c
$ test
$
Re:still C (Score:5, Funny)
#include
int main()
{ //Begin Main function
printf("Hello world\n");
} //End Main Function
Re:still C (Score:5, Funny)
...or at least that was the way my first Hello World program was graded (although that was in C++).
Re:still C (Score:3, Informative)
If you don't know this yet: Use < for < and > for >
Re:still C (Score:5, Funny)
#include <stdio.h>
int main() {
printf("Segmentation Fault\n");
return 1;
}
Never improve on perfection :) (Score:4, Funny)
That should return EXIT_FAILURE or something, not 1.
Re:still C (Score:5, Interesting)
On the contrary, C is one of the worst languages you can use as your first language. I've tried teaching C to first year students. You end up teaching the syntax and vagaries of C and not very much programming or computer science.
One of the first things that beginning programmers want to do is do stuff with strings. Do you really want to explain C strings to people who have never programmed before? (There's a reason that microcomputer BASICs got peoples imaginations working. You can do stuff in it straight away!)
Amusingly, about the only worse mainstream language I can think of for this purpose is VB. C's syntax and semantics at least have the advantage of being consistent. (In its defence, VB wasn't exactly designed to be the way it is. It was a fairly inextensible language which nonetheless got extended as the years progressed. "Congealed" might be a better word than "designed".)
Save C for semester 2. Semester 1 should use a language which emphasises the basics. A functional language (say, Scheme or Haskell, but not ML; ML is a cool family of languages, but the syntax is way too arcane for a first language) would be my first choice, but even Java is a better choice than C. Hell, even C++ is a better choice. The syntax is at least as quirky as that of C, but at least it has a decent standard library which lets you do stuff straight away.
Visual Basic is horrible; use Python (Score:4, Insightful)
Re:Visual Basic is horrible; use Python (Score:5, Interesting)
Re:Visual Basic is horrible; use Python (Score:4, Informative)
Re:Visual Basic is horrible; use Python (Score:5, Insightful)
Why would you want to start with "the hard way"? Bringing students into a EECS program might benefit from starting out with C or even assembler, but for anything else it is overkill. Python teaches variables, functions, structure, and control flow as well, so I don't see the disadvantage of starting with Python. The main thing that Python does not teach is memory management and some of the more interesting bugs that C can produce.
The main reason to introduce a student to more than one language is to begin without the more complex parts of languages like object oriented code, and even structured code. The nice thing about python is that you can start with procedural code, continue through structured code, and end up at object oriented code, introducing only a few concepts at a time.
With C, you have the problem of explaining the main() function or doing handwaving before you get around to explaining functions. With Java, you have the problem of classes even before you get to a main function. When even the most basic program requires structured or object oriented code, you have a problem teaching it to beginners. Take the following examples:
Java: Student asks:
What is a class?, What is that funny looking bracket?, What is public?, What is static?, What is void for?, What is main?, What are the parenthesis for?, What is a String?, What is args?, How come there are funny square brackets?, What is system?, What does the dot do?, What is out?, What is println?, Why are there quotes there?, What does the semicolon do?, How come it's all indented like that?.
C: Student asks:
What is #include?, What are the greater than and less than signs doing there?, What is stdio.h?, What is main? What are the parenthesis for?, What is the funny bracket for?, What is printf?, Why is hello world in quotes?, What is the backslash-N doing at the end?, What is the semicolon for?
Python: Student asks:
What is print?, Why is hello world in quotes?
Get the picture?
Re:Visual Basic is horrible; use Python (Score:4, Funny)
And in other questions... (Score:5, Funny)
Dear Osama Bin Laden: Would you like to come to my bar mitzvah?
Dear Eagles fans: Would you be willing to sign Terrell Owens again?
Re:And in other questions... (Score:3, Funny)
Come on, quit holding back. How do you really feel about her?
Not really. (Score:5, Insightful)
Re:Not really. (Score:5, Insightful)
Go with Ruby. It's such a lovely language.
Good Beginner's Language (Score:4, Insightful)
Re:Good Beginner's Language (Score:5, Insightful)
An important point to note here, is that most programmers nowadays don't need to be aware of this. At least not to the extent they used to.
More and more, business and industry needs software to simply automate simple tasks. As processing power increases, as memory space grows, it's not necessarily the case that the basic tasks people need done will grow to match them. Thus it becomes less important for a programmer to optimise or worry about optimisation.
In addition, although more programmers will be required to create software, they will not be required to delve into programmings basic complexities. It's not required you know about opcodes and memory addresses to write HTML, and soon it will be th ecase that you won't need to know when coding business apps. At all.
In short, the future legions of greasemonkey coders will be using Ruby on Rails, not C and FORTRAN. When the job gets too big, complex and nasty for them or a hardware upgrade to handle, they'll call in the high priced consultants who can still code in low level procedural languages.
C != Good Beginner's Language (Score:5, Insightful)
I agree that bells and whistles increase a languages' barrier to entry, but if they can be ignored (like a lot of the Java library) then it is a moot point.
C is not, nor ever will be a newbie language. By the train of thought that it is best "to [know] what goes on under the covers", then the logical conclusion of that is to teach a simple assembly language, quickly followed by a compilers and systems course.
In math, we typically teach younger students how to use a function or expression before we teach them how to prove it (consider it to be the process of giving them the specifications).
Disclaimer: I have helped and witnessed many students learn C.
I'd go with C# (Score:5, Insightful)
If I may make a suggestion... (Score:5, Insightful)
And yes, despite being a Linux hacker now I once did use Visual Basic, and I have to say it took way longer to learn VB than it did Python.
I'm a fan of Java (Score:3, Insightful)
Comment removed (Score:5, Funny)
Good ... for what? (Score:5, Insightful)
I guess this depends on what you qualify as "good"...
I'm sure there are other reasons to consider VB to be a "good" language. Since I don't do VB anymore (thank God), I have lost track of those reasons. I think I'll stick with C and PHP, this way when I get a customer that wants something that'll work on Solaris or QNX or AIX or HP/UX, I have half a chance of success!
Bad idea (Score:4, Interesting)
Short Answer: Are you out of your bleeding mind?
Long Answer: Visual Basic is riddled with problems for those who are new to programming. The first problem that hits someone looking to learn programming is that he/she sees a pretty layout manager, but no code. It's quite possible to build an interface without ever writing a single line of code. When the entire point of the exercise is to learn coding, this is NOT a good thing.
The second problem is that Visual Basic doesn't clearly introduce the "programmer" to concepts like functions, interpreters, and compilers. Most of the functions in VB are automatically generated, giving the impression that these are magic incantations that shouldn't be touched by a "programmer". VB Studio has an interpreter, but it isn't interactive in the same way as BASIC interpreters. This makes it useless as a learning tool. The compiler is mostly a matter of setting a file name and hitting a button to produce an EXE. So the new programmer gains no understanding of how code gets translated into an executable. Concepts like linking, for example, are completely glossed over.
One of my personal beefs with the older versions of VB (which have been corrected in
VB also loses major points for failing to include typed variables. The automatic conversions between numbers, strings, and other types only serves to confuse a new programmer, especially when the auto-cast does the wrong thing. A new programmer should be taught to understand how data is represented by computers, not abstracted away so far that they can't understand how to fix problems.
Beyond that, VB tends to do a lot of confusing things that are not easily explainable. The lack of useful documentation and/or a good documentation browser only serves to increase confusion.
To be honest, I never understood why some non-VB developers thought of VB as a 'toy' language,
VB had/has its uses, but it's still just a RAD tool. As soon as you run into situations that the RAD tool can't handle, you should be using a real language rather than trying to hack it.
Re:Bad idea (Score:5, Insightful)
Your first problem is that you're mashing VB6 and VB.NET. They, for all the similarities in syntax, are really completely different languages with a completely different runtime going underneath. Now, since this is a question about a "beginners language", it's unlikely that someone would mistakenly rant off about VB6, since it has been largely deprecated. Anyone starting with "VB" now would use VB.NET, with or without the pretty IDE. I think that's clear enough from most of the posts I've seen so far in this article.
Some of your points are valid vis-a-vis VB6. It was completely tied to the IDE (the preprocessor infact was the IDE) and it supported a semi-OO model, which is like saying "a little bit pregnant", but regardless, most of these limitations were related to the fact that VB6 was essentially a COM server and consumer platform. The lack of implementation inheritance is a good example of that - since COM is a binary spec, it does not support it. Polymorphism and aggregation OTOH, which permeate COM, were. So pre-VB.NET, "Visual Basic" was both hobbled and all the better off for being tied to intrinsically to the COM spec. VB6 didn't behave like it did because someone at Microsoft didn't have anything better to do, it did because it had to play by the rules - the rules of COM. You could either understand these limitations (if they were to you) and live with them, or just use C++. By the time Microsoft released ATL, COM-centric coding in C++ became extremely easy - I always chuckle at the quitessential "yeah I know C++ and VB sucks, but I don't know a replacement for the GetObject() function and my life suxx0rz" claim from people who think it's really cool to bash VB because it has a large following of hobby developers that know nothing about software design, as if it was impossible to do anything meaningful with it. But I digress.
Along comes VB.NET, which is essentially the VB6 syntax ported to the .NET CLR. Like the other "mainstream" languages that target the CLR/CLI, VB.NET is essentially a full OO implementation, unless you're willing to call Python or Java "toys" because they don't support multiple inheritance or the concept of friend classed as implemented by C++.
So you have a fully OO language (for all practical purposes) with generics, operator overloading, partial classes, etc. that can be easily decoupled from the IDE - all you need is a text editor and the compiler, though most people prefer the IDE route. It just happens to look like BASIC. Other than that, I think it's a good beginner's language. Wouldn't you agree?
That's as far as VB currently goes... the rest of your rant is just the usual bashing a platform that is no longer supported or in active development, nor understood (obviously) by people like you.
dont learn vb (Score:4, Insightful)
If you really want to start with a OO language, pick Java or C#.. But be warned, those are dynamic languages (Java, C#, Perl, PHP, Python, Javascript, etc) and they have some differences compared to "hard-compiled" languages like C. C forces you to understand how the computer works, and it will always help afterwards to know that. Python is also a good beginner's language, its clear, clean, easy to learn, easy to use. Stay away from Perl and PHP, they are very easy to use.. but they teach bad habits.
And VB is badly considered not because the language sucks (and it did suck last time I used it.. but that was many years ago), but because most VB programmers suck and are not very good. Often not formally trained and they dont really understand many important concepts. Its fine if you want to cook for you familly, but that's not how you cook for a large restaurant. A good formally trained programmer should be able to pick up any not-to-weird language in very little time (since they all have basicly the same concepts)... VB programmers most often can't. Where I work, I have to handle C, C++, Java, Perl, PHP, having a good base is important. The concepts are important, the syntax is just a tool. Get a good tool, dump VB.
In the next episode of Ask Slashdot... (Score:5, Insightful)
"Is kicking puppies still a great way of attracting women, or do you recommend kittens these days?"
VB was never a great beginner's language. It's wrong all over. The only thing that got it a reputation for being a "great beginner's language" was that you could draw the GUI in later versions * before you actually learnt how to write code, so you could get visually pleasing results immediately, whereas the competition at the time meant you actually had to learn how to use a GUI API (and consequently, how to write code) first.
You want a good beginners language, look at Python. It's been used successfully in teaching environments for a while now. It enforces good practices like indentation and prohibits easy sources of bugs, like if foo = bar: O'Reilly have an article [oreilly.com] about Python for teaching programming that you might be interested in.
* Yeah, the first versions of Visual Basic ran on DOS and didn't have the GUI builders that later versions did. I'm not quite sure what qualified them as basic of the "visual" variety, it's not like you had to type your code in with your eyes shut in other basics.
Re: (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:
D'oh! (Score:5, Insightful)
Private Sub Command1_Click()
End Sub
What they will do in the process is to go out and grab a bunch of someone else's code, paste it in there, and change the names of a few things. It really bothers me that the product of this process is even called software. At best shouldn't it be called 'macro-gramming?' Sorry to be such a stickler, but does that programmer have any idea what really goes on when that button is pushed? When the end users need a change that is not an exposed property or method of the pre-packaged object, what can they do? They probably have more creative skills when it comes to making excuses than they do at actually programming. Hell, we've all done it. It seemed like a good idea at the time to just slap together a few goodies, make it look pretty and ship it out the door. But what you end up doing is letting someone else make all the really important decisions for you. If you're lucky enough to be able to satisfy all the demands you encounter that way then more power to you.
In order to learn the principles of computer programming, less is more in my book. The more computer science you know, the less dependent on any particular set of tools you become. When code is dear and time consuming to write debug test and maintain, you will be absolutely amazed on how little of it you can get by on. Take the same algorithm and implement it in a couple different formats, languages, compilers, etc. See how many instructions it actually becomes when it gets run. See where different efficiencies of speed or size become important. Try some Python to see what can really be done in an interpreted environment. Try a C compiler. Try looking for a couple of algorithms and see which one performs better and be able to describe why. Then, no matter what tools you end up using, you will have a much better idea of what is going on, how to make it both secure and efficient from the start.
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).
Yes ... and all the others too. (Score:3, Insightful)
Every language I've learned has been useful on the various projects I've worked on and provided a perspective for evaluating what methods to use for new development.
Learn every language you can. You'll probably be surprised to find that you don't just get broad shallow experience, but each language actually gives you more in-depth knowledge of the others (and what they may do behind the scenes).
VB(A) is the scripting language built into many Microsoft products. Whether or not you harbor loathing for Microsoft, knowing VB(A) will be very helpful for many tasks and may be necessary to get a paycheck from many places.
It's decent. (Score:5, Insightful)
The long and the short of it is this: VB ain't bad.
People will say that Visual Basic is "unstructured," and they're clueless. People will say that Visual Basic is slow, and they're one step up from clueless (VB5 and VB6 compiled to native code and could, when used correctly, rival Win32 C++ applications for speed; VB.NET compiles to the same CLR the rest of the
My personal view of the Win32 API is that the inventor didn't like people. Window creation is needlessly masochistic. VB takes that hassle away. I've written applications where the entire backend of the program is in C++ and used the VB interface just to call C++ DLL functions. It's doable. It works pretty well.
Basically--VB is a viable language if you want to get something done *now* and don't care all that much about whether it's pretty. Would I use it for game programming? No (once was enough, a 2D RPG for a school project in sophomore year of high school). Would I use it to write something quick and dirty that I need immediately? Sure, and I'll be done before a C++ coder even has a window up and running.
VB also has some pretty nice features that YFTL lacks. You can run the program without compiling it, in interpreted mode--very useful for bug-ferreting. Its class system pre VB.NET was baroque at best, but its built-in garbage collection/memory allocation on-the-fly and the fact that all arrays could be dynamic without external references made it fun to mess with.
~Ed
Yes. Just to be different. (Score:3, Insightful)
Next up. Right tool for the job. If you're interested in embedded applications, coding on linux, or high performance apps, going
And finally, to refute some pundits. VB.Net is a syntax option for coding in CLR, the same as C#, J#, PHP.Net and all the other screwy variations of *.Net. Vb.Net is every bit as Object Oriented as C# or Java. VB.Net by default has explicit and strict options off, turning those two options on makes its compiler just as strict as the C# compiler. VB.Net also has almost all of the functionality from C# (I have heard that there are some obscure pointer functions that are not in VB.Net's syntax, but I have never run into them, or the lack there of). Another one of those "What were they thinking?" items though, VB.Net has a "Hide Advanced Methods" option on by default that hides a lot of methods from the autocomplete lists, turning it off allows you to see all of the same functionality as in C#.
The only substantial differences from VB.Net to C# is syntax Things like:
VB.Net: Private VarName as String
C#: Private String VarName
VB.Net:
If Var1 = Var2 Then
'Code here
End If
C#:
If Var1 == Var2
{
}
-Rick
Comment removed (Score:5, Informative)
And now for something completely different... (Score:5, Interesting)
Developing in an IDE like VS obfuscates and distances the programmer from the code. It's a necessary evil for developing some things. But throwing a learning user at the bubbly GUI to figure out the wizards for him/herself is akin to putting a new pilot in the seat of a 747. There is just too much there that would seem confusing.
For these three reasons I would suggest python:
1. All you need is a free (as in speech) interpreter and your favorite text editor.
2. Documentation, howtos, sample code is easily available (there are plenty of good VB help sites out there, but I have found many many many fantastic samples of python).
3. The syntax of VB and python would seem similar enough to a beginner.
Where to begin? (Score:5, Insightful)
This question is wrong in so many ways...
Good beginners languages are:
I would say Common Lisp is the best, but if you start programming using Lisp you'll never truly appreciate it because you assume all languages are that well-designed.
Do you really want to learn how to program? (Score:4, Insightful)
Or you just want to get some work done? If you really want to learn something, you should do it with PASCAL. Some people told you do study C, but after trying to teach it to a few people, I am fully convinced that C is not a beginer's language. PASCAL is different because you won't need to know about pointers to do quotidiane stuff, but still have manual memory allocation to study.
To learn how to program, use PASCAL on a CLI. Don't worry about the time investment, you'll learn VB much faster after you know what you are doing. Just to finish, I'd like to put here a very true quote from Dijkstra:
Nope, start with Pascal (Score:5, Insightful)
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
Is it a good beginner's language? (Score:4, Insightful)
Personally, I think it's a toy language because it separates the programmer from the bare metal of the machine, with too many layers of abstraction, confining the programmer to a "digital playpen" much as you would confine an infant. I have similar feelings about C#.
I started with C64 BASIC, moved on to C, then C++, then I learned MSVC and VB at about the same time, and after that I picked up ASM.
I really think I learned a lot by following that path, and I'm glad I learned how much work went into writing a GUI long before I dragged and dropped my first VB app.
Your SECOND language is the important one! (Score:4, Interesting)
* learn several languages
* learn languages with widely differing characteristics
* learn them well enough, i.e. you don't know a language until you've used it for at least one non-trivial task
* take a data structures and analysis of algorithms course, after you know at least two languages
Most of the people I would consider bad programmers know only one language, or know one well and others very superficially, like the engineers who can write Fortran in any language*.
To show what it's possible to overcome, I started out with BASIC in high school. BASIC does not cause permanent brain damage, if you limit your exposure to it.
Before college I had moved out to assembly (PDP8); in college I was exposed to COBOL, FORTRAN, PL/I and 360 assembler. In graduate school I moved up to Pascal and C, but I also finally took a decent algorithms and data structures course - and learned Lisp. Those last two things were probably as important as all the previous experience in making me the hacker I am today.
* This is not meant to be a slur on all engineers who program when necessary - just the ones who do it badly, over and over again.
Personal Experience Speaking... (Score:4, Insightful)
VB is pretty good at teaching programming or getting people started in programming. Being a modern 'basic' it can allow people to get the initial concepts of variables, and put them to use in a syntax that reads like common english language, yet not leave them making a turtle follow lines around a screen.
The simplicity is also good to find the 'clicks' or points where people get it. When not teaching this stuff you forget these clicks, even explaining concepts as variables is something that is hard for some people to catch, even if they understand algebra.
VB also can do some fairly advanced things now, especially with the current
A person could start with no programming background, do the hello world, and stick with VB and make a career from it producing ok software.
Pascal is also another easy to understand language (designed to be a learning language even), and it with Borland's support can be almost as powerful as C/C++. So it is another good starter language that a career can be made from - especially Europe, Delphi does quite well there in comparison to the US.
I have taken a couple of roads with people, using either VB or Pascal as the 'get it' starting language.
Then I progress them to some advanced levels in each language, and along the way contrast in another language, C is the poster child here for the contrast. It can show complexity and also levels of creativity not normally used in the other languages. Useful comparisons to stuff they are currently learning as well as 'wows' like a line of C code that is very complex and recursive, but performs as much as an advanced program.
This lets them 'click' along the way, and will hopefully keep perspective and the certain 'creative' element that syntax complexity of C draws out of people.
The 'creative' complexity has to be nurtured, even if you are keeping people in Pascal or VB for their career (or they are not going past that). It was the creative of 'how to make it work' concepts that are so dominate in C that define 'good programmers', because in the old days, we had to make it work.
Yes it is nice to drag a button on the screen and have the IDE do the work for you, but without some of the 'creative' what ifs, and 'how can we' questions, programmers won't be more than glorified form designers, and that is sad for them to invest time in learning something and not fully getting it from both angles. (The logical syntax and function and the creative inspiration of thinking outside the box.)
Programming is one area of expertise that definately benefits from bridge-brain individuals. Creative Logic at its finest...
And sadly if the person you are teaching don't fully click in either direction (logic or creative) then you lead them down the road they are good at, and let them pair with a person or team that fills in the other side...
Re:No. (Score:3, Insightful)
Re:No. (Score:3, Funny)
Or run, screaming in mental agony from the building as their virgin eyes behold the Java "Hello World" app.
Re:No. (Score:3, Insightful)
If you have to go to such trouble, why did you leave C++ in the first place?
Java is a language designed for people who already know how to program. It starts off, from day one, with object orientation concepts, scope, namespaces, system calls, and in some Hello world cases, typecasting. All this verses a one liner in other lang
Re:No. (Score:5, Insightful)
1. (Insert favorite *simple* language here): simple meaning that you can't do much with it, and what you can do is very easy and obvious. Qbasic comes to mind, as that's what I learned with, but there are many which fit the bill.
2. C: Turn the language from a magical tool that does what you want (poorly) into something that actually reflects the underlying architecture. Helps the programmer understand why their previous language performed so badly. Widely used (and mimicked), so they know a useful language.
3. C++: Now that they understand what's going on under the hood, teaches them good coding habits - objects which clean up their own memory, const variables, object oriented programming, generic programming, etc. Widely used (and mimicked)
4. Any other language(s) here: they already know the basic concepts, so it's just implementation details.
You *could* have them branch out at any other stage, assuming that they've already learned the prerequisites. For example, once they've just learned to program (#1), they could do basic python. They won't be able to write maintainable or fast code, however. If that's not a problem, power to them!
I haven't used VB since Windows 3.1. I understand it's really changed
Re:No. (Score:3, Insightful)
I only wish
Re:No. (Score:3, Interesting)
Re:No. (Score:5, Interesting)
All fresher Engineers here (Cambridge, UK) have to learn to program 8086 assembler. Except they don't get an assembler, they have to enter the program using a hex keypad on the front panel.
Yes, in 2006. And no, I'm not joking, I did it last term.
Re:No. (Score:4, Insightful)
at the command prompt type: python
BTW I think Python is without a doubt the best language to teach a begginer with.
Re:No. (Score:5, Insightful)
I disagree. This is the wrong way to introduce OOP, as it treats it as some sort of high level way of managing code rather than as a fundamental technique that can be used at all levels. My view is that the best way is to teach something like Smalltalk or Ruby initially in a procedural style, and then show that everything in the language is an object, with methods and properties. Then, perhaps, the compromises made in a language like Java can be explained. One thing that should definitely be avoided is C - for goodness sake teach a safe language like Pascal instead. Beginners should not be dealing with pointers to memory (most developers never need to anyway).
OOP needs to be taught at the start, not as an optional add-on.
Re:No. (Score:3, Insightful)
Re:No. (Score:3, Insightful)
Re:No! (Score:3, Insightful)
Re:No! (Score:5, Insightful)
The only language a beginner should be using is C, C++, or assembly.
Re:No! (Score:3, Insightful)
Re:No! (Score:3, Insightful)
A consistent object model with a real base object.
No pointer/reference weirdness.
Java has range checking on arrays.
C++ is a good production language when you need the speed. Java is a "safer" language. STL really helps c++ a lot but it still isn't safe or friendly. However a person that does learn to program well in c++ will probably be a very good programmer.
Re:why? (Score:3, Interesting)
Well, I'm no fan of java for my own use (I like C++ for "C type" stuff, and I'm far more fond of e.g., lisp family languages, for "GC'd no worries" stuff), but having helped people use it for college programming courses, it does seem to have appreciably fewer sharp edges in many ways than C++, without most of the bogosities of something like VB.
Some reasons:
Re:No. (Score:4, Insightful)
I sympathise with your sentiments, but VB is a turing machine just like all the rest of them [sourceforge.net]
Re:Is Visual Basic a good beginner's language (Score:5, Funny)
Re:Bad idea- compilers (Score:3, Interesting)
Oh yeah, and completely agreed. I'm a professional programmer who learned VB after college- and I can always tell the difference in code between a real programmer and Visual Studio Wizards.
Re:Bad idea- compilers (Score:5, Funny)
So can I. The #Region " Windows Form Designer generated code " seems to be a bit of a giveaway, no?
Re:Bad idea- compilers (Score:3, Insightful)
No... right clicking and selecting "New Form" is a nicety, and far from making someone a non-programmer. Eclipse and other IDEs have wizards as well - a developer using and IDE does not a non-developer make.
Re:Bad idea- compilers (Score:4, Interesting)
If more people learned real languages before jumped-up assembly languages like C and pseudo-OO languages like C++ then we might see a bit more innovation in the language design community. Oh, and all three of the languages on my list run in an introspective environment.
Re:Bad idea- compilers (Score:5, Insightful)
I learned Logo in middle school.
I learned QBASIC (ugh), Pascal (ugh), COBOL (ugh++), and RPG (!) in high school.
I learned C, C++, VB, and Java in college.
Those landed me a job doing CAD drawings for a small company.
Eventually, I learned PHP on my own.
That gave me enough "experience" to get a PHP job.
So what have I learned?
- All the languages I was told were going to be useful "in real life" have turned out to be mostly worthless (perhaps I haven't reached the level of the C++ stuff yet... I'm reserving judgement on that one).
- Concepts are best learned from pseudocode, not from any particular language.
- Comfortable syntax is learned from languages that are built around a particular concept.
- Databases are the real reason OOP is a necessity. Data objects are your friends.
- Most programmers are not architects/designers. They're too impatient. They jump right in and code a plate of spaghetti before thinking about how long they'll have to support that code. Some of them do fairly well at making things efficient, though, so you can't fault them all.
I don't know ASM, so I tend to disagree with the hardcore "I coded in ASM uphill both ways naked in the snow blah blah blah bring me my cane, sonny" crowd. It's time to pull the plug, gramps.
I also disagree with the academics that sip lattes, listen to jazz, wear berets, and say that everyone should learn and use [insert obscure language here] and piss and moan that it's not happening. Man up, nancy. The real world uses real tools for real work. Your toy languages are not going to be used. So take your Smalltalk, LISP, and Prolog back to your local Starbucks where you can "ooh" and "aah" about how "advanced" they are.
If you're going to teach concepts, do so. Don't use a language as a crutch. Teach in pseudocode. Give examples of "how-to" in multiple languages. If you're going to teach a language, don't teach concepts. Teach what that tool is supposed to be used for. PHP is for dynamic web pages. C++ is for, well, damn near anything, but not dynamic web pages. Java is kinda like C++, but slower (unless you fuss with compiling natively), and can be multi-platform with minor changes. Perl is great for a quick, unreadable script. VB is nice if you want to spend lots of money for the ability to build piddly-shit apps that only you will use.
And remember that not everyone learns things the same way. Someone who "just gets it" with C, C++, Java, PHP, and similar-looking languages might have an aneurysm just looking at code in Objective C. (I did.) Sometimes a familiar syntax matters. And yet, that same person (now bleeding out on the floor) might have no trouble at all deciphering Visual Basic or Pascal even though they're different. (Again, me.) That should tell the designers of the aneurysm language that the syntax is annoying, shitty, and induces aneurysms. (Go Smalltalk and Obj-C!)
Re:Bad idea (Score:3, Interesting)
I agree that clicking on a wizard is not programming, but for someone who's just starting, built-in IDE tools (like wizards) can really help. As an expirienced user, I have no problem manually typing
private void Button1_Click(object sender, EventArgs e)
{
}
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:Maybe, maybe not. (Score:5, Insightful)
It probably wouldn't in a language like C, since it is very difficult to diagnose side-effects. If, however, you pick a (functional, or functional-style) language that supports a foreach statement then you could say something like:
foreach({x,y} in image) ->
You compiler / runtime would then pick an optimal number of concurrent threads to do this with for your target environment.do_something(x,y).
A lot of the time, going to a lower level is a bad idea because:
Re:Bad idea (Score:4, Insightful)
Thank you-- I'm going to try to keep that in mind. I appreciate the tip.
But if they tried to teach that stuff in programming 101 (regardless of the language), the students would leave at the end of the semester complaining that they didn't get to do anything fun, and are less likely to want to continue. A new student will have a hard enough time getting a project working. If you teach complex subjects first, they're more likely to make simple mistakes, rather like the typo you had in your initial example.
Let them get passionate about the subject by completing small tasks right away, then move on to the heavy material.
For that matter, in your example, the first code was not a "bad idea", it was simply less efficient. It would have been less efficient regardless of the language complexity, and the concept or cache-misses can be taught regardless of language.
Re:Bad idea (Score:5, Insightful)
Bad idea. A new programmer should start with small command-line programs, and grow into coding bigger things *by hand* at first. Only when they understand exactly what the wizard does should they start using them as time savers.
That, I think is the point of wizards - to save you time, not to do for you things you don't understand. When new users start using wizards, bad code WILL result.
Re:Bad idea (Score:3, Interesting)
Now that's just silly. Does it make any difference if the function is GetDate() or getdate() or getDate()?
Why spend valuable memory, attention span, and compile time dealing with silly nonsense like that? I'd much rather have my programmers know a hundred functions but not be 100% clear on the casing than have them know 10 and know the casing 100%.
Re:Bad idea (Score:3, Interesting)
I'll second that notion! Computer Science, as a generalization, has three types of people:
People who only learned a high-level language, then learned algorithmics, and now produce "elegant" code that would take 2^27 times the current age of the universe to finish its task on any physically-possible hardware;
People who took CS and expected to come away knowing how to pro
Re:Try COBOL (Score:3, Interesting)
Re:Try COBOL (Score:4, Insightful)
when I say programmer I mean someone who designs and writes applications.
Re:Bad idea (Score:3, Insightful)
Re:Yes. (Score:4, Insightful)
This doesn't even make sense. Java is a general-purpose programming language -- you can write absolutely anything in it. Client software, server software, command-line tools, graphical tools, compilers, games, anything. What do widgets have to do with things?
Re:Yes. (Score:5, Insightful)
I'm not a programmer because I love to program, I program to do a function, to make some part of my job easier.
This is a truly key statement in his post. You have to ask yourself what you want to do with programming. If you want to write software that'll do interesting things for your own personal use, then VB is probably about right. It won't produce elegant code, but it will produce simple functionality fairly quickly, and you can build your own tools with it. In a society where computer illiteracy is becoming as problematic as written illiteracy, this kind of programming language definitely has a place.
On the other hand, if you want to produce programs for OTHER people to use, you shouldn't flinch at spending a year learning how to make a programming language do what you want it to do. It's like mechanical or civil engineering. If you want to build a shed out back or a trebuchet then go ahead and pickup some parts at Home Depot and start nailing things together. If you want to design anything that ANYONE ELSE is going to use, like an office building or an automobile, then you had better figure out how to use something a little more sophisticated than 2x4's.
A lot of people will come back with the argument that there should be something easier to learn than C or C++ for the beginners, but in my experience that's a flawed argument. Learning a language is an investment in time, and most people are unwilling to discard that investment. Instead, they've bolted on afterthoughts to the programming languages to make them more functional. For that reason, VB6 was always a horse designed by a committee. If you want to learn how to program like a professional then start with a professional language.
The one exception is Assembly Language. Every time I try to teach people how to program I start by teaching them the Twelve Instruction Programming System (TwIPS), which is a simplified subset of assembly. With this they learn the bare bones of what any piece of software does, how algorithms function inside a computer, and what the instructions are really doing.
And when they get around to learning C++ they find it considerably less tedious than if they had hit it directly.
Re:Visual Studio and Visual Basic (Score:5, Interesting)
Yeah, because programming boilerplate includes, class, main, and event handling code (which does nothing on its own) is really going to get someone hooked. Screw that. Give that code to a new programmer for free and let them add in something that does something fun, obvious, and interesting right away. That's how you'll get 'em hooked.
Look at it this way... no-one got hooked on pot because they liked making bongs.
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:Why not both? (Score:5, Informative)
Re:Why not both? (Score:5, Interesting)
I hate to jump on the Java/VB/C/C++ lovefest, but the question was about a teaching language.
Why not something simple - like Pascal? Basic? A step up, but COBOL?
Yes, there are advantages to learning a language like C++ that you will end up using, but it's not necessarily the best approach.
One of the biggest complaints I have about a lot of the VB and C++ programmers I've been exposed to is a complete lack of fundamentals. Code that works, but sucks because they never bother to think of the background stuff ... memory, performance to name two. Multithreading is not a topic to start beginners on.
OTOH, how many people here can take the Nth root of a number by hand? At some point, you have to accept that automation is here stay. The first time I hit VB, after doing a large project in CICS, I was really happy. Tons of things that were a royal pain became relatively painless. Then the downside ... performance sucks compared to CICS. Database interface sucked. Debugging really sucked. Generally, I like having my code in one place, not scattered over screens, buttons, rollovers ...
Things are better now. SQL/SQL Server work really well together. A proper front end in some tools can be done FAST and painlessly (e.g. Brio (Now Hyperion Intelligence, to better play with the faster database around!)
I've seen a couple of multi-hundred-million dollar projects die, because of innappropriate choice of languages (VB for one, VC++ the other). But management bought into the argument New=Better.
Personally, I think C++ is a horrible choice as a starter language. Then again, I started on a virtual assembler language, designed strictly for teaching. Kinda like Pascal.
Re:Why not both? (Score:5, Informative)
Scheme and this book [mit.edu].
Re:Why not both? (Score:5, Insightful)
Basically, I'm saying that students of computer science shouldn't start off with VisualBasic. But if you're a hobbyist or a network engineering type who needs to be able to write working scripts and stuff like that, sure, VisualBasic is as good as any other ultra-high-level language, I suppose.
Re:Why not both? (Score:5, Interesting)
If you want to learn the *fundamentals* of programming, Structure and Interpretation of Computer Programs is the best book I've seen, and it deals not at all with "memory management", "efficient use of resources", or other archane crap (since it uses Scheme
Not that Scheme itself is used much beyond the academic. But a lot if its ideas are showing up in modern programming platforms that are much in use (memory management, closures, etc). I wouldn't tout scheme as a "beginning programming language" but I'd tout it as a "programming language to learn the fundamentals of programs for a potential CS major". I'd tout C for neither.
Re:Why not both? (Score:4, Insightful)
Let alone an efficient operating system. You're not going to learn the fundamentals of programming from a language that does it all for you. Java, Scheme (apparently), Visual Basic.. There are *concepts* that you need to take away from things like manual memory management. Do you think these features magically appear in a language?
Learning assembly went a long way towards my being able to understand how to optimize code in a way that makes sense, since it's going to be converted to assembly at some point. If I had never used a language lower-level than C, at best I might have understood this after years of trial-and-error. I shudder to imagine trying to learn to optimize code from using something like Java.
Your basic argument seems to be that the fundamentals of computer science aren't relevant anymore because there are programming languages that abstract the user from them; this is akin to saying that you don't need to know how addition and subtraction work because we have calculators.
Seems silly when you put it in terms that you're familiar with, doesn't it? And besides that, someone has to make the calculators.
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.
choose a good teacher first (Score:4, Interesting)
I have found that in programming, taking a class will cut down on the time spent banging your head against the wall because there's someone to answer your questions, even if they're stupid newbie questions. Programming teachers are usually far more responsive than other teachers (systems analysis, database, e.g.) because it's more practical.
If you're just learning how to program, I wouldn't worry about pointers immediately. Visual Basic is powerful in that you can write applications quickly and learn really fast.
Visual Basic: Schneider [amazon.com]
Java: Barker [amazon.com]
C#: Barker [amazon.com]
Whatever your choice, there are free IDE's for all this now from Sun [sun.com] and Microsoft [microsoft.com], and part of learning will be learning how to navigate the IDE. It's a great time to learn to program.
Where I live, people can't find enough VB or C# programmers, and not enough Java programmers with a security clearance. Before you buy the hype of the next great programming language, check out the want ads on Monster or Dice and see what people need now.
And remember, the highest-paid programmers (not team leaders)still write COBOL for Mainframes, because nobody else knows how to do this, and the big companies still can't get all their systems off of them.
Java snobs? (Score:5, Funny)
Please don't associate those Java users with us C++ (and C for the procedural of us) users.
*shudders* I feel so dirty.
Re:Java snobs? (Score:4, Interesting)
And anyone who's a serious C++/Java programmer doesn't think that C# is for morons, it's just a bit different, but still the same thing. The overall technique to write in the language is still the same, there are just some lexical and some structural differences, but they are not as different as basic and lisp.
It's just the disgusting aftertaste of "pay microsoft a lot to run this faster than mono can do" that quite many people don't like. Mono is on the right path with it's evolution, but it's still not comparable in the terms of speed to microsoft's own platform or to java on any other system. C++ is not being interpreted and jitted so we can skip it in this section.
My vision is that they are all usable languages, you should just use them dependantly from the context, i prefer java because of the cost and portability for now. But if C# get's faster on *nix platforms and matures a bit, i'm sure a lot of people will use it and nobody will call them morons.
I hate the ignorant snobs who think that people who use more portable solutions automatically define C#'rs as morons.
Re:Why not both? (Score:4, Interesting)
BUT. If you want a an easy to learn, object oriented langauge, I VERY highly recommend python. Its not incredibly speedy (there are libraries out there to speed it up), since its an interpreted language, but getting real things done very soon is extremely easy.
I am a gaming and simulation major at a small university, and the first langauge the freshman learn is python, then the second quarter they learn C. Python spoils them, quite frankly. Thankfully, I learned C first, then C++, java, and then python, but I have to say, given a choice as to which langauge I would use for any given console application (I have yet to do GUI with python), hands down it would be python.
I was the only one in my algorithims class that knew python, when I took the class. Other students were extremely jelous that I could more or less type in the pseudo code off the board and have a working program, where as it would take them hours to get an algorithim functioning properly in C or Java.
Re:Why not both? (Score:5, Interesting)
The primary issue with such tools is that they tend to fail spectacularly as soon as they get outside their intended area of use. Visual Basic, for example, came along just in time to be abused for Client/Server development. Since VB wasn't designed with networking in mind, it was often faster and easier to do the code in C (and later Java). VB's life as a GUI front-end was extended thanks to the ability to link in COM+/ActiveX controls for more complex tasks, but GUIs eventually morphed into far more complex variants that the GUI Builder couldn't easily support. (Ever notice how you can spot a Visual Basic application visually?)
At that point, most serious programmers realized that they were taking longer to hack VB to do what they wanted rather than just coding it from scratch in another language. So they gave up on it and moved back to C/C++/Delphi and the new-kid-on-the-block, Java.
Re:Why not both? (Score:3, Interesting)
Agreed. However, it's a part of history that is important for him to understand if he wants to know about the rise and fall of RAD tools and 4GL languages.
VB.Net is useful for far more RAD.
I'd actually argue with that, but not because VB.NET is incapable. VB has been completely overhauled to be compatible with C#. (Which is to say, that it's C# with a new faceplate.) So if you're going to be using the
Re:Why not both? (Score:4, Interesting)
He seemed to think that hiring Visual Basic programmers was a complete waste of money.
Re:Why not both? (Score:5, Insightful)
I may sound old-school, and then maybe I am, but "programming" and "writing a program" seem like two different things to me. If all you want to do is write programs, then I think about any high-level language could be appropriate because programs can be written in any language and high-level ones hide all the ugly computer part from the programmer.
However, if you want to learn to program, then you need some serious commitment, and you need to learn (or at least understand) assembly language, and then work with C or C++ or a language that actually lets you play with bits and bytes.
One of the lead computer people at one of the major oil companies told me once that all that their Visual Basic programmers do is to write meaningless little programs that noone ever uses.
VB is a quite high-level language, and is easy to learn (or at least fiddle with). That lead to a whole bunch of VB coders who pretends they are programmers because they can write programs. However, all they do is write lines after lines of VB code (and most of it is *click* *click* *click* through the UI), with no understanding whatsoever of what is really going on when the program runs. It is really nice when, with little effort, a program can be made and performs the desired operation. However, when a bug arises, those coders that don't understand the low-level stuff might not understand the source of the bug (and then sometimes blame it on someone else), and therefore can't debug their own application.
Every programming language is a tool, and when a job needs be done, one should use the best tool for the job. I suppose there are some jobs for which VB is the best tool. However, when someone claims to be a programmer and only knows VB, chances are he doesn't program, he just knows where to click to create a dialog with some buttons. If he knows VB and C++, Java, PHP, Perl, Python, etc., he's more likely to understand what he does, and will probably write a good VB program if he needs to.
Know your needs and know your wants. If you want to learn how to program, don't choose a language that will hide all the ugly stuff from you, because you need to know about the ugly stuff.
Worked for me. (Score:3, Funny)
Worked for me.
Re:still a toy (Score:3, Interesting)
Here's [regdeveloper.co.uk] a reason not to choose delphi
Another reason is that its not free in any sense of the word.
I'd recommend using Java on eclipse (with the GUI builder if necessary).
Fedora 4 includes an eclipse built on top of a 100% free java stack.
Aside from cost, the reason I wouldn't recommend VB as a starter language is that the syntax is very different than C,C++,C#, Java and many others.
And oh yeah, if you want to teach programming to young children Here's [cox.net] a little IDE I threw together