Trying to help a wannabe programmer

Oh that’s just wrong.

There’s plenty of stuff you can write in VB that you would use yourself. I would guess there’s much more you could write in VB for yourself then there is web stuff you could write.

A media organizer to manage all your music, or pictures, or whatever, would be a good starting point. What are you going to put on your webpage? A picture of yourself and the text, “Hello, world!”?

I agree that VBA isn’t the best place to start. VB is the way to go. Start him with Hello, World! Then have him make an email address book database or something, with bonus points for automating outlook.

How about a stopwatch program? I’m sure there’s something he could use a stopwatch for.

One app that I find myself endlessly writing over again is a wallpaper/startup sound shuffler. I wrote one for 3.1, then had to write a whole new one for 95, then again (a couple months back) for XP. I must have randomized Zappa intro startup sounds, dammit!

Actually, I just remember I once tried to write a programming tutorial myself:

http://members1.chello.nl/~a.vanarum8/Yabasic/ (see the beginner’s guide).

It uses a version of Basic that is fairly simple and commonly available on many platforms, including, as I’ve used here, the Playstation 2 (it should be on the free demo disc you get when you buy it, and you can use most USB keyboards on the PS2 to make typing easier).

I’ve taken a very non-beta approach to programming in this guide, and I think it’s a pretty decent reference too. I’d be interested to hear from anyone, including the object of our attention in the OP, what they think of it - if they thought it was accessible and so on.

From here, I would certainly go on to VB.net or C#.net, though in some ways I do find VB 6.0 an easier start because it allows you to debug and change code while running the program, something which disappeared in VB.net and which I miss, because it greatly speeds up development. I do agree that C# isn’t bad either - it will allow you to switch to Java based languages more easily, and the advantage of stuff like PhP, which is also not too hard to get into, is that you can use it in website context.

Basically, if you want to learn how to program Websites, I do recommend starting with PhP; if you want to learn how to program Windows Applications, go with the free VB.NET offered above. For programming windows applications, .NET is very nicely setup, and what you learn there (including VBA stuff) is very usable in many an office environment.

The advantage of fooling around with VBA per se is that you can do this already if you simply have Microsoft Word installed on your computer. It’s quite fun to do.

“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.” -Edsger Dijkstra, 1972 Turing Award Winner, Author of “GOTO Statement Considered Harmful”, 1968.

I teach Computer Science at an accelerated Private School. I myself cut my teeth on BASIC at age 10, as well as Logo (with Turtle Graphics!). For executables, I now use C, C++, C# and Java. I play around occasionally with Perl, Python and Ruby.

I have found through years of experience that a beginning programming regimen for the young student must meet several criteria:

  1. The student must be able to get up and running doing things that are interesting to them quickly
  2. The programs they create must look like things they have seen elsewhere. Turtle Graphics and console applications may be easy to do, but a 21st Century student does not recognize these as “real world” applications, and can get discouraged.
  3. the skills they learn must be portable. In other words, the syntax and routines they learn must be applicable to and recognizable in as many other situations as possible, or they will feel like they have learned nothing useful. these days, that means stick to the Algol60 continuum, which incorporates Pascal, C, C++, C# Java, Python, Perl, Ruby, etc.

I discovered what I currently regard as the perfect beginner programming language quite by accident last year. In my Computer Science class (the one where they learn programming) I tried doing OpenGL stuff in C, because I thought it might remind them of video games. That worked well, but phase 2, where we got to C++ and OOP, was more difficult than i had expected. No problem, I thought, it’s all part of learning to program, mastering the sometimes arcane complexities.

Meanwhile, over in my Computer Applications class (the one that gets them out of their computer proficiency requirement, where they learn Office) we were doing some XHTML web design. Knowing that the school would support efforts to push beyond the curriculum, i decided to toss in a little Javascript. Not particularly familiar with the language beyond a few basic scripts I had tried, I picked up The Visual QuickStart Guide to Javascript because it was cheap and seemed easy.

The book is broken up into very short lessons, which made it a dream to put lesson plans together. What’s more, if I keyed in a script wrong, the book’s website has all the scripts for easy copy ‘n’ paste.

Requirements: A computer, a text editor (Notepad, saving the files as Type: All Files, and appending .html after all file names), and a browser.

Granted, the students already knew how to put a basic web page, together, but that knowledge takes 10 minutes to learn, especially for the early examples in the book, and they walk through anything more complex that you might need in later chapters. The code for each script page is given a full screenshot and a detailed description of what each part of the code does.

I had my Apps students working with and fully understanding Objects inside of a week. Granted, Javascript is not a particularly powerful language, but it meets all my above criteria.

I now introduced Javascript to my CS class this year, and we do the occasional script as we learn about hardware, OS design, etc. My hope is that they will transition fairly readily to C#, C++ and C before the end of the semester. If the thread is still around in a few weeks, I’ll report back.

He already has everything he needs: A web browser and notepad. I recommend that he start by playing around with Javascript. You don’t even need a web server. He can write pages that do neat things and run them in his browser. He can learn about event management, how to deal with mouse clicks, and he can learn the basic objects that are used in Windows programming (listboxes, text boxes, etc).

Javascript is excellent for just messing around, because the setup is nonexistant, and the turnaround is pretty much instantaneous. You can even download Microsoft’s script debugger and step through the code and look at the variables and see what’s happening.

After he’s comfortable writing simple applications in Javascript, you can download Sun’s Java SDK, and a great free IDE, Eclipse. The two together are an industrial-grade programming environment - one that’s used by some of the biggest companies in the world.

The biggest advantage to Javascript and Java (don’t confuse them - the languages are not even remotely similar) is that there are a ton of learning resources on the web, so you don’t even need to buy computer books.

I do NOT recommend Visual Basic for someone who wants to become a serious programmer, because IMO VB teaches a lot of really sloppy habits. I love the language, and for someone who is already a good programmer VB is excellent for rapid application development - especially things like front-end GUIs for databases and such. But it’s a bad language for a beginner.

On the other end of the spectrum, C++ is just way too hard, especially since to do anything with it on a windows machine you also have to learn some very heavyweight concepts like templates, ATL, COM, etc. Java hides all this complexity for you unless you want to use it for something special.

I’m not sure which version of VB you’re talking about, but VB.NET is barely distinguishable from C# - different keywords, less punctuation, but all the same concepts. If you use Option Strict, which most tutorials recommend, you have to declare variables just like in any other language.

Not quite. That’s true if all you have is an older version of Visual C++, but with the advent of C++Builder and Visual Studio .NET (MC++ and C++/CLI), writing Windows apps in C++ is now just as easy as using Delphi or VB/C#. (Thanks to a few language extensions and clever libraries, but hey, all C++ compilers have extensions.)

Just for the record, the BASIC to which Dijkstra is referring has about as much in common with Visual Basic as a glass of fine wine has with a bowl of moldy grapes.

I looked down on VB, too, until I took a consulting job with a company that required all code to be written in VB–we were using VB 5 at the time, I’m not sure what’s current now–and you’d be pleased to hear there wasn’t a GOTO, GOSUB, or DATA statement in the whole project. I found it an intuitive and powerful tool.

BASIC was the first language I learned, back in the 10 print “hello world” days. It was so incredibly different from the next four languages I learned (APL, Pascal, PL/1, and Fortran IV) that I didn’t find it impaired me at all. Programming in Perl utilized a lot more of my Unix skills than my BASIC skills. I think that Visual C++ and Visual Basic has far more in common than the old BASIC interpreters have with VB.

I taught BASIC for the HP-2000 in 1978, and I taught Visual Basic in 2002. I couldn’t use one single bit of my original curriculum for the new course.

I asked the question in the OP because I found VB very expensive to get started with. The development tools were hundreds of dollars, and I had to upgrade my operating system to get all of the libraries to work properly. “Adam,” as I already mentioned,

Oops! I hit “post” by accident instead of “preview.” To continue that last sentence…

“Adam,” as I already mentioned, is working for minimum wage and can’t afford to spend that kind of money. I don’t even know whether he’s going to be able to grasp all of this. That’s why I was asking for other ideas instead of just telling him to load VB and go.

wow…this is funny…ask a programmer he or she thinks, you might as well ask an economist about the economy. I can’t believe anyone would recommend perl as a beginning language, to say nothing of recommending it as one of the more accessible beginning languages, but hey, that’s just me.

I agreed with everything** Athena** said–before Visual Basic. I also agree with Sam Stone: if he has a computer and an internet connection, he has everything he needs. Books are wonderful, and I love them, but they’re not enough, certainly not just one. The best skill he could possibly learn is not any particular language but the process of learning a language, the process of going from blank screen to…functionality. Forget about building the best online pet store from the gound up; just start with the simplest things, the things that interest him.

JavaScript is a good place to start, particularly because of the amount of free source material one can find on the net. From there he can step into Java, which, no matter what the learned elders tell you, is one of the most accessible and marketable languages today. And literally all you need is NotePad and a browser. Two browsers, in fact: if he tests all his JavaScript through two different browsers, he’ll learn one of the most valuable lessons a programmer can: anyone who tells you that you can write once and run anywhere is full of horse-puckey.

From there, learn some of everything. Once he make the browser start doing tricks, try the same basic tricks in different languages. Internet research is a very valuable skill; knowing where to look and how to look for it. He should try all the languages he wants to; let him follow the one that sparks his interest, that makes the most sense to him. If he’s really going to make his living doing this, then now is the time for him to have fun, to be interested.

God, I feel like an idiot now. I learned regular basic, Commodore 64 machine language, and Perl pretty well, but VB is confusing as all hell to me. I just don’t like the visual interface.

That should be Commodore 64 assembly, although it had to all be translated into hex or decimal for the POKEs.

All this “Aaaargh! BASIC is BAAAAAD and makes people use GOTO statements!” is really funny, or it would be if it wasn’t just a little bit sad; twenty years ago, that might have been the case (although there’s absolutely no reason why it MUST have been - it is perfectly possible to write programs in BASIC that conform to any reasonable definition of good structure), but it certanly isn’t a valid criticism today, making anyone who continues to use the argument look just a trifle silly and out of touch.

Yes, I’m biased, because, yes, I cut my programming teeth on BASIC, but most of that was because it was accessible, as was the literature connected with it - for the absolute beginner, it’s hard to leap straight into C++, simply because it is so often badly taught - many beginners books on C just assume you’ll have picked up concepts like stacks, pointers, libraries, etc by some kind of magical osmosis.

Interestingly, both C and Pascal languages also have a GOTO statement - funny how infrequently that gets a mention.
If you have a logical, analytical mind and a methodical approach, BASIC will not make you a bad programmer or a bad thinker; if you don’t have those things, C, Java, Fortran or God knows what else will not turn you into a programming genius.

This has already been mentioned, but just a reminder: Visual Basic Express is a free download and offers everything a first time programmer needs. Express versions of C#, J#, and C++ are also available here.

If cost is a concern, and you have a copy of Access, you might consider that.

I was going to say that when I was about 10 I learned BASIC from the two books that came with my TRS-80, (not that it would have helped much) but it looks like you may have had a similar start. (When I got to college and had my first COBOL class, and it was said that COBOL used “goto-less” programming, I wondered how such a thing was possible. Turns out pretty easily. I don’t use GOTO’s with VB.net.)

However, I don’t have any experience with programming languages that don’t start with B or C, so I better stay out of this.

I’d suggest Scheme. It lets you learn about programming without getting bogged down in machine-specific trivia.

See http://www.schemers.org/Documents/FAQ/ and http://www.gnu.org/software/mit-scheme/.

Don’t get me wrong, I use curent VB often enough that I’m well aware of how influenced it has been by C++ and OOP in general, and is a much more versatile language than it used to be. I’ve just always been a fan in general of Dijkstra’s anabashedly extreme manner of expressing his opinions, and saw an opportunity to use one of my favorites of his quotes.

That said, I don’t generally like BASIC, old or new, as a beginner’s programming language. The problems with the old versions are obvious at this point. Now, VB, in the Micrsoft IDE has some advantages, in that you can use the GUI tools to get some fun things up and running very quickly without getting too technical conceptually. However, I vividly remember my experience as a youth, having got my Atari 800 to do some cool things with BASIC and Assembler, and feeling, upon glancing at some Pascal syntax (Pascal was the flavor of the month at that point, which certainly dates my childhood), that I had learned nothing useful, which was very discouraging to my young mind. VB has changed enough over the years that a new young programmer today would have a much reduced version of the experience, but VB is still out of the mainstream (in terms of syntax and other such considerations, if not in terms of how widely it is used professionally).

The flavor of the month among the yong computer users in my lab is online Flash games and movies, and I wouldn’t be surprised if exposure to these is what has sparked his interest. Should his fortunes improve in the future to the point that he can afford Macromedia’s Flash composer app, Javascript (linked to ECMAScript, which is the basis for Flash’s internal ActionScript language) will have served him a lot better at that point than VB.

Thanks for all the advice, folks.

What sparked his interest is his role-playing games (RPGs) and collectible card games (CCGs). He wants to write some simple programs for creating characters (basically a set of tables and a random number generator) and formulas for turning Magic the Gathering cards into characters and spells in one of his RPGs.

He’s not into video games. He likes the strategy games with live opponents. Gives him more reaction time (he’s a slow, methodical thinker). He doesn’t have an Internet connection at home. His only phone is a cellphone. He checks his email at the coffee shop.

My initial feeling was to push him toward VB, Delphi, or some other heavily visual language that can give him some instant gratification, but I was worried about cost. It sounds like Visual Basic Express is the ticket, unless Microsoft pulled another one of there “you can only use this on a computer with Internet access” stunts. I’ll see if I can download it and burn him a CD-ROM.

Any suggestions on a good book to start him on VB programming?

Hell, if that’s all he wants to do, he could probably cook up an Excel spreadsheet faster and with less trouble than learning how to program. The RAND, RANDBETWEEN and LOOKUP functions would be his friends.

Given what you’ve now told us, Invisible Wombat, I must now do a complete 180 and second this motion. If this is how he wants to get started, VBA in Excel is indeed the way to go.

And I have just the book for you, too: The astoundingly clever Microsoft Excel VBA Programming for the Absolute Beginner by Duane Birnbaum. It show you how to use Excel to create card and dice games, Battleship with animated graphics, even a 3D version of Tetris! All for $30.00!

I’ve had some great fun with it this year, but apparently you must beware. The examples (included with code on the CD-ROM with the book) were written in Excel 2000. The author claims they will work on older and newer version, but it seems many Amazon reviewers had no such luck (I run them on Excel 2002 with no prob, FYI). Beyond that, this book is a real eye-opener to the potential behind even a seemngly run-of-the-mill business app like Excel.

I recommend it to everyone who ever gets bored at work or wants to show off to their fellow cubicle dwellers, in fact.

How did that book escape my notice? That’s perfect! It’s exactly what he needs. Thank you very much!

Now I just need to dig him up an old copy of Microsoft Office. That shouldn’t be too difficult.