Assorted random stuff.


























 
Archives
<< current













 
This is where you stick random tidbits of information about yourself.



























Random bit stream
 
Tuesday, February 19, 2002  
I hate Visual Basic. A lot. It's supposed to be so fast and easy (a Rapid Application Development system), but all it does is make the easy things easier, and the hard things impossible.

It was decided to write the tradeshow demos in VB because we wanted something spiffy looking and we needed it done in a month and a half (me, I was asking for a spec for this year's demo before the trade show last year...). So they chose VB because it was oh so fast and convenient.

Yeah, right.

First issue. The demo is a prototype application that controls our new color imaging toolkit, which is quite powerful and extremely flexible. We wanted an application that exposed the maximum amount of power and flexibility, while keeping the user interface fairly straightforward and simple. As Apple Computers is fond of saying, "Easy is hard."

I decided, after quite a bit of research into how not to design user interfaces (most advice on the subject is of the what not to do type) I decided that modal dialogs were not the way to go. I hate them, they're annoying, and they violate a number of principles of good UI design, the main one being they keep you from referring back to other data in your app while the dialog hogs the focus. All of the settings dialogs are to be displayed in one area at the top of the app, with the currently selected operation's settings taking over the space. Using the standard VB practice of stacking, I put each operation's controls in a different frame, and stacked the frames. The idea is that you hide all the frames except the one that has the "focus". Worked great, until an error message box pops up from VB:

Reached limit: cannot create any more controls on this form

Apparently you can only put 255ish controls onto any given form, and I'd just hit that undocumented limit. Sounds like a lot, but try stacking 15 or 20 frames with 20 or more controls each, and you'll see why I had that many controls. So I had to start over again, copy controls across frame by frame, and rewrite the underlying code to handle a number of MDI children, minus borders, inside an MDI frame. And of course this means a rewrite of all the underlying code, as well. On to the next compaint...

Undo doesn't work in the form building component.

Don't accidentally delete something, or it's gone. You'll need to recreate it from scratch, and get it sized and posistioned just right or your app will look all wrong, since of course the one you accidentally delete is the control relative to which all others are located. Don't overwrite a control name and then switch focus off the text box either, as that cannot be undone. Have to remember the control name exactly, or it will break the underlying code.

The penultamate complaint is about how VB handles errors upon loading. For example, here's one I got when reopening the project:

Line 13: Class MSComctlLib.StatusBar of control sbStatusBar was not a loaded control class.
Line 43: Class MSComDlg.CommonDialog of control dlgCommonDialog was not a loaded control class.
Line 50: Class MSComctlLib.ImageList of control imlToolbarIcons was not a loaded control class.

Now rember that it's Visual Basic, not Line Numbered Basic. The text editor (what of it there is) hides most of the code from you, and what little is shows you has no way to get a line number relating to that error. So to see what causes the problem you have to load up the .frm file in a text editor (at least it will let you do that--I think VB 3.0 stored the .frm info in a non-text file). So I got this error, and I loaded up the file in an editor that will show me line numbers (yeah, gvim!), and what do I see around line 13?

...
Begin MSComctlLib.StatusBar sbStatusBar
Align = 2 'Align Bottom
Begin VB.Menu mnuFile
...

Note that there is no End for that first Begin. Note that there appears to be some properties missing as well. 51 lines of properties missing, plus the line containing End. That's 52 lines that VB sent off to la-la land for me. Thanks, I needed that. Fortunately, I'm paranoid, and I'd checked my code into SourceSafe several times that day, so I diff'ed the current and previous versions, grabbed the 52 missing lines, stuck them in the .frm file, and reloaded the project.

Ah, well, it's not like I'm under any stress to get this thing done in two more days. At least it's given up on the bad file writing, after a mere 3 times.

7:07 PM

 
As I try to post and publish a long and highly detailed listing, with examples, of why I hate MS Visual Basic, what happens?

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'AND'.

/blog_form-action.pyra, line 44

And, being enframed, I can't back up to a point where I can save my post information. I think the OCBC server saw that I was seriously beating VB (probably by far the most common language used to interface with databases in the MS world) and ate my post. ([10/25/2002]: Just got this: "Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'mid' /blog_edit.pyra, line 74". So they ARE running VB...)

Oh well, there's some consolation--the blogger.com server went away within seconds of the error. It gives me some small measure of consolation to think that I might have killed it.


7:05 PM

 
This e-mail was forwarded to me yesterday:

"Believe it or not but 8.02pm on February 20 this year will be an
historic moment in time.

It will not be marked by the chiming of any clocks or the ringing
of bells, but at that precise time, on that specific date, something
will happen which has not occurred for 1,001 years and will never
happen again.

As the clock ticks over from 8.01pm on Wednesday, February 20, time
will, for sixty seconds only, read in perfect symmetry 2002, 2002,
2002, or to be more precise - 20:02, 20/02, 2002.

This historic event will never have the same poignancy as the 11th
hour of the 11th day of the 11th month which marks Armistice Day, but
it is an event which has only ever happened once before, and is something
which will never be repeated.

The last occasion that time read in such a symmetrical pattern was long
before the days of the digital watch and the 24-hour clock - at 10.01am on
January 10, 1001."

And because the clock only goes up to 23.59, it is something that will
never happen again."

Well, think about it for more than 5 seconds, and it becomes quite obvious that such a thing will in fact happen again, in just under 111 years, at 21:12 on 21/12/2112. The limiting factor here is not the 24 hour time format, for 22:22 and 23:32 are valid times, but the month, which can go no higher than 12.

Someone else dimly realized something was wrong, as today's Joke of the Day from joker.org was the same thing, with this appended:

"Now, of course, it can be pointed out that a similar event will occur at
9:12 pm on December 12, 2112, but that does require a slightly more
artificial take on date formats."

What? How the bloody hell did they miss that one? There's NO way you could get 21/12/2112 out of 12 December, while 21 December as 21/12/2112 is far more natural than 20/02/2002, which would usually be written with the leading zero dropped, as 20/2/2002, destroying the symmetry.

Of course, this was Joke of the Day--perhaps this was meant to be a subtle joke for those perceptive enough to catch the error...

1:34 PM

Monday, February 18, 2002  
I have now created a site for random ranting. As for whether or not I use it, only time will tell...
2:17 PM

 
This page is powered by Blogger.