Coding

Visual Basic

My first language I learned was QBasic, and later Visual Basic. I had a lot of fun with it, make simple little programs to automate stuff or convert numbers, “encrypt” messages, or print ASCII codes.

One particular thing that still strikes me is that development was so simple & fast. You could drag- and drop a user interface in seconds, and then add code afterwards. It felt like you were building a quick UI mock, but in the next moment, you were adding working code on buttons, menu items, etc.

You could create a “Hello world”-App with a GUI in 30 seconds:

After having worked some time with QBasic, switching to C/C++ felt a bit tedious, and even with the Dev-C++ IDE it was harder to get used to the C/C++ style.

Even if I wasn’t happy with basic as a language, I still heavily used it from 2004 to 2009 because development was so fast. On startup, you could choose what type your program would be:

After dragging some buttons and controls onto a window frame, this is what coding looked like:

There was even a basic IDE with autocompletion and error messages on syntax errors. One of the things that always annoyed me was the automatic capitalization of keywords and that you couldn’t have a line which was not syntactically correct, If I remember correctly you couldn’t even switch to another line before fixing your error :-)
I remember having a portable edition of VB6 with everything (graphic editing, coding, exporting of .exe-files) of about 6 MB total!

Projects

Combing through some of the old code, I was reminded once again why (Visual) Basic is just a horrible programming language – (okay, part of it is my own fault :-) Just have a look at the following piece of code:

schlaufe:
Do
x = x + 1
If x > Len(txtHEX.Text) Then GoTo ende
buchstabe = Mid$(txtHEX.Text, Len(txtHEX.Text) - x + 1, 1)
If buchstabe = "A" Then DEZZahl = DEZZahl + (10 * (16 ^ (x - 1)))
...
Ziffer = Val(Mid$(txtHEX.Text, x, 1))
DEZZahl = DEZZahl + (Ziffer * (16 ^ (x - 1)))
If x = 100 Then GoTo ende
Loop

ende:
txtDEZ.Text = DEZZahl
Exit Sub

From_Dez_to_Hex:
Zähler = 0
Erase HEXER
HEXER(1) = Val(txtDEZ.Text)

'berechnen mit Geschachtelter Schlaufe
x = 1

I don’t even know where to start :-)

  • Labels and GOTO’s
  • No indentation at all
  • A mix of German and English for everything
  • Naming: uppercase, lowercase, underscores – a terrible way of naming in general (variable and function names)

Nontheless I did quite some projects in VB. For example a vocabulary trainer, which I named “F4S – Fun 4 school” :-)

I remember getting bored and instead of actually learning French vocabulary, I added a licensing model (for entering a registration key) and later even integrated a MP3-player for listening to your favourite songs while leaning words and even skins for styling. I even made a logo and a website, unfortunately, the latter got lost.

One other thing I remember doing kind of for work was a ACL-Converter, something to convert Auto-correct lists (*.ACL) into plain Excel.

I put this and the other old Visual Basic code on Github, so you can check it out here.

Happy coding!

adrianus
---

« Older