Sunday, July 08, 2007

There's an interesting discussion on SlashDot asking the question of whether we collective programmers should drop the old "80 column" standard that's still so prevalent and go with some larger number, say 132, or, possibly something even bigger.

With the new widescreen displays, this would almost seem to make perfect sense.

But I think I'd side with the majority of posters that 80 columns is more than enough in most situations. Besides that, there are very good reasons that newspapers and magazines don't print articles the full width of the page, but instead create columns. The eye just has a hard time sucking up that much stuff .

In the typical programming book I have, I counted an average of about 74 chars per line (proportional, so the number could vary, though not by much). In the paper back books I checked, I see about 54 chars per line. These are single column books.

80 would seem just about right. Long enough to deal with the typical indentation of a programming language, but short enough to keep you from getting lost on the line.

Besides, other than those lines with long tables or strings of text, why would you create a very long line of code? C is pretty notorious for allowing such nonsense with it's ? operator and inline assignments, but there's very few that would argue those things make the code more readable. VB has it's ":" statement separator, but there are very few instances where I've seen it put to particularly good use.

Convention generally holds that you want to stick to one statement per line. And typical statements should be far less than 80 chars long.

On a related note, I have a few other questions to throw out

  • How many spaces should a tab comprise?
  • Is it better to program black on white or white on black?
  • Do color coded syntax highlighting editors actually help or just distract?
  • Should web pages go columnar when the chars per line exceed some number (for instance, browsing full screen on a widescreen monitor)?

For me, it's:

  • 3 (2 is too few to be visually distinct, and 4+ takes up too much line space),
  • White on Black (with a white background, there's just too much light coming at me. It's almost blinding to run an editor full screen on a 24" widescreen with a white background.
  • Not much, although I do tend to color comments in a dimmer color than the rest of the code. Everything else I tend to leave as white text, unless it's a very specific file format. For instance, I have coloring rules for INI files and XML files to highlight the sections, keynames, and element tags.
  • Up in the air on this one. On slashdot, maximized, I count about 230 chars per line on my widescreen monitor. They run as a single column and just stretch it out to accommodate the browser. Many news pages simply limit the max width of the page to somewhere around 1024 pixels or so. Here's a typical MSN page maximized on my system:

image

That seems like a waste to me.

posted on Sunday, July 08, 2007 8:00:19 AM (Central Standard Time, UTC-06:00)   •  # •  Comments [3] • 
Kick it •  Add to del.icio.us •  View blog reactions; 
 Saturday, July 07, 2007

How's this for a peculiar error message:

image

This one is from FileBackPC (a normally awesome little backup app). I can configured a rule for my server (which runs FileBack) to reach out to each of my workstations and grab a backup of certain folders, including the entire user profile.

There's the rub. Apparently, Vista creates a hardlink from the "Application Data" folder back to its parent. This results in a recursive folder structure that is guaranteed to give fits to any app that recursively traverses the dir structure.

Vista itself appears to "know" what's up though. You get this if you try to navigate into the Application Data folder via Explorer:

image

This same technique works great with XP. In the FileBack, I just had to reconfigure the rule to not traverse into that folder. Other apps might not be so obliging.

Sigh. Yet another one of "those little issues."

posted on Saturday, July 07, 2007 9:10:36 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [4] • 
Kick it •  Add to del.icio.us •  View blog reactions; 

Apparently, DirectX supports something called "retained mode". Not exactly sure what it is or what it does.

But I just found out that one of my favorite apps, Flying Model Simulator or FMS requires it and you get a lovely dialog that "D3DRM.DLL cannot be loaded" when you install the latest FMS 2 Alpha 85

A little digging and it seems this is quite the problem with a number of older DirectX programs. I suppose MS figured that if the app is more than a few years old, nobody would possibly want to use it anymore:-(

Anyway, this forum posting discusses the problem and pointed me to the Dell web site here to download the missing file.

Copy it to my fresh and shiny clean System32 folder and I'm flying my simulated RC heli again.

image

Here's something interesting. If I switch windows away from FMS, it pauses in the background, which is actually quite nice.

I don't recall it doing that under XP.

Something to actually like about Vista? I...feel....so....dirty.... 

posted on Saturday, July 07, 2007 12:06:28 AM (Central Standard Time, UTC-06:00)   •  # •  Comments [3] • 
Kick it •  Add to del.icio.us •  View blog reactions; 
 Friday, July 06, 2007

Well, I finally succumbed.

After hours of working to get some scripts going that, with XP took all over about 10 minutes the first time around, I've given up.

I simply opened the Windows Users control panel applet and turned off UAC.

image

Lo and behold, everything works just like it did back in XP.

I know, I know. "Users won't run with UAC turned off so how are you going to properly test your app?"

Well, how 'bout a VM with Vista in it and the UAC turned on?

Even better, my user account with UAC off, and a Test User account with minimal rights and UAC turned on. (But I haven't yet figured out how or if  you can turn UAC on, on an account by account basis, Anyone have any ideas?)

I'm not happy about it, but I refuse to spend any more of my time clicking those damn "accept" boxes.

Not only that, but I've heard not just a few respected programmers in the community say things to the effect of "Vista is just too difficult to program under, I'm going back to XP."

My question is, if running Vista without the UAC is basically like running XP, then, at least from a developer perspective, why not just run Vista without the UAC, then test on a VM with it? Does continuing on with XP bring anything to the table that Vista without UAC leaves out? From what I can tell, no.

Is it ideal? No. Is it better than XP? Well, the drivers and eye candy are nice, but otherwise, I don't see much difference. Surely there's additional security details that have been cooked in that have nothing to do with UAC, so I'll get their benefits.

And when PowerToys for UAC (Ugh) comes out and I can munge the UAC as necessary to get everything I need working properly, I can turn it back on.

posted on Friday, July 06, 2007 2:01:49 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [1] • 
Kick it •  Add to del.icio.us •  View blog reactions; 
 Thursday, July 05, 2007

Bill McCarthy has written a very revealing "What's Hot" for the July Visual Studio Magazine. First off, the name of the "version after the next version" of VB (VB 10) is apparently VBx. I have to believe that that's some small homage to VB3 (for those that were around, that was the summer of '93, I still have the 5.25" floppies of the beta)  and the .VBX custom control that was the precursor to VB's OLE custom controls (OCX's) and in many ways, VB's entire concept of classes.

I suppose if it was less than 14 years ago, there might be some confusion over the naming, but, hey, it was 14 years ago, so I'll let that slide\:\-\) .

One minor note here. Bill's article indicates that VBx is the "next version of the VB compiler", which isn't quite true according to this posting on the VB Blog.

Bigger news is that the VB team is rolling out the Interop Forms Toolkit 2.0, which allows you to create OCX controls and integrations with VB6, in VB.NET. Now, as intriguing as this nugget is, it makes me wonder. VB6 is scheduled for End-of-Life in 2008. Introducing such a toolkit so close to that end-of-life would seem to be an implicit acknowledgement that, well, somebody screwed the pooch. This is a pretty clear indicator that, as much as Microsoft would love to see VB6 die, they've come to a realization that maybe, just maybe, people have very good reasons to continue using code that works. Maybe this realization will be the kick in the pants for Microsoft to not pull stupid semantic tricks with future VBs that break all sorts of backwards compatibility, again. Hmmm, and maybe Chuck E. Cheese will one day be a fun place for adults to hang out, too.

But, by far the biggest news to hit me square in the jaw was the VB group's plans to have VB10, er, VBx written in VB itself! For me, this is simply huge. I've always said there are a certain fundamental class of problems a compiler presents that a good language should be able accommodate, and finally, VB will become one of those languages. I for one, have heard one too many times "If VB was any good, it'd be written in VB." 'Bout damn time!

Of course, there's this troubling passage on the blog

"Currently VBx is in very early stages, and is a long way off from production. In fact, most of our development team is actively working on VB 9."

Doh. Well, so VB get's real when I finally get my flying car (that's this one, not this one)

posted on Thursday, July 05, 2007 8:55:46 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [0] • 
Kick it •  Add to del.icio.us •  View blog reactions; 

On my setup, I have a file server with a RAID that generally is a bare (but SP'd and updated) Win2003 server install, ie a very minimal installation. At one point I set up ADS with a domain, DNS, etc. Nowadays, I still setup the DNS server on this box, but generally don't make use of ADS, in my (albeit weak) attempt at simplification.

On my workstations, I install Win2000/XP/Vista in Workgroup mode and use identical passwords and user accounts on the server and each workstation. That way, legacy login support kicks in and login validations still apply, but I don't have to mess with ADS and domains to make it happen. Not as secure as ADS, but not completely open either. 

One thing I tend to do, when possible, is install apps to a network drive and run them from there. I say when possible because for those apps that require COM registration, etc, this doesn't work too well. But there are plenty of apps that work just fine this way, including Trillian, Keepass, InfoSelect, NotePad++, IrfanView, etc. Keeps me from having to reinstall and redo configuration.

With the latest install of Vista, however, I was getting a "Are you sure" dialog like this every time I went to run an app off a server share.

image

Now, before people start screaming "Good Lord, don't turn that off, there's no telling what might have replaced that app out on the network! How do you know it's safe?!", the fact is that my entire network runs behind a firewall, and all machines run NOD32. If something infected an app out on the server share, it's just as likely to have already infected my local workstation anyway.

I'd rather not have to "accept" running any app off the server every time I want to, so what I needed was a way to tell Windows, "Hey, it's OK to run files from these locations, I'm fairly certain they're safe".

Come to find out, such a setting exists, of all places, in the Internet Settings area of the Control Panel:

image

image 

Make sure the Local Intranet security is medium-low or lower. This is the default though, and doesn't appear to need to be changed.

image 

image 

At this point, just enter the UNC of your server, say \\MyServer (you only need to enter the root server name, unless you specifically don't trust certain shares on your server, in which case you could specify the server and share name, such as \\MyServer\MyTrustedShare.

image 

And that's it.

If there are any significant security issues with this approach, I'm not seeing them. I have to trust my server as much as my workstations (if not more, since I rarely actually install any software on my server. Anybody care to enlighten me?

posted on Wednesday, July 04, 2007 11:28:44 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [5] • 
Kick it •  Add to del.icio.us •  View blog reactions; 
 Wednesday, July 04, 2007

I've read a ton of good press about BlogJet and from the demo I looked at it's pretty slick. But BlogDesk is free and does everything I needed it to, until now.

I have to say, Windows Live Writer is an awfully nice way to write blogs, and it's free as well. It works smashingly with dasBlog, sets up on Vista without a hitch, has a built in spell checker, which myself (and a lot of blog writers out there) need, and can even edit blog entries using the styles cribbed from you blog itself.

Check out this screenshot of Live Writer entering this actual entry.

image

Sweetness. And it pulled the style sheets automatically. It doesn't look exactly  like my blog, but hey, that's pretty good for being editable!

Finally, if you prefer, there's all sorts of effects you can give graphics as you paste them in. I tend towards the simplistic, but there's drop shadows, overlays, transforms, etc to play with.

UPDATE: Well, Live Writer is nice, but it's definitely still beta. With lots of images, it seems to crash when loading drafts to continue editing. But it works well enough for image-light pages, so your mileage may vary.

posted on Wednesday, July 04, 2007 5:00:52 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [0] • 
Kick it •  Add to del.icio.us •  View blog reactions; 
 Tuesday, July 03, 2007

eWeek recently reported here that the Gartner Group released a report back in May stating that the 40 hour work week is "going the way of the dinosaur."

Maybe, but I wouldn't put money on it.

I'd be more willing to bet that the concept of spending 40 hours a week in an office environment might be dying off. But as anyone who's worked in tech will tell you, only 40 hour weeks are more an oddity that the norm.

And as the labor pool continues to shrink (think boomers and college students disillusioned with the whole idea of tech), how realistic will it be for those getting into the field to insist on 20-30 hr weeks? When I was looking, I saw more than a few postings with comments along the lines of "involves on-call rotation", "must be willing to work hours as necessary", "able to open a vein on demand", that kind of stuff.

One read through just about any Network World or eWeek and you'll see interviews with C-level execs and tech managers describing how they love their 80+ hour a week jobs, and how things are so much better now that they can work via blackberry while climbing in the Rockies with their families (I just don't want them belaying me!).

Interestingly, there was another article in the issue about telecommuters and how they tend to burn out quicker than non-telecommuters because they actually inadvertently work more than if they were going into an office. When your office is your home, it's easy to get sucked in like that. The author also mentions how, as a telecommuter, you tend to believe you need to work harder to prove you're actually working. In an office, apparently just showing up means you're doing your job.

It'll definitely be interesting to see how all this shakes out over the next 20 or so years.

posted on Tuesday, July 03, 2007 9:47:10 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [0] • 
Kick it •  Add to del.icio.us •  View blog reactions; 

I've used TrueLaunchBar for quite some time and find it indispensable for many things. Under XP, I'd switch off the Start Button completely (using their StartKiller) and use TrueLaunchBar menus for everything.

Of course, I use a Quick Launch bar at the bottom of the screen as well as a task bar, etc, but I find it quite handy to have an AutoHide toolbar docked to the left edge of the screen that contains often used folders, and other kinds of shortcuts.

Well, I created a folder specifically for my Left Edge short cuts, just like in XP, created a toolbar for it which shows  up at the bottom of the screen (next to the TaskBar) and then tried to drag it up to the left edge. No joy!

What the hell! Surely MS didn't remove this functionality? Ah, but apparently, they have, for usability reasons. Hmmm.

However, on that same page, a commenter notes that you can still accomplish this, just not like you used to.

Basically, create a folder that you'll use to store your shortcuts, browse to it with Explorer, then drag the folder from Explorer to the left edge of the screen. Right click on it to set some properties (title bar, etc). Viola! Toolbar on the left edge again.

image

Note that it looks a little funny with the thick translucent borders, but it works none-the-less.

Oh, and that folder with the right pointing arrow below it? That's a TrueLaunchBar thing, too. 

posted on Tuesday, July 03, 2007 9:22:15 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [0] • 
Kick it •  Add to del.icio.us •  View blog reactions; 

Something that's always bugged me about the scroll wheel is that it seems you have to upgrade your mouse with each new Windows in order for the scrolling to work properly.

For instance, I have an older Logitech MouseMan Dual Optical Corded mouse. Great mouse. Lousy scroll support.

The Logitech MouseWare drivers don't scroll legacy app windows that have scroll bars but don't react to the newer mouse scroll messages.

All the latest Intellipoint drivers don't scroll legacy apps properly with it either (and possibly not even with a newer mouse, but I don't have a newer mouse so...)

Way back when, I came across the Intellipoint 4.1 driver set that DID scroll legacy apps properly (like VB6, the main one I'm concerned with anyway).

Well, Vista flat refuses that driver set . I tried the latest Intellipoint, 6.1. It installs but doesn't scroll right. I tried the latest SETPOINT400.EXE from Logitech. No good either. Uninstalled both and I'm back to the built-in Vista Mouse Driver.

Then I came across KatMouse. Tiny little app, but works a treat. Sends legacy scroll messages to the window under the mouse. And it doesn't screw with newer apps that DO handle the mouse scroll wheel messages. Plus you can customize the scroll support per App or Window Class (and God knows my favorite thing to do is poke around windows with WinSpy looking up window classes so I can set each one to different scroll numbers\:\-\) )

I'm sure there's more involved, more flexible utilities out there to do the same thing, but I haven't seen any yet. Any pointers?

posted on Tuesday, July 03, 2007 9:05:31 PM (Central Standard Time, UTC-06:00)   •  # •  Comments [0] • 
Kick it •  Add to del.icio.us •  View blog reactions;