Slashdot Mirror


Is Visual Basic a Good Beginner's Language?

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#?"

17 of 1,100 comments (clear)

  1. still C by engagebot · · Score: 3, Interesting

    For a true beginner, I still say regular old C is the way to go. Learn how variables work, function calls, passing arguments, pointers... There's something to be said with starting out compiling a single .c source file with gcc.

    --
    Han shot first.
    1. Re:still C by Pseudonym · · Score: 4, 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.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  2. Bad idea by AKAImBatman · · Score: 4, Interesting

    Really Short Answer: No.

    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 .NET, for no other reason than because C# requires it) is that VB passes off this idiotic idea of grouped functions as "Object Oriented Programming". The fact that these "objects" can't be instantiated, nor can they be used as Abstract Data Types, makes them utterly useless for OOP development. I would even go as far as to say that VB's previous implemenation of OOP was misleading and dangerous.

    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.

  3. And now for something completely different... by jcwynholds · · Score: 5, Interesting

    Python has been suggested. I also fall in the camp that say that python is probably the best learner language. Interpreter is freely available for all popular platforms. Python has enough of the niceties of VB (no strong types, easy array/dictionary construction, etc) while having enough features of a "real" programming language (shared memory, forking, etc) to teach about the concepts.

    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.

  4. Re:Visual Studio and Visual Basic by object88 · · Score: 5, Interesting

    On the other hand, I would not recommend a beginner to use Visual Studio or any of the IDE where you drag-and-drop to program.

    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.

  5. Re:Why not both? by AKAImBatman · · Score: 5, Interesting

    Rapid Application Development. Tools like Visual Basic and other 4GL langauges were intended to improve software development speed and accuracy by providing tools whereby the computer automatically did as much of the work as possible. The most common type of RAD tool was GUI Builders like Visual Basic. (Though there were quite a few for database development, networking, gaming, and other areas.)

    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.

  6. Re:Visual Basic is horrible; use Python by XxtraLarGe · · Score: 4, Interesting

    I would argue that Javascript is even better for a newbie. No special software (only a web browser & text editor are needed), no compiler, and it runs on almost every platform available. It uses variables, arrays, loops and functions. You can make changes and see results almost immediately. Just refresh the page!

    --
    Taking guns away from the 99% gives the 1% 100% of the power.
  7. choose a good teacher first by sampas · · Score: 4, Interesting

    Actually, Java and C# have nearly identical syntax. I would suggest learning Object-Oriented to start, and concentrating on what OO is, rather than all the power of a specific language. OO is definitely the future, but many people who transition from procedural or don't learn the power of objects from the beginning just use Java or C# as procedural languages.

    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

    Java: Barker

    C#: Barker

    Whatever your choice, there are free IDE's for all this now from Sun and Microsoft, 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.

  8. Re:Why not both? by eric76 · · Score: 3, Interesting

    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.

    He seemed to think that hiring Visual Basic programmers was a complete waste of money.

  9. Re:Bad idea- compilers by TheRaven64 · · Score: 3, Interesting
    I would say that the first three languages a person should learn (not in any particular order) are:
    • Smalltalk
    • LISP
    • Prolog
    These teach different styles of programming and a lot of useful concepts. I might throw Pascal into that mix too. The next languages that they should learn are C (for when you really want an assembler, but need to be cross platform) and Erlang (for when scalability is king).

    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.

    --
    I am TheRaven on Soylent News
  10. Re:No. by PeterBrett · · Score: 4, 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.

  11. Your SECOND language is the important one! by alispguru · · Score: 3, Interesting
    You can become a decent programmer starting from any language, as long as you ultimately:

    * 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.

    --

    To a Lisp hacker, XML is S-expressions in drag.
  12. Re:Why not both? by lrichardson · · Score: 4, 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.

  13. Re:Why not both? by I'm+Don+Giovanni · · Score: 5, Interesting

    C?? Pleas...

    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 :p). The issues that you're talking about are becoming more and more irrelevant, just as machine-language programming did (for 99.9999% of source code).

    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.

    --
    -- "I never gave these stories much credence." - HAL 9000
  14. Re:Why not both? by Beowulf_Boy · · Score: 3, Interesting

    I learned 4 other languages before I learned VB. I was rather suprised at how powerful it really was. I had been told all along "VB is for idiots, blah blah blah", and then I took a GUI programming class, and the langauge we used to write our little example GUIs in was VB. It was amazing how quickly I could get a nice looking application up and running and doing something useful.

    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.

  15. Re:Java snobs? by moro_666 · · Score: 3, Interesting

    I think nowadays more than 50% of java coders dont know much about c++. althrough they would manage to write simpler stuff in c++ just by the guts.

      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.

    --

    I'd tell you the chances of this story being a dupe, but you wouldn't like it.
  16. Re:Why not both? by packman · · Score: 3, Interesting

    Sorry - but this is pure bullshit imho. I think it's really UgLy that YoU Can WritE aNytHing caSe inSenSitiVe, or do you like this last part of the sentence?

    If you have a function thisDoesSomeStuff() and you see it being used like Thisdoessomestuff() thisdoessomeStuff() thisdoesDomeStuff() all over the place, that's pritty ugly imho. And to be honest - I never had problems with case sensitivity in my whole carreer - even in the beginning. I think it's a good thing that you should mind what you're typing - this doesn't give the impression that the computer is smart and will try it's best to understand you. As a programmer you should very well be aware that the thing you're trying to tell has to be explained as if it is a complete moron you're talking to.

    Another point - the shifted delimiters. First of all - you always use both hands if you code a lot, so I don't really see the problem. I did write some code in VB - and that's exactly the thing that I absolutely HATE - no clear delimiters. In any decent editor - you can jump to the matching bracket with a simple key-combo. In VB - this is not possible in a simple manner.

    I personally think you should keep beginning programmers on a very short leech, make them very aware of what happens if they do something stupid. The most important thing about being a programmer is absolutely not the language, but the thinking. VB does too much thinking for them. Yes it's "easy" - but programming is not supposed to be "easy" - bugs are also made "easily", and doing stupid things that work are even "easier".

    I personally would start with C or Java or C#, in the beginning preferably C actually and let them implement things which actually does something seriously wrong (buffer overflow etc) and explain what this is. Afterwards, once they understand the basics like functions, loops, variables, arrays - switch to Java or C#. The difference isn't that big - so it won't have any problems. You simply explain that here, boundry-checking is done for you. Then you can start with sorting and other basic algorithms/concepts like recursion. Next step is oop. I can't understand how programmers can be trained without basic concepts of the OS and memory-model. I have seen more than 1 example of a programmer using smth "standard" in VB, i.e. hidden listboxes to store large amounts of data.

    I've encountered too much developers (not only VB, but sadly enough but still majority) who simply have no idea what something does if they use it. If you would ask them to write smth simular themselves they would simply stare at you like you just asked them to prove that einstein's relativity theory was wrong. They just stop thinking beyond their comfortable "everything is magic" world...