Archives For Uncategorized

golangIn spite of my advanced years (I turn 63 in December) I do try to stay reasonably current while at the same time encouraging and supporting the younger generation. There are times, however, where I have to call bullshit on what is written by the youngsters.

I recently came across a BS article via the Hacker News app on my fabulous iPhone 6S+ titled “Golang landmines.” Hacker News is the Slashdot for the ADHD segment of today’s contemporary young white male twenty-something code slingers. HN is essentially a lot of links “curated” and presented in a very simplistic list on your device. I put the word “curated” in quotes because this article, like so many others I’ve encountered via HN, has weird error messages in the body of the article; when you see that, you know you have to follow the link to the original at the top of the article. Thus it was with this article.

As befits its contemporary hipness, this article is hosted on Github. It’s part of a Github conversation which I find rather amusing. I guess anywhere that will host content is a decent platform for publishing and the direct consumption of said publishing, even Github. Whatever… The “author” writes about three “easy to make mistakes” in Go. The problem is that those mistakes can be avoided by the Go tools if you’re half aware and actually pay attention to the warnings and error messages the Go compiler/interpreter emit with your code. For example, consider the following Go example.

package main

import "fmt"

func DoSomething(doit bool) (result string) {
    if doit {
        result := "doit is true"

    return result

func main() {
    fmt.Printf(DoSomething(true) + "\n")

This code snippet is a refinement of the “shadowing considered harmful to your sanity” example at the bottom of the article. The issue is the use of “:=” in line 7 instead of the regular assignment operator “=”. If you read the on-line documentation for Go (Short variable declarations) you’ll discover that “:=” is “shorthand for a regular variable declaration with initializer expressions but no types.” Further reading shows that:

Unlike regular variable declarations, a short variable declaration may redeclare variables provided they were originally declared earlier in the same block (or the parameter lists if the block is the function body) with the same type, and at least one of the non-blank variables is new. As a consequence, redeclaration can only appear in a multi-variable short declaration. Redeclaration does not introduce a new variable; it just assigns a new value to the original.

It isn’t like you haven’t been warned. With that in mind I don’t understand how that so-called code example worked in the first place. If you take my example above and save it in a file named “shadow.go” and either run it directly (go run …) or build it (go build …) you get the following error message:

./shadow.go:7: result declared and not used

at which point everything stops. Granted, it’s not the most helpful error message in the world, and the example from Github surely isn’t helpful in illustrating what’s wrong and where, but Go does attempt to keep you from doing The Wrong Thing, if obscurely. So my question stills stands; how did that code example in the Github article build or run to start with?

And my comment to the Go compiler team is; why in heaven’s name can’t you people come up with clearer error messages that reference the specific language violation you’re complaining about? A clear error message with a reference to the specification would be so much more helpful, especially to those starting to learn the language. I mean, Go is a fairly new language written by Google engineers who should know better.

That’s why the coding youngsters don’t want us old farts around. We point out their errors and in the process cause crippling embarrassment to the little snowflakes.


I’ve been rather rudely asked what I would consider an “appropriate” Go error message. Here’s what my version of Go would emit with such an error:

./shadow.go:7: Use of short variable declaration hides 'result' first declared on line 5.

The error message is now more succinct as to where as well as why, tying directly back to the language specification. This helps aspiring Go programmers learn.


June 16, 2016

President Obama made a visit to Orlando today to eulogize both the victims of the Pulse massacre. During his visit he also visited some of the shooting victim’s families. I listened to part of the speech while driving home west on the 408.


  1. violently break (something) into pieces.
  2. move so as to hit or collide with something with great force and impact.

Our community has been smash into a lot of pieces. The world has been homing into Orlando, like sharks attracted to bloody flesh in the ocean. Today I had lunch at a local restaurant that has “smash” as part of its name. It just seemed appropriate.

lunch 10 june

June 10, 2016

Even shorter lunch than yesterday, probably the shortest all week. Ate at a local pie five pizza parlor on University. Before it was pie five pizza, it was a Greens and Grill. The area’s changed considerably; when it was a Greens and Grill there was a vast grassy field in back. Now there’s a big multi-story hotel out back. The layout of the store hasn’t changed; there’s an outdoor eating section off to the side where I snapped this with my iPhone. Post processed in Snapseed.

No photographer is as good as the simplest camera.
Edward Steichen

Best photography saying I ever read.

There is something quite frighteningly odd (or oddly frightening?) when the best example of why we should limit Patriot Act surveillance comes from a comedian, not some “trusted” main-line journalist. Right now three of the most controversial parts of the Patriot Act have expired (see “The Patriot Act Is Changing. Here’s What That Means for Your Privacy“). With the crazy election season that has Donald Trump as the Republican presidential candidate, it’s even more frightening that the framework to do all of this will still be in place. I can’t even begin to imagine how Donald Trump would use such a system to punish all those he deems his enemies, and that’s what’s truly frightening about what I call the Patriot Act System: it might be off for now, but it’s all in place, and extremely simple to use it again, even for someone as stupid as Donald Trump. We’ve already seen what can happen when a sitting President abuses his powers against his perceived enemies with Richard Nixon. Donald Trump at the controls of the surveillance state would make Richard Nixon look like a Sunday-school choir boy.

daytona pig stand

May 29, 2016

We’re having lunch with my oldest daughter and her boyfriend (soon-to-be-husband next year) at the Daytona Pig Stand off I-95 near Ormand. It’s not every BBQ place that has a converted eighteen wheeler tanker truck used for catering. But hey, whatever helps. Besides we’re eating in the main building where it’s air conditioned.

Yes, rusting metal chickens stand guard out front. The food has arrived, time to eat…