Why it’s healthy that Microsoft and Google are eating Apple’s lunch

Last week Apple announced their new Macbook Pro laptops.

Their great innovation (a “game-changer” in their words) was a sliver of a touch screen above the keyboard which is able to show touchable context-specific buttons. They’ve dubbed this the TouchBar. Although the OLED technology is certainly pretty, one could almost hear the enormously disappointed collective “MEH” uttered by millions of users and suddenly erstwhile Apple fans world-wide.

Was Apple, in the form of the Phil Schiller really trying to sell this? By the way, if you represent Apple, a company traditionally known for its great design sensibilities, should you not spend just a little more money to dress a little better than the couture equivalent of an old Lada? Suit up man!

Phil Schiller not suiting up.
Phil Schiller not suiting up.

Collectively, the internet was disappointed. Why no touch screen? Why no new iMac (last refresh a year ago) or Mac Pro (last refresh 3 years ago)? What is happening at Apple?

The day before, on October 26, 2016, Microsoft revealed the Surface Studio. Watch this introduction:

… and also this video with Microsoft partners who have in secret been working with the Studio:

Even if you did not like Microsoft, you can get a good sense of the emotion around this new product.

They’ve managed to make something that speaks to the imagination. When I see this, as an outspoken Microsoft critic, I do get the distinct feeling that the Surface Studio is a physical artefact of the science fiction dream that my reality is gradually (and very pleasingly) turning into. My less nerdy technology-critical better half’s first reaction was: When can we get this?

It seems that Microsoft has convincingly out-Appled Apple.

In other words, Microsoft has somehow become sexy whilst Apple seems to have developed strong feelings for the Lada.

As an interesting related tidbit, a friend, whom I was trying to convince NOT to get Google’s new Pixel XL phone because reasons, recently sent me this short post on The Verge by Vlad Savov, a camera phone expert who until recently was of the educated opinion that the iPhone 7 was still the king of the smartphone castle. He writes:

On the basis of my extended experience with Google’s Pixel, I consider it an all-around better phone than the iPhone 7. The final exhilarating straw that broke the camel’s back was the photo below, coming straight out of the Pixel XL’s camera, undoctored other than for a horizon adjustment.

WHAT IN HEAVENS IS HAPPENING?! OUR WHOLE WORLD IS COLLAPSING!

Perhaps not…

During a Signal App conversation (you should really use Signal, it now has privacy-conscious Giphy support) with another friend, I realised that what’s happening here, is in fact wonderfully capricious human emotion interfering with the machine that is capitalism.

Left to its own devices, the nature of capitalism means that successful companies tend to evolve into capitalistically optimal dead ends. In other words, large successful companies lose the will to innovate, because they realise they are able to make more money at less risk by simply not rocking that boat. Instead of investing in innovation, they invest in sales and marketing to milk their large customer-base.

Ironically, Steve Jobs explained this idea quite eloquently during this interview where he talked about the decline of Xerox:

Fortunately, when a company like Microsoft throws an innovation curve-ball that appeals to our emotion and to our imagination, they can rock the boat for everyone.

Even although we’re talking about three absolute behemoths, it’s gratifying that they, as well as their smaller competitors, keep each other on their toes through the fickle wonder that is human behaviour.

Here’s to hoping that AI never manages to model or predict our precious caprice. :)

Weekly Head Voices #111: A swift hack.

Well hello friends! In this here,the one hundred and eleventh edition of the Weekly Head Voices, I present a personal view of selected events that took place in the time between Monday, July 25 and Sunday, August 14 of 2016.

Post summary: HackerNews FastMail to Gmail retrospective (WARNING NERD CONTENT), Craft Beer tips, Swift Playgrounds (teach your kids to code!) and a tiny bit of backyard philosophy at the end.

The HackerNews effect

When I submitted my Moving 12 years of email from GMail to Fastmail blog post to HackerNews last Monday, it was after some consideration, and with considerable trepidation. The previous time a similar post of mine was picked up by the HN frontpage (and reddit) in 2013, it resulted in a great number of fairly harsh insults flung my way (the harsh ones seem to hit much harder than the many more constructive ones can compensate for). The problem is not having your work criticised, it’s rather being ad hominem’ed into the ground.

The internet can unfortunately get quite bad that way.

However, this time the internet was in a good mood!

As a Z-list (aka hobbyist) blogger, I already get quite excited when even two people find something entertaining or educational in my blog, so you can imagine my excitement when I saw my blog stats jump into the thousands during the first hour after hitting the HN front page.

646 upvotes, 365 comments (in the HN discussion) and more than 50 thousand blog post views later (!!), my asbestos suit is still in storage, and the box of kleenex (for drying up my tears) is still unopened. I am very happy with the healthy and mostly happy discussion both on HN and here on the blog.

A taste of my secret beer notes

In my travels around the world (ok, maybe just in a few hundred kilometre radius of where I live) I taste many exotic and strange drinks (okay, maybe just the local craft beers). Here’s an excerpt from my top secret beer notes for your reading and hopefully soon tasting pleasure:

Stellies Bosch Weiss
Stellies Bosch Weiss

The Stellies Bosch Weiss is is a refreshing white beer which I can imagine enjoying much more in 35 celsius. However, I find it way too gassy for my taste and thus give it 0.4 on the Celis White scale. As everyone knows, Celis White is the best white beer in the world. I’m also not the biggest fan of CBC’s Krystal Weiss because of its gassiness. This could also be a German vs Belgian thing.

The Darling Brew Bone Crusher is probably a 0.8 on the Celis scale, and scores mega bonus points for choosing such a heavy metal name.

Citizen Beer's Patriot Lager
Citizen Beer’s Patriot Lager

Citizen Beer has a real knack for naming beers; so this weekend I was able to do my patriotic duty (ha ha) by enjoying their Patriot lager. Fortunately, they also have a great knack for making lovely beers. This lager is more than hoppy enough to remind you that it’s a craft, but at the same time it is refreshingly light.

Devil's Peak Lager
Devil’s Peak Lager

Not completely coincidentally, I also tasted the Devil’s Peak Lager this weekend. There are subtle differences between it and the Patriot which I will only be able to describe after more tasting. For now: Same lightness, but with enough hop. Highly enjoyable.

Devil's Peak Pale Ale
Devil’s Peak Pale Ale

As I’ve mentioned before, it’s no coincidence that happiness and hoppiness look so similar. The Devil’s Peak Pale Ale was a superbly hoppy (about 239% more hoppy than the lager) and full flavoured conclusion to the weekend. In spite of its full body this Cape Town beer’s alcohol content is lower than I would have expected: Only 4%.

First impressions of Swift Playgrounds

I might or might not have acquired a new iPad Air 2 with the primary motivation of being able to test the new Swift Playgrounds on Genetic Offspring Unit #1 (now 10 years old). This is a new and attractive iPad-only app that has been designed by Apple to teach kids how to program in Swift. Note that you’ll have to upgrade to iOS 10 Beta to get the app, at least until iOS 10 is officially released. One of the exercises looks like this (image taken from the website):

Screen Shot 2016-08-14 at 6.25.43 PM

Previous experiments with scratch and with processing have met with limited success but no permanence. However, GOU#1 is an iPad fanatic, and the potential of getting her addicted to the programming bug is just too fantastic to let this opportunity go by.

On the first day, she was already writing functions and for loops in Swift in order to navigate a cute alien solving puzzles on a 3D landscape.  I was looking over her shoulder now and then: The educational content and execution of the app is impressive. Besides the built-in puzzle worlds such as the 3D one pictures above, you can create your own Swift projects from scratch. These projects can use iPad hardware such as bluetooth and the camera, but we’re not quite there yet. Apple has also promised to keep on expanding the educational content.

I’m really crossing my fingers that GOU#1 will keep at it. If Swift Playgrounds helps to get her programming, I might just have to go full fanboy.

∞♥

This past Friday at the breakfast table, Genetic Offspring Unit #2 asked her mom how much she thought GOU#2 loved the baby GOU#3, upon which the mom asked “How much do you love GOU#3?”.

GOU#2 answered: Infinitely much!

My fragile parental unit heart almost exploded with happiness at this point. It’s what I tell GOU#1 and #2 when I put them to bed, and every morning when I drop them at school. (GOU#3 herself does not yet parse our language.)

Ok kids, it looks like there’s an infinite amount of the good stuff to go around. You know what to do!

bettys_bay_somewhere
I went jogging (or rather walking with a two-step now and then). Enjoyment of surroundings and physical activity was quite intense at this point in spacetime: 15:55 on August 7, 2016; GPS coordinates in EXIF data.

Closure expressions in Swift

Swift is a new high-performance compiled language designed by Apple. I’ve had some experience using it for an IOS development project, but the language is open source and is already available for Linux.

Some of you are probably able to appreciate the irony of me writing a blog post about Apple’s new programming language Swift, but here we are. :) I am, grudgingly, really impressed by Apple’s good work.

In this post I’m going to chat about closure expression syntax, in the process showing you IBM’s Swift Sandbox, an online tool for experimenting with Swift.

Let’s start with a simple example (slightly modified from Apple’s documentation on Swift closures) for sorting a list of strings in reverse alphabetical order:

// names will be constaint, so we use let and not var
let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]

// function taking two parameters and returning boolean
func backwards(s1: String, _ s2: String) -> Bool {
    return s1 > s2
}

let reversed = names.sort(backwards)

print("Reversed alpha:", reversed)

That’s a complete compilable program in Swift, which you can run directly in your browser by clicking here.

We use let to define a list of strings. Swift is strongly-typed, but in this case it simply infers the type of the names variable from the value that’s assigned to it. MAGIC!

If we were planning to change the value of the names list at some point, we would have had to use var (mutable) instead of let (immutable).

We then define a function called backwards that takes two strings, and returns the true value if the first is larger than the second. In the final let statement, we call the sort() method on the names list, but we pass it the backwards() function, which it will use to compare elements during sorting. Because we have flipped the s1 and s2 variables, we get our list back in reverse alphabetical order.

sort() can be seen as a higher order function that takes the backwards() function as one of its inputs, and uses it to do its work.

Since we’re only using the backwards() function once, it would have been pretty convenient if there were some way to define it more compactly and in-place.

This is exactly what Swift’s closure expression syntax is for. Here’s the above code, with the backwards() function written as a closure expression:

let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]

// closure expression syntax for inline anonymous function:
// { (args) -> returnType in statements }
var reversed = names.sort({ (s1: String, s2: String) -> Bool in return s1 > s2})

print("Reversed:", reversed)

(You can run this Swift code in your browser by clicking here.)

Instead of having to define and name a separate function, we can specify a function in the exact spot where it’s needed, using closure expression syntax i.e.: { (parameters) -> returnType in statements }.

For you Python-heads out there (MY PEOPLE!), the above code can be written in Python as follows:

names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]

reversed = sorted(
    names,
    cmp=lambda s1, s2: 0 if s1 == s2 else (-1 if s1 > s2 else 1))

print(reversed)

In Python, lambda is used to specify anonymous function objects (our closure expression syntax, in other words). The compare function is defined differently, which is why it’s somewhat more complicated, but the principle is the same.

Whilst typing this blog, I downloaded Swift 2.2 from the open source download site and installed it on my Ubuntu 14.04 laptop (the internet is so slow over here, we have to multi-task to stay sane). After compiling both the examples using swiftc whatever.swift, the resulting binaries are about 21 Kbytes each (they are dynamically linked to a number of system libraries, and the 5M libswiftCore.so).

swift-sort-binaries.png

The Swift language is open source, is already available for Linux, has a number of really compelling modern language features of which closure expressions are just one example (other interesting examples include optional types and protocol extensions), is statically typed with good type inference, and has a good compiler. For these reasons, it should be strongly considered for a permanent spot in your compiled language toolbox!

P.S. Yes, I do know that C++ has lambda and auto. I like them too!

Weekly Head Voices #100: Happy 2016!

Cape Town from Table Mountain, photo is copyright 2015 Charl Botha.
Cape Town photographed from the top of Table Mountain. Click for high-res.

I wish you a truly happy 2016, filled with learning and helping other people! Neil deGrasse Tyson, exemplary human, said it best:

For me, I am driven by two main philosophies, know more today about the world than I knew yesterday. And along the way, lessen the suffering of others. You’d be surprised how far that gets you.

Time is fun when you’re having flies! I can’t believe that four months have flown by since the previous WHV. Since then, quite a bunch has happened. Some highlights for me:

  • I spent a week in The Netherlands, my other home, taking part in a second hackathon with the Evalueserve peeps (the previous one was in Gurgaon in India). This was again loads of fun, and we managed to build a significant new shippable feature (measurable value!) almost from scratch.
  • In October, I went back to The Netherlands (it’s my other home, remember) for 2.5 days to take part in the Doctorification of a friend. Besides the doctorification process (I’ve been out of academia for a while, so my terminology might not be 100%) which went swimmingly, I had so many high-intensity interactions with some of my favourite people that I literally almost missed my flight back. Just picture me waking up in Delft at 8:30 with a flight leaving from Amsterdam at 10:00…
  • For a work project,  I started programming in Apple’s Swift. As compiled high-performance languages go, this one has a number of modern language features which make it a truly interesting addition to one’s programming toolbox.
  • Further on the nerd-front, I’m trying to get more of us to use Signal instead of WhatsApp whenever possible.
  • We spent so many weekends and the Christmas vacation doing fun outdoorsy stuff (living at the southern tip of Africa has serious perks), not least of which was a trip up Table Mountain for the first time in 15 years. See the photo up top for an impression.

I have some fun changes in mind for this blog in 2016, but you’re going to have to stick around to find out what they are, so… see you later peeps!

Weekly Head Voices #91: They’re back.

So after exactly no-one asked me when the Weekly Head Voices would be back, or why they stopped, I decided to reverse my almost-decision of quitting. This hiatus made me realise that the WHV are one of the few tenuous connecting lines between me and a tiny group of readers, people I am quite fond of, dotted around the world.

Sunset at AfrikaBurn 2015.

Again inspired by the information-and-entertainment-dense way that Swimgeek manages to do it, I’m going to try this in bullet form.

  • We, that’s me with friends DWR, PK, TvD, CvdB, MJ and a Very Flat Cat, spent the whole week (Monday April 25 to Sunday May 1) at AfrikaBurn 2015. We built (the desert truly is rock hard – try ramming a metre of rebar down into it, then repeat) and ran Pompen en Pimpen, bicycle repair and pimping theme camp extraordinaire, on the corner of 9ish and Binnekring. The experience unfortunately is exactly one of those things that is more or less impossible to explain in words. I’ll try a few keywords nonetheless: Hard labour at the Best Party Ever; music never stops (sleep never really comes); engineered herd humanity; so many people, so much space; gifting really is great. We’re going to have to go again.
  • Damnit. I’m not very good at bullets.
  • As if fate were a thing that could taunt me, a super interesting project at work has resulted in me:
    • Buying an early 2015 13″ Retina MacBook Pro. It’s super portable and the battery lasts more than 6 hours, but I still like working on my klunky Linux-running Acer laptop more.
    • Learning Objective C and X Code (AppCode is miles better).
    • Working on an experimental iOS app.
    • Learning to program Apple Metal on iOS and on the OSX desktop (way before most other people).
  • In another project I got my hands dirty with three.js. What a lovely library for doing WebGL! We’ll soon be shipping a product feature based on this.
  • Shortly afer having resigned myself to never ever finding a new house that we all liked, we found a house we all liked! If all goes according to plan, and the various mafia bosses we’re borrowing money from cooperate, we will soon be moving in to a place of our own. I guess this means we are sort of settling down again.

Have a beautiful week tiny group of readers!