Who is set to benefit from the introduction of Swift programming language

One of my first reactions to Swift was the following:

In this post I elaborate a little more on the reasons that I held this belief, that everybody wins.

  • Apple, obviously: legions of developers who might have been put off by Objective-C will now give a second look and many are likely to write code for Apple platforms.
  • Groovy, Scala, Objective Caml programmer: programmers experienced with these languages can now leverage their skills to build solutions for the Apple platform without having to learn another language. Their main hurdle would be  to get acquainted with iOS and OSX platform concepts and building blocks.
  • Scala ecosystem: the introduction of Swift might have the side effect of actually making some people understand Scala better and quicker, this because  it shares many concepts with Scala but has a more readable syntax
  • A converse effect of the above bullet point: Apple developers who make the jump to Swift, would also realise the many benefits of functional programming and adopt languages like Groovy, Scala or Erlang.

Folks looking for new opportunities should find plenty. From a business opportunity perspective, here are some potentially profitable developments:

  • Groovy backend for Clang and LLVM: this could make it possible to write native iOS and OSX code in Groovy. People used to writing web only code would suddenly be able to port their solutions to the Apple platform.
  • Cross Training Developers: this could be the best time for Groovy or Scala training organisations to tap into the masses of iOS and OSX developers scrambling to learn functional programming. Why leave that money on the table?
  • Apple and Pivotal work together: this is a bit tangential, but if Apple were interested in expanding their Cloud clout, this is a good way to do that because they suddenly would be able to target the data centre too! Just buy Pivotal and leapfrog both Microsoft and Google in one fell swoop!

I don’t see yet how Swift could benefit either Microsoft or Google ecosystems. If anything, this could be a blow to those ecosystems as Apple is suddenly more attractive to a rising generation of developers converting to functional programming.

Swift, a general purpose programming language for a specific platform

Apple announced a new programming language. The inevitable reactions poured in, Apple lovers mostly rejoiced, Apple haters pounded on. Some complained the fact that it was not open source. Here are some thoughts from an observing angle.

A new programming language that launches in 2014 would aim to attract the masses and actually solve problems. If not then nobody would pay attention, regardless of their affinities. There’s been a lot of learning compounded in the software engineering discipline over the years, it would be foolish to sidestep all that and try to bring up something new. These learnings can be found in the existing languages, C#, OCaml, Erlang, Groovy, Scala, Rust, Go, Lua, and many others I might not even be familiar with. So in this context, if you were in any vendor’s shoes, you would need to embrace what’s available and bring it closer to your environment. That’s what Apple has done. 

Concurrency and parallelism

It is surprising that Swift does not seem to address concurrency and parallelism the way Erlang for example does, at least not in a visible way so far. It seems they didn’t want to ‘copy’ much from Erlang in fact. One could speculate what Apple’s rationales might be. My immediate thought, when I saw that omission, was that perhaps that would have pushed the enveloppe too far for the current generation of Apple developers. If that were included, a-la-Erlang for example, quite likely the first batch of applications delivered with Swift could be utter disasters and permanently cripple the uptake of the language. Apple would have to first create a solid infrastructure for such parallelism and concurrency constructs. That is the most important reason I can think of for leaving out such paradigms.

Another rationale to consider is the fact that unpredictability doesn’t marry well with user interface behaviour. Parallelism and concurrency are first and foremost systems concerns, more at home with a systems programming language. Apple is heavily focused on the user experience, and much less on system experience (TM). This makes me believe that Apple intentionally decided that Swift would not be a systems programming language. At least not now.

Vindication

Swift appears to be, at least from one vendor’s perspective, a vindication that verbose programming languages don’t make developers productive in this day and age. Also, letting people make simple silly preventable mistakes is not a profitable business. Every time you looked at Objective-C source code, after any amount of time with Clojure, Groovy, Lua, Erlang or OCaml, to name a few, you were left wondering why such status quo persisted. Apple gave their answer today. But they waited a long time for that. Microsoft with C# and particularly F# have long been delivering the goods in that department. Google with GO have been forging ahead and registering tremendous success. Marrying the best aspects of functional programming with sequential and object-oriented programming, deliver the most benefits to users at the moment. With Microsoft, Google, Apple, Mozilla on board, it would be hard to argue that functional programming has become mainstream. The early adopters should rightly feel vindicated, somehow.

Update: A pointer to the reference web site was missing, for those who might not be Apple developers. There is no point in including ‘hello world’ or other trivial sample code here. Swift web site is:  https://developer.apple.com/swift/.

Martin Odersky on the Simple Parts of Scala

In these slides, Martin sums up perfectly the challenges facing Scala adoption in the wider community: ‘extremists’ at each end of the OO-FP divide can be prompt to come out with their ‘pitch fork’s.
I’ve always perceived Martin as a software anthropologist who’d examine long and hard where learning opportunities might be, then come up with applications where most people would get the most benefits. This is just like Anders Hejlsbeg, or Rick Hickey. What you see is that these people bring tremendous value to the software development practice, there’s much to learn in closely listening to what they have to say.

Another way I found useful to look at Scala’s embrace of both OO and FP goes like this:

  • OO provides the structural facilities, the scaffolding amenities, the brick layering capability if you wish. This is how you eventually render your product. You want to be able to tear these apart as you wish, throw parts away as you see fit. A building must obey some basic laws of physics, hygiene and citizenry to be acceptable for any housing purposes.
  • FP provides the means for generalising behaviours that one wish to share and repeatedly reuse. You want predictability, stability and control here. This would be like being able to re-arrange your whole house such that bedroom, the kitchen, the living area, the computer corner or the dining area could be all be shuffled around in an unlimited configuration without having to rebuild the whole house – this is unrealistic in real-life, but we’re talking about software here.

By combining the two aspects, you get more ‘bangs for the bucks’ as they say. With my simplistic analogies, FP would be the content of your house, and OO would be the building frame. If you do it well, you can take your house content anywhere with you, but you usually discard the building frame or leave it behind.

There is no useful reason to be dogmatic about OO vs. FP. If someone doesn’t see the benefits of either then they should just pick what works for them, or avoid Scala. Coming from Java development background, or facing with a future with Java, Scala is a great platform to build sustainable solutions on.

Martin’s Slides – warning, Slideshare might require Flash – not my wish though ;-( :

Macaw is just what I wanted

I get inspired when I can visually tinker with experience design. This is the reason that Macaw.co got my attenion and I adopted it almost immediately.

Macaw user interfaceblank canvas in Macaw

I hailed Twitter Bootstrap when it was launched. It helped me and many others  with UI prototype work. Some seemed to prefer deploying Bootstrap default experience with little change. I don’t like that much. I would often customise the look & feel to make it a bit proprietary. Over time I came to realise that I didn’t particularly enjoy tweaking and tuning the myriad features exposed through the LESS assets. There is nothing wrong or limited with Bootstrap per se. Web browser development tools are also a good help for quickly trying out UI ideas. There are many online sites such as codepen that help you experiment with snippets and small features. These are all fine but, I just wasn’t getting inspired by any of it. What these tools lacked – that would get me excited – was the ability to just draw my idea of an entire page as I envision it, tinker only with the drawing, and then immediately get the code behind without resorting to any extra artifices. There is an emerging bunch of tools that allow you do that in a cost effective manner.

I discovered that my way of tinkering with web design worked better if I could do it visually. As I examine visual elements I get more ideas and I can iterate quicker. Going back and forth to the LESS source files and tuning design was too slow to entice me. I am not a designer by education so I make lots and lots of tweaking before I like something. As a kid I used to love drawing things. I would typically start by drawing a line or some randomly curved shape, then as I added to that some kind of shape would start to emerge and I would finalise my drawing that way. If I ended up drawing a horse or a house that was usually not even in my mind when I started. That was my way of playing with pen and pencil. It seems that is also how I can enjoy doing UI work.

For a long time I relied on Omnigraffle, not really a web design tool, and Pixelmator, also not a real UI web design tool. I’ve used Adobe FireWorks on and off for years. FireWorks is a nice tool but it never got me excited much. It seemed that I couldn’t find any product out there that I would want to stick to. That changed recently.

There’s a new product that allows you to visually design what you want, then get a baseline html and css code that embodies that. It’s called Macaw. I saw a brief video announcing its features and immediately decided to buy a license when it shipped. I got a copy at the beginning of this month, started using it, and it felt right away that this was how I always wanted to work with web design.

Aside from the immediate feedback, one benefit I particularly appreciate with Macaw is that the authoring assistants are intuitive and help you just the right way. As a non-negligeable bonus it generates a minimal base code that can be directly fed into an application design. Here are two radically different design I made with it.

macaw - design prototyping examplemacaw – design prototyping example
Web UI Prototyping with MacawWeb UI Prototyping with Macaw

I create these artefacts just like I would in Omnigraffle, however the whole experience of manipulating the elements fits perfectly with the job: desiging a web front-end. Once done, the code that Macaw generates is clean and minimal, it does link to jQuery though. So, I could just take the code I get from this and embed it in the application code. This approach is more to the point, and more efficient than say using a free html template downloaded from the web.

macaw generated cssmacaw generated css
macaw generated source filesmacaw generated source files

Before Macaw I tried several products of which many are online solutions. I won’t list them since this isn’t really a posting on product comparison. While lots of nice experiences are available I was often disappointed with the code that got generated. The problem I expect to solve with these tools is to get started with a clean slate and be able to repurpose code with minimal effort. This means that I didn’t want any dependencies in the code and that seemed almost impossible to achieve. For this reason I couldn’t settle for anything in particular and kept on to a traditional model where the UI design assets were fairly remote from the code produced to implement it. I don’t need to do that anymore, I can rely on Macaw to visually tinker with prototype designs.

Of course when it comes to serious web crafting like making animations or complex interactions Macaw wouldn’t fit the bill. Webflow for example seems to be another nice one, particularly suited to animation rich UIs. The produced code embeds relatively proprietary JavaScript code. And the business model seemed to be favourable to repeat uses or even hosted solutions. For my particular needs I saw these as compromises I didn’t really want. And honestly I would just hire a professional designer if the experience is complex or that it needs to be very sophisticated. I am an IS&T architect who believe in all-round craftsmanship. I want to deliver the whole solution. If it needs to look spiffy and flashy then I call out to professional designers.

Having used the product for a little while now, I am convinced that Macaw is the tool that I was missing so far. I can now deliver complete end-to-end experiences to clients with the tools that I am comfortable with.

Django CMS is the simplest and most elegant Web CMS I’ve seen lately

Recently I have evaluated a lot of web content management solutions, all of them open source, almost exclusively on Unix like systems, I haven’t seen anything as simple and elegant as Django CMS. I took it for a spin, it’s polished, really designed to solve fast turn-around web publishing needs. It does that brilliantly, no question about that. I particularly like the way they make all the authoring tools and widgets disappear when not in use, so that you are always looking at your content exactly as it will appear when  published.

There is one thing, in a lot of cases, to truly appreciate any piece of work, one must have a practical understanding of the challenges involved in making it. This is also true for software. Content management, web content management isn’t a sexy topic. However, without such systems it would be tedious to maintain an online  presence, difficult to consume a lot of the content produced daily by legions of people.

I was just going to use one of the web CMS products I’ve known for a long time, to power one of my web sites. In the process, I realised that I have not done any proper re-evaluation of the products available for a while. I wanted to try that first before settling on something. I thought perhaps I should go open minded about it, include a broad selection of products. As time is precious, I decided to focus on Unix/Linux based solutions for now, because that is also my target deployment platform.

For my purpose I went back to implementing a few other web CMS products, namely: Zotonic (Erlang based), Liferay Portal (JCR), Magnolia (JCR), dotCMS (JCR), several static publishing systems such as Pelican (Python), Jekyll and Octopress (Ruby), and of course WordPress (PHP, which powers this blog). Django CMS best all these in terms of simplicity and its focus on making semantic HTML content authoring a bliss. To be fair, it’s hard to compare these products I just mentioned since each actually aim to cover a breadth of needs that might be going well beyond web CMS (portal for example). But I had narrowed my scope down to the authoring and publishing processes only, web CMS functionality alone, that makes it possible to come up with a fairly reasonable comparison.

I am not yet done evaluating web content management systems, I still have on my to-do list Prismic.io (an innovative Content Repository As A Service) and a couple of .NET based web CMS.

More to come on this topic sometime later. I probably have enough material to publish a small document on this subject. We’ll see if/when I get to that. But for now, I definitely maintain that Django CMS is the most polished solution for folks looking for a simple and attractive web CMS software.

Musings on Technology and the society