One Experience for Everything in Your Life???

vehicles

I keep seeing these Microsoft ads trumpeting “One Experience” for all your computing needs, with Windows 8 on tablet, laptop, and desktop, and the similar-feeling Windows Phone on your phone.  This is their big theory, their almighty goal going forward.

It’s also why their product isn’t selling like they want it to.  It’s a bad theory.

Let’s move to a different machine space for a moment… vehicles.  I own a Pontiac Vibe, one of the last made before Pontiac closed down.  It’s a hatchback, reasonably fuel efficient, big enough to haul computers with a hatch large enough for a good-sized laser printer in a box.  Right now it has a substantial amount of inventory in it, parts that I might need when fixing computers.

I also own a Yamaha TW-200 motorcycle.  It’s amazing fun to ride, goes anywhere, fits the most screwed-up parking space and gets 70 MPG.  Then there’s my Ford F-150 pickup.  It has 4 wheel drive, goes almost anywhere, is comfortable and hauls a lot of stuff.

All three vehicles will haul my butt to work.  The bike is by far the most fun, but it’s only practical to ride it to work on short to moderate length trips (too small for the Interstate), and then only when I don’t have to haul more stuff than will fit in a backpack.  The Vibe is my “default” work vehicle, but on icy roads or on gravel it’s a bit of a hockey puck; the low-rolling-resistance tires don’t stick worth a darn to any surface other than clean dry pavement.  When the roads are snow covered or icy, the only choice is the F-150.  It’s also the only choice when I go out to buy furniture or home improvement materials (lumber, plywood, sheetrock, etc.).

My point is, they don’t have the same experience.  The truck is sort of like the car, but the motorcycle, now, that is a totally different experience.  Handlebars, hand throttle, hand clutch, foot shifter, separate front and rear brake, the former at my right hand and the latter at my right foot.  But that’s just the basics you need to get it rolling; riding a motorcycle is much different than driving a car.  You lean into corners, so the G forces are distributed differently.  There’s no cage of glass and steel around  you… you’re in the world, not separated from it.  In plainer words, it feels different.

I think this analogy applies perfectly to the Windows 8 situation.  Microsoft saw the rise of the tablet, a lightweight mobile device that’s fun to use but more limited, and decided that desktop and laptop computers ought to work the same way.  A tablet has a user interface designed for fingers, rather than one designed for keyboard and mouse.  It feels different.

A big part of Microsoft’s theory is that we are too stupid to work technology unless the user interface is the same everywhere.  I consider myself reasonably proficient both at driving a car and riding a motorcycle, and they have very different user interfaces.  Many people proficiently do both.  It’s not that hard.

So what Microsoft did is like putting handlebars, a hand throttle, separate brakes, hand clutch and foot shifter in a car or pickup.  It makes absolutely no sense.  Oh, sure, there would be a few people who climbed into that pickup truck with a set of handlebars installed and say “Cool, this is what I’ve always wanted!”  But it would be a flop in the marketplace.

The key difference here is that, for the last two decades, almost all “small computer” work has been done on computers running a Microsoft operating system.  So this isn’t like Ford putting handlebars on a truck… it’s more like if almost all auto makers changed to handlebars overnight, and you had to buy from lesser-known brands with limited parts and service availability to get a steering wheel.

If that happened, though, it would only be a matter of time before those lesser-known brands gained market share substantially.  Will we see that in the computer industry?  I’d like to hope so.

PollyReports Additional Bands

I’ve added a new feature to the 1.7.6 version of PollyReports: additionalbands.  A Band instance may have one or more additionalbands defined (as a list of Band instances), and each will be rendered in order after the parent band renders.

Conceptually, this is much like the existing childbands feature; however, childbands become “part” of the parent band, rendering on the same page (and potentially forcing a page break before the parent band).  additionalbands are separate from the parent band, and from each other.

I added the feature to deal with a report that needed a two page long report footer.  So that’s what it’s for.

additionalbands render as part of the detailband, in groupheaders and groupfooters, and in the reportfooter.  They are not rendered as part of a pageheader or pagefooter band.  Also note that additionalbands will render childbands of their own.

Remember, you can get PollyReports using pip or by cloning the Github repo at:

http://github.com/Solomoriah/PollyReports

Why I don’t like the “Cloud”

This question comes up a lot with my customers… “should I put my data in the cloud?”  When it does, I recount the following story:

Years ago when I started working with computers, all the local school districts had software from the same company.  We’ll call them OldCo (obviously not their real name) for the purposes of this discussion.  OldCo also sold software targeted at city governments, and I had a few city customers using some of those products.

OldCo’s software was all DOS based.  They started a project to convert their school accounting and student records programs to Windows.  Just as they were about to begin beta testing of their Windows accounting software, the database vendor they were using went out of business.

So they couldn’t buy the necessary licenses to resell to their customers.

They started all over at that point, essentially scrapping the entire project, and switched to an entirely Microsoft-oriented codebase, using SQL server as their backend.  This put them way behind their planned deployment schedule, not to mention costing them a bunch of money.

Along came another company, which we’ll call OSC (Other Software Company).  They were another major player in the school software business, and their software supported Windows already.  OSC bought out OldCo to get their customer base (a sound strategy I’m sure), and pushed all those schools into switching to their student records software.  They didn’t have a school accounting program, but that was okay with them… they kept the OldCo staffers who understood that program and continued to maintain and sell it.

Who’s missing here?  The city government customers.  OSC notified them that they would not be supporting or selling OldCo city government software any more, and no, they wouldn’t really help anyone extract their data from it either.

Those city government customers were cut off from support, but at least they could keep using the programs.  If their data was stored in someone else’s cloud, and that someone else closed their service for any reason, where would they be then?

This is why I don’t like the Cloud.

I am a Rockstar Programmer?

There has been a lot of talk lately about the “rockstar programmer” (aka the “10x” programmer); specifically, whether or not such a creature exists.  For instance, on Hacker News today I saw Scott Hanselman’s article The Myth of the Rockstar Programmer, which is very critical of the idea.

I think it’s more complicated than that.  You see, I am a “10x programmer.”

Sometimes.

I run a one-man programming operation as a sort of side-business; I’ve been writing application software for vertical (mostly local government) customers for many years, in a variety of languages.  Most recently I’ve been focusing on web-based apps in Python (and of course, Javascript).  I’ve spent many an hour working on these programs, and I can tell you that most of the time I’d call my productivity average.

But a couple of years ago, near the beginning of my love affair with Python, I wrote an application for handling city property taxes for a small town.  My understanding when they contracted the work was that they just wanted help with some Excel files… but it was more than that.  They really needed a program similar to the ones I had written for several county-level customers.

So in the course of about five hours of wild-eyed hacking, I wrote it.  I repurposed a few small components from a personal project, but even so most of the code was new, and surprisingly it works pretty well.  Since then, two other small towns have acquired versions of the program, largely cloned from that original program, and in each case it took me more time to customize the program for them than it did to write it in the first place.

I still don’t know how I did that.  Zero testing.  Solving problems I was uncertain about not by research, but by going around, over, or under them.  But it worked great for the original customer for the entire first year, and has required only another hour here or there in maintenance, mostly adding features.

It’s not the only time I ever did that.  I have other programs, or parts of programs, written in the same way, usually under time pressure but sometimes just because I felt like it.  If I worked more consistently in software development (full time, as opposed to basically part time now), I might do that sort of production more often… but I really don’t know.

It’s a mystery to me.

Worst Time Ever to Buy a Computer

This is the worst time in many, many years to buy a new computer at retail, and it’s all Microsoft’s fault.  Windows 8 is, in my opinion, the worst new version of Windows ever.

There are many ways to define “worst” so let me start by explaining what I mean by it.  I sell computers mainly to people who know that they will need professional assistance.  They trust me to sell them what they need to do their work, and to fix their computers when they go wrong.  So my definition of a “good” operating system is one that generates fewer unhappy phone calls.

Windows 95 and 98 were prone to lockups and blue screens; Windows XP made those problems better, and added a lot of nice functionality.  It’s no accident that Windows XP right now commands just over 38% of the desktop operating system market, according to netmarketshare.com’s March 2013 statistics; it’s the #2 version of Windows, and the #2 desktop operating system overall.  It was pretty good, obviously.

Windows Vista came along, and we all hated it.  It felt slow and clunky, and had no real advantages over XP for most business and home users.  But Windows 7 appeared and redeemed the name; it had much the same user interface as Vista, but didn’t feel clunky anymore.

Throughout all that, the PC world was dominated by a desktop full of icons (that the savvy user could customize to suit his or her needs), a taskbar (at the bottom, unless you moved it, but always on the screen) and a Start menu with all your application programs on it.  From Windows 95 to Windows 7, you could get your work done the same way.  You didn’t have to learn something all new.

Now we have Windows 8.  The desktop full of icons is hidden, relegated to a sort of backroom like a second-class citizen.  In its proper place we now find a screen full of boxes, many of them animated, like a bunch of billboards screaming for our attention.  Gone is that reassuring Start button with all your programs neatly organized where you can find them.  Sure, experienced users made their own icons, on the Desktop or the top of the Start Menu or even in the Quick Launch area on the taskbar; but sometimes you need that program you rarely use, and you know it’s there, on the Start Menu, when you need it.

My daughter is an experienced computer user.  At school, most of the computers run Windows XP.  At home we run various flavors of Ubuntu Linux.  She also has experience with Windows 7 and Android.  The first time she saw Windows 8 (on a demo computer at a retail store), she couldn’t figure out how to start Microsoft Paint.

Sounds easy, right?  So it’s not on the new Start screen.  You figure out how to scroll the screen sideways, but you still can’t find it.  Then you notice one of the big rectangular buttons says Desktop, so you click it.  For a moment, you think you’re in Windows 7 again… taskbar at the bottom, icons on the screen, some pleasant wallpaper behind it all.  But… there’s no Start button.

Eventually you figure out how to get back to the Start screen (there are several ways, none of them obvious… but the Windows key on the keyboard will do it for you if you get stuck).  Now what?

Move the mouse pointer into the unmarked and unremarkable upper-right corner of the screen and float there a moment, and a bar of icons will slide out from the right side.  One of them is a magnifying glass.  Click that, and type in (yes, type in) the word “Paint.”

Finally, you can draw something.

Now imagine this from my perspective.  Much of the user interface is hidden, or obscure, like that unmarked corner of the screen (I’m told the lower-right corner also works, by the way).  If I sell that to my customers, I’ll get a lot of those unhappy phone calls.

Fortunately, I can still get Windows 7 Professional on new computers, by taking advantage of the “downgrade privilege.”  Any reseller who does business-grade computers can do that.  But just try to walk in to your local electronics superstore and get Windows 7 on a new computer.  If they can do it, it will be at a premium.

You may think, hey, I’m kind of technical, maybe I can buy that discount laptop and then install my old copy of Windows XP on it.  Hold your horses.  Ignoring the legal issues (and I’m not a lawyer so I won’t comment on them), you’re going to have a hard time with that.  Windows 8 uses and requires a new “secure boot” feature which must be built in to your computer; this feature is called UEFI.  Some new computers, including a large number of lower-priced laptops, will only boot a UEFI-enabled operating system, and Windows XP (and Vista) is not able to boot on such a computer. Even if you can turn off the UEFI feature on your new computer, you may find that drivers needed for the computer to run properly are not available for XP (since the manufacturer never intended you to downgrade the operating system).

So what am I saying?

If you’re buying a new computer, and cost is an issue, please, try out a Windows 8 computer before you buy one.  Make sure you’re ready for it, and that it will do the things you need it to do.  If you can afford a little more expense, find a reseller who can set you up with a business-grade computer with Windows 7 Professional; I’m almost certain you’ll like it better than Windows 8.

Or of course, you can do what I do.  I sell Windows-based computers, but I run Linux on my personal and business machines; I have just one computer running Windows XP on which we do our accounting.  There are still issues with finding a computer that is not so crippled by UEFI as to prevent installing Linux, but hey, you get to save the price of the operating system (since Linux is free).

The PC industry is in a decline, they tell me, with sales down from last year 14% (according to IDC as reported by the Wall Street Journal).  While many blame the rise of tablets and smartphones, I believe the real culprit is Windows 8.  Flashy TV ads don’t make up for the fact Windows 8 is harder to learn and harder to use for the average person.

Orphaned Header Bands “Mostly” Fixed

Today I added a handful of lines of code to calculate the average detail band height (so far) and use that average to reduce the number of times group header bands are “orphaned” at the bottom of a page.  I’ll admit, I’m thinking strongly that I really need to use a figure between the average and maximum, but for now I’m going with just the average.  Of course, if all detail bands in a given report are the same height, it won’t matter anyway.

I’m using PollyReports in a production system currently; in fact, that’s how I came to realize this was needed.  After a bit of live testing, I may modify the algorithm a bit more.  Right now I just want to see how much difference it makes.

PollyReports vs. Geraldo Reports — A Correction

Some time back I made a post about the development of PollyReports, and I gave code line counts based on Robin Parmar’s lines-of-code counter which ascribed a truly huge number of lines to Geraldo.  While I knew it was more complex than PollyReports, I began to feel that there had to be some mistake… it just couldn’t be THAT big.

So I took Robin’s program apart and rewrote it, keeping his (or is it her?) line counting mechanism intact but altering the traversal scheme so that only *.py files would be counted, and so that they would be listed in a fashion similar to the Unix/Linux du command.  Using the current 1.5.1 version of PollyReports, the module itself weighs in at 262 actual code lines, 388 total lines (including comments and doc strings).  Using the version of Geraldo that I have downloaded, the total count for source files (excepting the effectively empty tests folder) is 1,785 actual lines of code, 4885 total lines including comments and doc strings.  I’m pretty sure that the code I abstracted from Robin’s script is not good in all cases; the docstring detector will not detect all docstrings, and may be confused by some literal string assignments (basically if you put three double quotes on a line by themselves, you’ll confuse it).  However, these counts do seem more reasonable.

Geraldo is almost 7 times the size of PollyReports, still pretty big, but not over 340 times as I originally reported it.  I think Robin’s code may have been tallying the documentation files as well as the actual Python code.

Putting Your Foot Down

I was going down the highway on my motorcycle the other day, thinking about a project I’m doing for a customer.  We just went live with it, and one of the first things I did (after transferring data from their old program to the new one) was to disable the data reload script.  I wrote the script for my convenience; it clears the tables, then loads them again from the export files I was using to provide sample data.  Obviously this would be bad, applied to the production database.

Then I found myself thinking about how often we visit the edge of disaster.  After all, here I was, going down a two-lane road on a motorcycle at 55 MPH.  Everything was going quite well… but what would happen if I put a foot down?

Well, it would hurt, that’s what.  More than likely I’d break or tear something I might need later… it’s even conceivable that I might wreck my bike and kill myself.

So sure, I could be driving a car, and putting my foot down wouldn’t be a problem.  Doesn’t mean I couldn’t kill myself just as effectively by doing something insanely stupid but very easy to do.  Like run off the road into a light pole.

At least, on the computer, I could disable the reload script.  This wouldn’t prevent me from accidentally typing “delete from important_table” in the MySQL user interface.  MySQL does have a “safe mode” where it needs a WHERE clause before it will run such a query.  But you have to remember to invoke it with the right option.

Do I have a point?  I’m not sure.  It’s just that we skate so close to various sorts of disasters all the time, and rarely think about the consequences until it’s too late.

Like the man in the uniform used to say, be careful out there.

Offensive Programming

Way back in the good ole days when I went to college to learn programming, one of the things I was taught was to program defensively.  I was to check for error returns (remember, this was before exception handling became the rule, not the, um, exception) and try to deal with them appropriately.  When your code is full of error checking, it is, naturally, longer; it’s also harder to read, in my opinion.

But like I said, it was a long time ago.  I learned on BASIC when you had to use line numbers, and then I learned Pascal and FORTRAN and PL/1 (the first on Apple IIe hardware, the other two on an IBM mainframe running MUSIC of all things).  Meanwhile, I took a part-time job programming a Xenix system, and while the main work was in a proprietary system called Profile 16, I took the opportunity to learn K&R C.

Perhaps it was C where I learned my bad habits.  You see sample code in books bereft of error handling (since it’s much clearer to leave it out if it’s not actually needed for the example) and you start writing code like that.  At least, I did.  I mostly checked for error returns on file opening, since that’s when it seemed most likely to be needed.  But my code worked, at least, after I got the obvious bugs out.  Fortunately for me, very little of that code is still in service anywhere… maintaining it would be a bear.

I kind of fell out of programming for a while, as I started a business selling and servicing computers (yes, I’m a programmer AND a technician).  When I finally accepted some work, it was in Visual Basic (well, VBA actually), and I fell back into my old bad habits.

But it was different, this time.  VBA gave me useful error messages when my program failed, even going so far as to drop me into the debugger.  I trained my users to make appropriate notes if an error message came up, and then I went back and either fixed the code or added the appropriate error handling.  Later I had the joy (that’s not sarcasm, it really was joy) of learning Python, and again, useful error messages; in Python, it turned out to be very easy to log the errors for later review, which is wonderful.

Lately, I’ve noticed how much more productive this “bad” habit has turned out to be.  My users are all pretty happy, as far as I can tell anyway, and in two cases I’ve had nice compliments from outsiders who have experienced these programs.  Oh, they aren’t sexy or anything… just programs that do work that needs doing.

I’m calling my method offensive programming.  I charge into the code and create, well, whatever is needed, and except for the most obvious cases, I don’t bother trying to figure out what might go wrong in advance.  Instead, I deal with the problems when they arise.

More to the point, I’ve come to the conclusion that, unless you’re designing really critical things (air traffic control software, medical software, etc.), defensive programming is insane.  Your goal is to figure out what might go wrong before it ever does, and then deal with it in advance.  But programs (and the computers they run on) have more failure modes than anything else humanity has ever created.  Trying to anticipate them all is a waste of time, as far as I’m concerned, unless of course your software holds human lives in its virtual hands.

Useful git alias

I found this on Hacker News and I love it.  Since I used this blog as my project notebook, I thought I should perhaps document it here (lest I forget where I got it later).

Here’s the alias:

git config –global alias.lg “log –color –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit”