Friday, September 20, 2013

What's Wrong With Visual Basic?

A blog post entitled "To my daughter's high school programming teacher" has been making rounds online. I was curious about it after several retweets in my feed, so I read it.

There are a few things that the letter addresses. My background in the education system gives me a slightly different perspective, but I won't bother getting into the more popular issues it raised. It's already being repeated and rehashed online and all over. So much so she already issued a few updates and a followup post. It would be pointless to rehash the brogrammer culture, even though in this case it's more of a high-school moron culture.

The thing that kind of stood out to me was item number four on her list of suggestions for high school programming; I hope Ms. Endsley doesn't mind me borrowing from her blog here. Her suggestion read: 

"Don't be boring and out-of-date. Visual Basic? Seriously?? Yes, I know I said I'm not writing to complain about your choice of programming languages, even though I'm still scratching my head on this one. The reason I mention your choice is that it doesn't help you make a good first impression on new programmers. I have no idea what my teen learned in your class because she wasn't excited about it. Without touching your minuscule class budget, you can offer a range of instruction with real-world applications. With resources like Codecademy, for example, students could try a variety of programming languages, or focus on ones they find interesting. Have you considered showing kids how to develop a phone app? Program a Raspberry Pi? Create a computer game? Build a website? Good grief, man — how were you even able to make programming boring"

First, the choice of programming link goes to an article where the author downplays learning VB because a search on Dice.com shows few jobs with VB experience in the title. Cobol is gone with the dinosaurs. The first thing to make me pause in his article was the statement that new programmer job-seekers need to focus on web development skills, then followed up stating that Java was more important than Javascript. I'm not a professional programmer, but something didn't quite add up there. I'd love to hear what people in the industry think.

Second, if you're going to do searches for programmer jobs, let's look to the pros at the StackOverflow Careers site (note: I work for these guys.) A search for "Visual Basic" turned up 263 jobs out of 1689 job listings, or about 15.5%. Not great, but it's still out there and in use.

StackOverflow.com has over 53,000 questions tagged "vb.net" out of 5,700,000. That's slightly under one percent. Yikes! On the other hand, the "ruby" tag has 82,400 questions carrying that tag. Java has 478,000, and Javascript has 443,500. Erlang, 3,700. Clojure, 5,800. Not quite the results I expected after reading the article from the Dice.com author.

Then again, you could use something like the TIOBE index for measuring language popularity (don't know why the author didn't use that to begin with...) Java was at the top, followed by C, C++, Objective-C, then PHP, and C#. Visual Basic was 7th. Then Python, Javascript, Ruby at 10th, and down at 13th place was VB.NET. The fact that "(Visual) Basic" was 7th while "Visual Basic .NET" was 13th would lead me to believe there are a lot of VB5 and VB6 applications out there that will continue to need maintenance.

Third, Rikki goes on to point out that her child...and I left out the huge amount of exposure to technology she described earlier in the post...was not excited about the class, and it's because VB doesn't make a good impression. Let's try a variety of languages!

Really? I'm not even sure how this would practically play out in a school setting. You have a teacher who probably isn't programming savvy. If he were, he'd probably be a programmer, not a teacher, considering the education environment today. But this is mere speculation. The programming classes I knew in the districts I worked were typically business or math teachers, primarily, and programming courses came from a course book. The teacher simply doesn't have time to work in a multitude of languages and have it not devolve into a nightmare in terms of keeping up with the student's work.

These are high schoolers. Most of them don't know anything about programming. And they are suddenly open to the choice of all these languages, as proposed...how would they know what's "good?" And it's not like they have four years to choose what they want to dabble in. They probably had to fit it into a semester. And actually accomplish something.

Which brings me to the next point...the first steps of learning the language is boring. Or a pain in the ass, depending on how you're wired. You can't do much with any language without understanding the basics (no pun intended); loops. If-then. While. Functions. Methods. Maybe getting into objects. You want to write a novel, but first have to understand what nouns and verbs are, and how to construct a sentence, then how to construct a paragraph, and somewhere along the way learn how to construct a narrative.

And some of these kids...these are just kids, most of them taking the course to fill in some credits in all probability...won't be able to quite grasp how loops work. Or a function. It'll be tough for them, if they even keep trying; often they give up, or just screw around in class, not caring that they're making it harder for other students who may want to actually learn.

If learning the programming concepts is hard, and learning the syntax is hard, that is still a bit of a cakewalk compared to learning the IDE. Visual Studio is complex. It's got tons of features that beginners won't even touch while making something that is still moderately useable. You could spend a week just exploring all the things Visual Studio brings to the table. But when you are looking for a professional job in programming, Visual Studio is the key tool behind any company using the Microsoft stack. Because of this, you can get tons of examples and help when you have a question.

But it is yet another item that takes time to learn, and for a beginner can get in the way. Not only are you learning concepts and the language, you have to learn to model in your head how event-driven programming works, and how your code ties to specific GUI elements on the form.

I've read that languages like Python and Ruby may be good for beginners. I used Python before; it was nice in many respects. But on the other hand, when learning concepts, you end up with a lot of programs that run at the command prompt. You learn some of the logic behind how to do simple tasks, and the command line is fine for that. Languages like Ruby and Python are great because you install them and can edit them from any text editor. Does that really excite kids though? Learning the concepts but not having anything fancy or graphical to show for it? Maybe you need to install a framework to enable a quick website creation. Then you get to introduce them not just to the language, but to the framework.

"I'm learning Ruby!"
"No, you're learning Rails, and was exposed to Ruby."

 The fact is that in most schools, programming courses are little more than "install Visual Studio Express and follow the exercises." You can criticize the teacher if you want, but there are constraints in budgeting, time, and what the class can be expected to achieve in terms of getting projects done and graded. Nothing prevents the kids from learning more outside class time, and I'm really betting the class is just an introduction, not a training course for a career.

And what of a career with VB.NET? Is it really so horrible? Dot-NET applications are, as I recall, compiled down to a Common Intermediate Language, regardless of the syntax behind them. The Visual Studio family of languages ends up with CIL and are tied to those .NET installs you have to update on your home computer. Is there a performance difference if these kids used something like C# over VB?

I did a quick Google and discovered that I apparently had this question before. It even attracted an answer from Jon Skeet. Basically, no, it doesn't really matter once it is compiled down. You use the language whose syntax you're comfortable with and works for the job at hand.

A little more poking around the sites (for Programming and StackOverflow in the StackExchange network) seems to show that VB.NET has more bias against it not because it is necessarily inherently bad, but because of its heritage. Another irony to the "Why would you choose VB.NET to teach beginners?!," given that BASIC was meant for beginners. It's in the name. Beginners All-purpose Symbolic Instruction Code. While VB grew to something that little resembled the initial language, many professional programmers apparently came to hold disdain over those that would use VB and its ilk, because VB encouraged people who couldn't program to make programs. Similar to hatred towards AOL'ers in the early days of home Internet access because it brought the hopelessly non-technical into the realm of geeks.

That stigma apparently continues today.

I had used VB, among other languages. And as I previously alluded to in a blog post, I decided to make learning a new language a project. I started reading a guide on Ruby; mainly to immerse myself in a bit of the culture while starting to absorb some of the "Ruby way" of doing things. But Rikki's blog post kind of made me want to try something else to get into the beginner's programming mindset. I started working on a project in VB.NET. I'm still reading the guides for Ruby, but I want to see how far I can get on this other project.

I'm sure it wouldn't be a popular choice among real programmers. I'd be the target of disdain and derision, if any programmer read this and took the time to criticize my choices. The only ones I really fear showing anything to are my coworkers since they are working with C# and I'd actually value their opinions.

But I'm not a professional programmer. I don't have years of experience with full time programming. I'm coming to this with just enough experience to know terminology, the basics of a few languages, and eyes fresh enough to have a perspective professionals have probably lost. I suppose the end product will speak for itself, if there is one.

And if it sucks...which it probably will...maybe the next one will be better.

Also, if you are a programmer and have some insight as to why VB.NET is not something to subject new programmers to (using reasons that are rational), I'd love to hear them.

No comments:

Post a Comment