I learned something about shell scripts this weekend that until now I only thought was possible with dereferencing and pointers in language like C and Perl. In short, they let you pull the value of a named variable from another.
It’s easier to explain with an example. Say you have a series of interface shell variables, and a count:
Ideally you’d just write a shell loop to get each of these, but that just prints the variable name.
for I in $(seq 1 $IFACES); do
echo "IFACE${I}"
done
==> IFACE1
==> IFACE2
==> IFACE3
In bash you can dereference these using indirect expansion. Note the exclamation mark syntax:
CONFIG="IFACE1"
echo ${!CONFIG}
==> x.x.x.x/24
Now you can iterate over these list of shell variables in your if statement, and get what you need.
This works, but it’s bash specific, as I discovered this weekend while removing bashisms from OrionVM’s FreeBSD and NetBSD templates. The good news is you can achieve the same result using eval:
CONFIG="IFACE1"
eval echo \$$KEY
==> x.x.x.x/24
I wonder if you could do something less hacky in ksh, which both these BSDs have?
Flat UI designs did away with a lot of visual clutter, but there’s enough cognitive science and evidence now to demonstrate how and why they hamper usability. Rubenerd can get away with basic design because all I have are blog posts and links, but an interactive web application needs visual cues.
This is a good-faith look at one such example that made it on Hacker News recently on a redesigned GitHub repo page.
Summary: Flat interfaces often use weak signifiers. In an eyetracking experiment comparing different kinds of clickability clues, UIs with weak signifiers required more user effort than strong ones.
That’s the bane of flat design. You have very little idea of what, exactly, is clickable, what is slidable; clues to the interactive UI elements are stripped away. Perhaps color would give you a clue. Perhaps your being savvy in the use of digital UI would override the cognitive dissonance for favorite apps that suddenly went Flat. But if I were you show you a flat design that you’ve never seen before, side by side with a non-flat design of the same site, I’m willing to bet that you pick up on the affordances inherent in the non-flat design, and are able to adopt and use that interface more quickly, because that non-flat design doesn’t ask you to “think more.” (Remember Steve Krug’s, “Don’t Make Me Think?”). Flat design makes you have to think things through as a user.
I’m reminded of that quip mis-attributed to Albert Einstein that everything should be made as simple as possible, but not simpler.
Redesigning GitHub
So we come to this new GitHub page proposal by Nikita Tonsky that made the rounds on Hacker News. The thought process is interesting, though I felt the end result missed a bit. Here’s what GitHub looks like currently, with the old Chrome UI removed because I didn’t feel it was fair:
And the new UI proposed by Nikita:
Thoughts
The second screenshot redesign does fit current design trends, which subjectively I’m painfully against. But if I were to look at it objectively, it lacks strong signifiers, to use Nielsen’s terms.
Vague text with outlines are not as clear as buttons. The obvious example is the bright green Clone or download button in the first screenshot, which is a clear and unambiguous call-to-action. The redesign lack this entirely, which to me misses the point of GitHub as a service. That to me is indicative.
The new pseudo-tab bar also appears too cluttered with all those extra links and the resulting lack of space to delineate them. The current GitHub design has links in several places, but they clearly cluster related functions.
I’m also not a fan of highlighting tabs with just a coloured underline and subtle bold text; there’s insufficient contrast between that text and unselected tabs. And why do the headings for the Files, Commits, and Statistics sections follow that same design if they’re not tabs?
I think the removal of commit messages and times was a mistake; again, this seems to miss the point of what GitHub is. These are invaluable in gauging the activity of a repo beyond what an abstract activity graph shoes. The languages and statistics are less important, which is why they’re hidden but accessible in the current design.
And finally, there’s Nikita’s comment that he used to justify his colour choices:
But maybe it’s time to fresh it up a little? Get rid of gradients, dirty washed-out colors, unnecessary separators, add a little more air.
I agree borders aren’t always necessary, and in many cases removing them is a visual improvement. But this page is altogether too busy without some separating markers, and the sections aren’t visually consistent. The flat, rounded blue branch and version numbers visually overwhelm everything around them, and don’t have the bold text of other bubbles around the interface, such as on the tabs.
GitHub’s audience is necessarily more technical, but it still seems misguided to redesign something to be less cognitively efficient. It was a fun and thought-provoking exercise, but as a daily user of GitHub, I hope they don’t implement this.
I love discoveries like this! I thought Bosnia and Herzegovina became landlocked after Crotia split from Yugoslavia, but according to Wikipedia:
Bosnia and Herzegovina is an almost landlocked country – it has a narrow coast at the Adriatic Sea, about 20 kilometres (12 miles) long surrounding the town of Neum.
Here’s a map of Bosnia and Herzegovina from OpenStreetMap, with Croatia to the left alongside the Adriatic Sea:
But seriously, no one starts their week numbers on a Sunday, and no one considers the first full week as week 1 which is the way %U works.
I suppose he’s one of these monsters who pipes up at parties that the 21st century didn’t actually start until 2001, or that everyone should count their groceries from zero because that’s how arrays start. I’d use a linked shopping list… oh man, that was good.
But being technically correct is the best kind of correct, and he’s right. I’ve always started my week numbers on a Sunday. I’d also always assumed the first week is week one, as implied by the word first. What next, we should call them a pant rather than pants?
%V is where it’s at - ISO 8601. What are you going to blog next week - dates should be written ‘02/28/2019’?!
But that’s just an extra level of cruel. I write all my dates with YYYY-MM-DD because I like to think of myself as a standards-compliant gentleman, but tying that back to my hypocrisy about my use of week numbers was a one-two punch. I consider myself schooled.
He also pointed out:
And while I’ve got your attention, while I know you specifically love printf because it doesn’t do newlines by default, getting your email address from your about page might prove tricky to a n00b.
True! It’s another, perhaps slightly evil, extra spam filter.
The pipefail option allows checking the exit status of all commands in a pipeline more easily, at a limited cost of complexity in sh itself. It works similarly to the option in bash, ksh93 and mksh.
This is awesome, especially if you’re like me and don’t install bash. pipefail is an invaluable sanity check and troubleshooting flag for scripts.
The conventional wisdom passed down from older people who either should have known better or had rose tinted glasses, was that high school was the best years of your life. Hell no, my current life is orders of magnitude better!
But it was the eager Back to School specials that especially irked me as a kid. You’d be working on a personal project with the TV or radio on in the background and bam! A reminder than in a few days you’d be back among the backstabbers, teachers who claimed your mum wasn’t having chemo because she had hair, and cruel practical jokers. But hey, check out this sweet deal on pencils.
(I’m serious, I had a teacher at the Australian International School in Singapore claim my mum had hair, so she must not be having chemo. Who heard of wigs? Another claimed she was booking her morning chemo sessions to coincide with his PE classes. Presumably both men figured out how to put on pants in the morning, unless their hapless partners did that for them too).
There were only three good things that come from high school: most anime, a few teachers who were beyond outstanding, and some friendships you’ll treasure for the rest of your life. Other than that, it can jump into a large lake of its choosing.
I realise as I write this there may be a high schooler witnessing those words now, and are now sad at the prospect. Just know that it doesn’t last forever, and there’s a high to very high chance your life afterwards will be much better.
I like to engage in lateral thinking exercises when I need inspiration. Lateral thinking is defined by Apple’s Dictionary.app as:
Phonetics (of a consonant, especially the English clear l) pronounced with partial closure of the air passage by the tongue, which is so placed as to allow the breath to flow on one or both sides of the point of contact.
Today’s lateral thinking exercise is: name as many reasons you can for using a sponge. Here we go:
Australian cardinal George Pell, Vatican treasurer and the third most senior Catholic in the world, was found guilty of child sexual abuse last December. It took a secular court, years of time, and a suppression order lapsing yesterday to finally hear about it.
Doug DeMuro did a video back in 2016 showcasing a then-two decade old Yugo, including an interview with the owner.
The owner in question was Austin of Austin’s Garage fame, and he did a followup video discussing the fun filming with Doug, and a health issue that could have made the end result far more explosive.