Friday, January 6, 2012

Projects in Visual Basic

Visual Basic is a fun little programming environment/language. It's good for creating quick prototypes or making a simple interface to perform repetitive tasks in a Windows environment. I'm sure you could do big, fancy stuff in VB, but generally you'd use a more powerful language for big projects that need to be optimized or run in cross-platform environments. Something that is neat about it is that it's the language used to write macros in MS Office. So if you have a great reason to use a macro, you'll want to know a little VB. Please don't use macros if you have anything less than a great reason.

Given the quick and dirty nature of it, it's no surprise that it's the language taught to business students who need to understand a bit of programming but don't need to be able to create their own compiler or operating system. One thing I liked about this course was that of all the programming courses I've taken, it was one of the few actually taught by faculty in my department. I worked in the Computer Science department for 5 years and don't have anything against CS faculty at all, but there's a greater connection having someone from your own department teaching a course.

As a case in point, look at this particular course. When I took it, it was the last semester that just one undergraduate version of the course was taught. The whole semester, the professor who taught it would bag on accounting students or other non-MIS business majors who didn't know anything about computers or programming. They were in the same section as the students with more technical majors, because there wasn't another option. All we heard about was how the professor wanted to move on to all these advanced concepts but couldn't because of the accounting students holding us back. This, of course, was the same thing I heard as an MIS student in CS classes, how we weren't real programmers like the CS students. So CS bags on MIS; MIS bags on accounting; maybe accounting bags on human resources or marketing? At least marketers have a handle on social media, so it's probably HR that's the bottom of the technology food chain.

However the pecking order goes, the next semester would see two versions of the course, for technical and non-technical business majors. I don't know how much they lightened the load in the non-technical version, since VB is already a junior version of programming.

For an example of a quick program I wrote in VB several years later, I created a small program to automate common tasks in the testing center I used to run. I created a map of the lab with a button for each computer and for common actions. You would select the computer and then click the button for the action you wanted to perform: view the screen, reboot it, shut it down, turn it on, or mark that it was being used to take a certain test. It even had an option to cancel the shut down command if you accidentally selected the wrong computer and realized it within 5 seconds. Students get freaked out for some reason when their computer shuts down on them in the middle of a test. The funnest options were to start up or shut down all the computers at the same time. It was like a race to see which computer would boot up first, and the silence when all the fans came to a stop was so peaceful.

The program was pretty simple and was very inelegantly written but saved a ton of time for those working the lab. An employee of mine sought to improve on my design and write a fancy version 2.0 with all kinds of customization options to work in other computer labs, but quick and dirty won the race. As long as he worked on it, he never got version 2.0 working.