Category Archives: Uncategorized

Maven Irritation

I’m looking at Maven related stuff for the first time in … perhaps 4 years. This is long enough that I’ve forgotten how irritating it is. My task is simple: redirect the writes from the project’s directory to another location on local disk. This is because the project is located on a filesystem where writes […]

Return errors or useful values, not both

One of the nice features of Go is returning multiple values natively. e.g. type Foo struct{…} func New() (*Foo, error) { if err := initSomething(); err != nil { return nil, err } return &Foo{…}, nil } What’s interesting is that either the error is nil (and you have a useful value) or the useful […]

Go interfaces are for consumption

After a recent discussion, I’ve realised something about Go’s interfaces. They’re best if you use them as a consumer rather than producer. Using my own code as an example. I have a storage layer that uses bigtable. package storage type IO interface { Read() (string, error) Write(string) error } type bigtable struct {…} fun New() […]

Script or program

My new definition for “is it a script”: does it have tests? If so, it’s a proper program. If not, it’s unmaintainable junk.

Logging in Go

Dave Cheney has an excellent post, Let’s talk about logging. In it, he dissects the current logging libraries, and what you really need. I pretty much agree with everything he says. Warnings are just more info messages. Log or handle the error — not both. Where I disagree is with the error logging. It is […]

Go Readability

If you haven’t seen them, do take a look at these slides on Go readability, from one of Google’s Go readability group. Readability is an important process at Google. In theory, it’s about ensuring the style guide for a language is applied. In practice, it’s also about ensuring that idiomatic code is produced. This is […]

Rescuing Data with F-Script

I have an old iMac. It’s not in a good state. I don’t care that much, it’s old slow, and not a lot of use. The only remaining thing of value is the large collection of photos I have on there. I have an external drive, so it’s easy to copy them over. All the […]

Happy Fifth Anniversary, Go

So, Go is five years old. Looking back through version control, my first bit of Go was in May 2012. I’ve been using it as my preferred language for the last year or so. It still feels very pleasant and easy to work with. In no small part that’s due to the excellent tooling. The […]

Go Strings

I’ve been looking at Go recently. It’s a pleasant language, with few surprises. However, I wondered (as always) what the encoding of a string is supposed to be. For example: Python 2 has two types: str, and unicode. Python 3 has sensibly renamed these to bytes and str, respectively. Perl has a magic bit which […]

jslint4java 2.0.2

After another long period of having nothing to say, I’ve pushed out an update to jslint4java. Version 2.0.2 doesn’t include any major new features, but does update JSLint to the latest version (2012-02-03) and fix a couple of small bugs here and there. issue 75: Handle BOMs when using the CLI. issue 74: Document the […]