Bruce Garrett Cartoon
The Cartoon Gallery

A Coming Out Story
A Coming Out Story

My Photo Galleries
New and Improved!

Past Web Logs
The Story So Far archives

My Amazon.Com Wish List

My Myspace Profile

Bruce Garrett's Profile
Bruce Garrett's Facebook profile


Blogs I Read!
Alicublog

Wayne Besen

Beyond Ex-Gay
(A Survivor's Community)

Box Turtle Bulletin

Chrome Tuna

Daily Kos

Mike Daisy's Blog

The Disney Blog

Envisioning The American Dream

Eschaton

Ex-Gay Watch

Hullabaloo

Joe. My. God

Peterson Toscano

Progress City USA

Slacktivist

SLOG

Fear the wrath of Sparky!

Wil Wheaton



Gone But Not Forgotten

Howard Cruse Central

The Rittenhouse Review

Steve Gilliard's News Blog

Steve Gilliard's Blogspot Site



Great Cartoon Sites!

Tripping Over You
Tripping Over You

XKCD

Commando Cody Monthly

Scandinavia And The World

Dope Rider

The World Of Kirk Anderson

Ann Telnaes' Cartoon Site

Bors Blog

John K

Penny Arcade




Other News & Commentary

Lead Stories

Amtrak In The Heartland

Corridor Capital

Railway Age

Maryland Weather Blog

Foot's Forecast

All Facts & Opinions

Baltimore Crime

Cursor

HinesSight

Page One Q
(GLBT News)


Michelangelo Signorile

The Smirking Chimp

Talking Points Memo

Truth Wins Out

The Raw Story

Slashdot




International News & Views

BBC

NIS News Bulletin (Dutch)

Mexico Daily

The Local (Sweden)




News & Views from Germany

Spiegel Online

The Local

Deutsche Welle

Young Germany




Fun Stuff

It's not news. It's FARK

Plan 59

Pleasant Family Shopping

Discount Stores of the 60s

Retrospace

Photos of the Forgotten

Boom-Pop!

Comics With Problems

HMK Mystery Streams




Mercedes Love!

Mercedes-Benz USA

Mercedes-Benz TV

Mercedes-Benz Owners Club of America

MBCA - Greater Washington Section

BenzInsider

Mercedes-Benz Blog

BenzWorld Forum

August 17th, 2016

Oh Microsoft…How I Love Your Pretty Little Lies…

Mostly, I do business software. That may seem surprising since I work for the Space Telescope Science Institute and we not only operate Hubble for NASA but we’re also working on the James Webb Space Telescope, which is the project I’m deeply involved in at the moment. So you might think the work I do here is all sciencey and stuff and it mostly is, but not in the flight engineering sense of it. I do business software, and science like everything else has to account for its money  and  time. So  as it turns out, a lot of my work still revolves around Microsoft products, and doing traditional business client-database applications.  The other day I was tweaking something I’d done in Excel VBA (Visual Basic for Applications…a product Microsoft hasn’t upgraded in decades, probably because there is so much legacy stuff out there in their business user base). It was your basic fetch some data from a backend database server and feed it to Excel and let Excel make tables and charts out of it for management to ponder. And I  needed to do something that I figured I could use a custom document property for. Which I could, but not exactly in the way Microsoft’s documentation said I could.

You run into this phenomena quickly in this trade:  The Documentation Lies. Or more charitably, it is out of date. The documentation is buggy. The documentation is written by people who write software and hate writing documentation. If religious fundamentalists had to actually use passages in the bible like we software developers have to use the documentation and example code snippets we’re provided with maybe they’d stop waving that thing at everyone, and try a little figuring things out for themselves like we’re always doing…desperately at times. Oh you’re worried about the second coming are  you? Let me show  you my  project’s  Gantt chart…

See…I hate using Magic Numbers…

In programming, a “magic number” is a value that should be given a symbolic name, but was instead slipped into the code as a literal, usually in more than one place.

It makes the code hard to understand, which makes it hard to maintain. This is something a programmer is wise to avoid, even if it’s code you are nearly certain only  you will be maintaining. Time passes, the universe expands, and you open a code file you haven’t touched in years to make a small change and you’ve forgotten what ThisWorkSheet.CustomProperties.Item(1).Value referred to.  Better to write it  ThisWorkSheet.CustomProperties.Item(“GetsGraph”).Value. And lo and behold the documentation says I can call that property with either a  numeric  value (the property index) or a string value (the property name). But it does not actually work that way.

Let it be said Microsoft is hardly the only culprit here. My first experience with this sort of thing happened right at the starting gate of my career as a software developer  many many moons ago, when I was a youngster doing volunteer work for a gay BBS system (before the Internet Tubes came along) and I was asked to write a system for a local gay activists organization to generate welcome letters and membership funding letters and mailouts and so forth. They had a licensed copy of Ashton-Tate’s dBase IV which back then was the powerhouse database system for PCs. It was working my way through  the dBase documentation while trying out their code snippets I  had the displeasure of finding out that computer documentation will lie  though its teeth at you and laugh at your pain and suffering. In those days I hurled many a programming book across the room. Nowadays I glance at the time and do a quick rough calculation of how many minutes until Happy Hour.  

So I got through my little difficulty the other day by creating a sensibly named numeric constant that I can pass in lieu of actually passing the value of the name of the custom property whose value I want to check. That’s what we call in the business a kludge, because I’m not certain  the property I want will have that index value Every Time. I think it’s likely since I’m the only one maintaining this code, for now, and I only have that one custom property in there. But what happens when someone else gets into this code? Okay…I’ve commented my useage of the property. But maybe the next update to Excel changes the starting index from 1 to 0? Surprise!  

Oh well. So I get things working to a close approximation of my satisfaction. Then I sit back and I ponder the Five Stages of Software Development…

Denial: Oh I probably just forgot to close a parenthesis somewhere.

Anger: Oh F*ck Me…that is a COMPLETELY LEGAL FUNCTION CALL!!!

Bargaining: Maybe if I use single quotes instead of double quotes…

Depression: I should have gone to art school…

Acceptance: My software tools are buggy, the vendor is shady, the next upgrade cycle will probably depreciate my entire code base, but the bar at Rocket To Venus is open late.

 

Leave a Reply

Visit The Woodward Class of '72 Reunion Website For Fun And Memories, WoodwardClassOf72.com


What I'm Currently Reading...




What I'm Currently Watching...




What I'm Currently Listening To...




Comic Book I've Read Recently...



web
stats

This page and all original content copyright © 2024 by Bruce Garrett. All rights reserved. Send questions, comments and hysterical outbursts to: bruce@brucegarrett.com

This blog is powered by WordPress and is hosted at Winters Web Works, who also did some custom design work (Thanks!). Some embedded content was created with the help of The Gimp. I proof with Google Chrome on either Windows, Linux or MacOS depending on which machine I happen to be running at the time.