Make a business app without writing a single line of code

If you’ve been here before, you know that I always express skepticism when I encounter this kind of claim. But when someone like Scott Hanselman tweets it, then I pay attention and will give it a shot. That’s what I did and here is how it went.

I visited the site, followed the link to create an app, picked a template/example and simply accepted all defaults. I chose to download the source codes. Within about 3 minutes I had three apps downloaded to my mac. The web site looks clean, it’s easy to follow.

App Control panelApp Control panel

There’s an option to download the fully built and ready-to-go app.

Trigger app build process App's being prepared for download Download your app

When you install the app, you get something that is really basic but functioning.

login view

main view

I then loaded the iOS version on Xcode to take a look at the source code. Browsing around I saw a source tree that is reasonably well organised, clean, simple and straightforward. You see that it doesn’t have much feature. I wouldn’t call this a foundation to base anything evolved on, but the basic hierarchical navigation views are in place.

Sample app in Xcode

I tried to build from Xcode and straight away the code wouldn’t compile. I saw there were missing dependencies, could try to solve that manually but decided to use cocoapod for that (everybody does these days). Indeed the presence of podspec file was another give away. After refreshing the dependencies, the code still wouldn’t compile, the Test target failed. So I deleted the Test target, then the code runs. I couldn’t be bothered to spend much time on this.

There’s also Android and Windows app source codes available. I didn’t take time to go through those, but I expect they would be similar: basic structure, quick and easy, but not much feature to see. To be honest, the basic app structure created by Xcode would be much like what you get here, one benefit is that through the theme feature of the web site, it’s possible to make it a bit more proprietary and get going.

Brief summary

For a beta service, this looks like a good start. It certainly will help people who just need a decent looking prototype to get started. The concept of App Builder, aiming at people who don’t want to write code, seems to be in motion. I’m not sure how much success they’re getting, but it is worth checking them out regularly. There might be situations where even a professional developer would want to get something simple out quickly, particularly throwaway ephemeral apps that are not worth over-engineering. This one looks good for that kind of purpose. For more elaborate needs however, writing code is still going to win the day.

To write good code, you need to think carefully about what you’re trying to do, what the context is and what the constraints are, then design a solution that cater for those things.

Idris, a dependent typed functional programming language: install and run on OS X Mavericks

I got rid of the (now deprecated) cabal-dev, updated to the latest version of cabal and thought of installing idris on my machine.  I immediately hit a problem, it won’t install. I get the following error message (log cut down):

$ cabal install idris
Resolving dependencies...
Configuring annotated-wl-pprint-0.5.3...
Building annotated-wl-pprint-0.5.3...
Preprocessing library annotated-wl-pprint-0.5.3...
...(cut)...
Registering trifecta-1.5...
Installed trifecta-1.5
cabal: Error: some packages failed to install:
idris-0.9.14.1 depends on language-java-0.2.6 which failed to install.
language-java-0.2.6 failed during the configure step. The exception was:
ExitFailure 1

So, it’s logical to try and install ‘language-java-0.2.6′. I tried that:

$ cabal install language-java-0.2.6
Resolving dependencies...
Configuring language-java-0.2.6...
cabal: The program 'alex' version >=2.3 is required but it could not be found.
Failed to install language-java-0.2.6
cabal: Error: some packages failed to install:
language-java-0.2.6 failed during the configure step. The exception was:
ExitFailure 1

And that fails too. It turns out I could install the package ‘alex’ manually. So I run this:

$ cabal install alex
Resolving dependencies...
Configuring random-1.0.1.1...
Building random-1.0.1.1...
...(cut)...
Linking dist/dist-sandbox-c9c9694f/build/alex/alex ...
Installing executable(s) in
/Volumes/MacintoshHD/usrlocal/bin/.cabal-sandbox/bin
Installed alex-3.1.3

That worked. I can now attempt to install Idris:

$ cabal install idris
Resolving dependencies...
Configuring language-java-0.2.6...
Building language-java-0.2.6...
Preprocessing library language-java-0.2.6...
...(cut)...
Registering idris-0.9.14.1...
Installed idris-0.9.14.1

Succes. Phew! I am now ready to start using Idris:

$ idris
bash: idris: command not found

Oops! It’s not in the search path, and it’s not obvious where it’s gone. That’s easy, prior to all this I had installed and initialised a cabal sandbox.  So it’s gone in the sandbox, which isn’t in my search path. I went for a sandbox approach because I wanted to isolate my installation of snap and yesod from this Idris playground.

To preserve my sandbox concept, I am going to use an alias to Idris:

$ alias idris="/Volumes/MacintoshHD/usrlocal/bin/.cabal-sandbox/bin/idris"

I typically add such alias to my ~/.bash_profile so that it’s always available.

$ idris
 ____ __ _
 / _/___/ /____(_)____
 / // __ / ___/ / ___/ Version 0.9.14.1
 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
 /___/\__,_/_/ /_/____/ Type :? for help
Idris is free software with ABSOLUTELY NO WARRANTY.
For details type :warranty.
Idris >

And that’s it, I now have Idris available and I can plough on. Ironically, for a language that promises to bring you dependent typed programming, the infrastructure dependency management isn’t stellar. That remains a weak point for me for all things Haskell.

Post Scriptum

  1. This is part of an exploratory journey into dependent types, an exciting concept in computer programming that I wish to use for production code in the near future. To get a glimpse of what this means, read this nice blog post, which, by the way, I think of as a model for introducing advanced programming concepts.
  2. Idris is built on top of Haskell, of which I have a recent version running on my machine. So if you’ve never had any of that kind of stuff on your machine, your mileage might be considerably longer than what I’ve shown here.

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 ;-( :

Musings on Technology and the society