Software Dev

Clarity is (even) more important than brevity

I have published a post or two about the powers of brevity. But we programmers sometimes take it too far.

Can someone tell me what these integers represent?

case upc(Int, Int, Int, Int)

No? Me either.

This is how associated values are pretty much always done in Swift. But thanks to this post by Marco Eidinger via iOS Dev Weekly, I discovered something new and clarifying: it turns out that you can actually label your enum’s associated values too. People just don’t do it for some reason. πŸ€·πŸ»β€β™‚οΈ

Can you tell me what the integers represent now?

case upc(numberSystem: Int, manufacturer: Int, product: Int, check: Int)

Isn’t that a little easier to understand?

I run into the assumption sometimes where people mistake brevity for efficiency. Brevity shouldn’t mean sacrificing valuable context for slightly fewer words. Thanks to the Marco Eidinger post for pointing this out explicitly. πŸ‘

Clarity is more important than brevity.

Marco Eidinger
Quotes

“Every noble work is at first impossible.”

Pretty much any interesting/useful/beautiful human achievement you can think of was at first impossible. Mass-printing books? You’re crazy. Sailing ships across the oceans? No way. Putting a man on the surface of the freaking moon? That one still gets me.

While John F. Kennedy gets my award for the best speech about doing the impossible (and within the decade no less!), the Scotsman Thomas Carlyle had summed this idea up nicely a hundred years before.

Every noble work is at first impossible.

Thomas Carlyle

This quote is so clear and to-the-point: it is perfect from a writing perspective.

But can you picture JFK getting up on stage at Rice University in 1962, saying, “Every noble work is at first impossible… let’s go to the moon.” and then just leaving? πŸ˜† I guess politics requires a little more bombast.

Thomas Carlyle, looking a lot like The Most Interesting Man in the World.