Category Archives: professional

Quick thoughts on Xcode and Objective C versus Microsoft’s tools

I have been trying out JetBrains’ AppCode which meant working in an Apple development environment for a time. I took the opportunity to implement my simple calculator app in iOS native code.

image

Objective C is a distinctive language with a mixed reputation, but I enjoy coding with it. I used Automatic Reference Counting (ARC), a feature introduced in Xcode 4.2 and OSX 10.7, iOS 5; ARC now also works with 10.6 and iOS 4. This means objects are automatically disposed, and I did not have to worry about memory management at all in my simple app. This is not a complete memory management solution (if there is such a thing) – if you use malloc you must use free – but it meant that the code in my app is not particularly verbose or complex compared to other languages. Apple’s libraries seem to favour plain English method names like StringByAppendingString which makes for readable code.

I was impressed by how easy it is to make an app that looks good, because the controls are beautifully designed. I understand the attraction of developing solely for Apple’s platform.

I also love the integrated source control in Xcode. You find yourself using a local Git repository almost without thinking about it. Microsoft could learn from that; no need for Team Foundation Server for a solo developer.

I did miss namespaces. In Objective C, if you want to remove the risk of name collision with a library, you have to use your own class prefix (and hope that nobody else picked the same one).

image

Interface Builder, the visual UI designer, is great but many developers do not use it, because coding the UI without it is more flexible. It is a shame that you have to make this choice, unlike IDE’s with “two way tools” that let you edit in code or visually and seamlessly keep the two in synch. I found myself constantly having to re-display windows like the Attributes Inspector though it is not too bad once you learn the keyboard shortcuts. The latest Interface Builder has a storyboard feature which lets you define several screens and link them. It looks useful, though when I played with this I found it difficult to follow all the linking lines the designer drew for me.

It is interesting to compare the Mac and iOS development platform with that for Windows. Microsoft promotes the idea of language choice, though most professional development is either C# or C++, whereas on Apple’s platform it is Objective C and Cocoa or you are on your own. Although Mac and Windows are of a similar age, Microsoft’s platform gives a GUI developer more choices: Win32, MFC, WTL, Windows Forms, Windows Presentation Foundation and Silverlight, and in Windows 8 the new WinRT.

I get the impression that Microsoft is envious of this single-minded approach and trying to bring it to Metro-style Windows 8, where you still have a choice of languages but really only one GUI framework.

That said, Visual Studio is an impressive tool and both C# and C++ have important features which are lacking in Objective C. I would judge that Visual Studio is the more productive tool overall, but Apple’s developer platform has its own attractions.

Review: JetBrains AppCode for Objective C

I have been trying out JetBrains AppCode, a new IDE for Apple’s Objective C. The company is best known for its IntelliJ IDE for Java, and AppCode essentially takes the same core IDE and reworks it for Objective C. AppCode is itself a Java application, but unless you have a religious objection to this I doubt you will find it a problem: I found it perfectly snappy and responsive on my machine, a 2.3 Ghz Core i5 with 8GB RAM.

Installation was a snap, as Mac users expect.

image

One thing I discovered immediately is that AppCode is not a replacement for Xcode, the official Apple IDE. The Apple SDKs are delivered with Xcode, and AppCode requires it. An AppCode project is also an Xcode project.

image

This is particularly important if you want to use Interface Builder, the Xcode visual designer, since AppCode has no equivalent. Double-click the .xib file and it opens in Xcode. This is a disorientating at first, but in practice I found it convenient to be able to switch between the two IDEs.

So why bother with AppCode, when Xcode is free? It is certainly not essential, but my view is that tools which save time or improve quality are worth the investment. Whether AppCode will do this for you will depend on how you work and whether you have any frustrations with Xcode, which improved considerably in version 4. Out of the box, Xcode has integrated Git or Subversion source code control, unit test integration, refactoring including Rename, Extract, and Encapsulate, the aforementioned Interface Builder, and a ton of other features. Sticking with Xcode is a safe choice.

That said, AppCode feels leaner and less cluttered than Xcode. It also has many additional productivity features in the editor. JetBrains’ IDEs are well known for refactoring, and while AppCode is not as rich as IntelliJ IDEA in this respect, it does have a more than Xcode.

Another strong feature is code generation. Press Command + n in the editor, and a context-sensitive Generate menu offers various time-saving options. I like the way I can type a new method in an implementation file, press Alt + Enter, and select Declare method in the interface to add it automatically to the interface file; or type it first in the interface and have it implemented automatically. It pays to learn the keyboard shortcuts

Live templates let you type an abbreviation and expand it to a block of code, which you then tab through to edit. Type for, select the template, press tab, and AppCode will create a for loop; press tab again to edit the variable name and the number of iterations. You can customise and create your own Live templates in the AppCode Preferences dialog.

image

There are also a ton of performance tools in AppCode [update: note these are links to Xcode tools].  Choose Profile from the Run menu and choose what you want to analyse:

image

then run your app

image

You can also do static analysis according to customisable rules.

There is a debugger which works as you would expect including stack trace and variable inspection.

The best thing I can say about AppCode is that it is a pleasure to use. It does not throw up unnecessary dialogs, it works logically, and the tools are easy to use and configure. I have not always found this to be the case with Xcode, and if you spend a significant amount of your time on Objective C development then I recommend grabbing the trial download to discover if it will speed your work.

Post sponsored by Monster for the best in IT Jobs.

Twilio: programmable telephony, SMS comes to the UK, Europe

Web telephony provider twilio, which is based in San Francisco, has today announced its first international office, in London. You can now purchase UK telephone numbers at a cost of $1.00 per month, or Freephone numbers for $2.00 per month.

Twilio is not in competition with Skype or Google Voice; rather it offers an API so that you can incorporate voice calls and SMS messaging into web or mobile applications. The REST API lets you provision numbers with various options for what happens to incoming calls (conferencing, forwarding to another number or voice over IP, recording, transcriptions), as well as notifications so that you can get email or SMS alerts.

CEO and co-founder Jeff Lawson came from Amazon Web Services (AWS), and has a similar business model in that twilio targets developers and offers infrastructure as a service, rather than selling complete applications to its customers. Twilio does not own any datacenters, but uses mainly AWS and some RackSpace virtual servers to provide a resilient and scalable service.

The launch partner for the UK is Zendesk, a cloud-based helpdesk provider, which is using twilio to add voice to what was previously an email-based product. Zendesk forms an excellent case study. Using the service, you can provision a support number and have calls redirected to agents, or have a voicemail recorded, using a simple setup procedure. Calls can be recorded and you can have alerts sent when they are received.

What this means is that even the smallest businesses can offer helpdesk support using a pay-as-you-go model.

Lawson observes that twilio is the 6th and 13th most popular API on ProgrammableWeb (he says it is 5th if you combine voice and SMS) and claims very rapid growth in traffic using the API, though he will not talk about revenue. The company has around 60 employees in San Francisco and just one in the UK initially.

The service is also launching in beta for 5 other European countries: Poland, France, Portugal, Austria and Denmark. 11 other countries will be added by the end of 2011, though there are prominent omissions – no Germany or Spain, for example.

I was impressed by the demo and presentation at the press launch. Lawson provisioned a conferencing number and had us dial in during the briefing. He says twilio is engaged in disrupting on-premise telephony applications with a cloud service, in the same way Salesforce.com has done for CRM (Customer Relationship Management). The service is inexpensive to set up; Lawson said that this commodity pay-as-you-go pricing is essential for disruptive technology to succeed, another strategy borrowed from AWS.

There are server libraries for web platforms including Ruby, PHP, Java and C#, and client SDKs for JavaScript, Android and iOS.

Blue screen, Windows 8 style

This is what happens when Windows 8 crashes:

image

The restart message proved false, and I had to reset the virtual machine.

I did the search, which told me:

The CLOCK_WATCHDOG_TIMEOUT bug check has a value of 0x00000101. This indicates that an expected clock interrupt on a secondary processor, in a multi-processor system, was not received within the allocated interval.

This proves that you make give blue screens a prettier face, but that does not make the error messages any more helpful to a non-expert user. Or should I head for my nearest computer store and ask if they have a spare clock interrupt?

Zend’s PHP cloud: develop in the cloud, deploy anywhere

Zend has announced Zend Studio 9 beta, the latest version of its IDE for PHP. The feature that caught my eye is integrated support for the Zend Developer Cloud, currently in technical preview. Setting up a PHP development environment is not too difficult, but can be a hassle to maintain, and the idea of being able to fire up an IDE anywhere and start coding is attractive.

You do not need Zend Studio to use the Developer Cloud; they are independent projects, and you can use the free Eclipse PHP Development Tools (PDT) or another IDE or editor.

The PHP Developer Cloud is not just a shared hosting environment for PHP applications:

All applications are housed within a container on the Zend Application Fabric. This container is separate from all other containers and has its own database instance and is easily connected to your IDE.

The Zend Application Fabric is for deployment as well as development. It is a server framework that includes the Zend Framework and also the capability of scaling on demand.

Once you have developed your app, you can deploy to any cloud provider that supports the Zend Application Fabric, including Amazon Web Services, IBM SmartCloud,  a private “custom cloud”, or a resilient multiple cloud option which Zend calls RightScale. You can deploy to RightScale using both Amazon and Rackspace together, which I presume means your app will keep on going even if one of these providers were to fail.

Details on the site are sketchy, but if Zend has got this right it ticks a lot of boxes for enterprise PHP developers.

image

Adobe MAX 2011 and the future of Flash

The unstated theme of Adobe MAX 2011 last week was this: what is the future of Flash? The issue being that with HTML 5 ascendant and Apple wrecking the idea of Flash as an ubiquitous web plug-in, should Adobe be frantically retooling its design tools for HTML and apps, or does Flash still have a future?

image

The answer is a little of both; but let’s be clear: there was more Flash than HTML at MAX. What was the most eye-catching demo? It was Flash running Unreal Tournament with the claim of better graphical performance than on Microsoft Xbox 360 or Sony Playstation 3.

It is also worth noting that the touch apps demonstrated at the day one keynote were created in Flash and compiled into apps using the new Captive Runtime feature in AIR 3.

At the same time there was a substantial amount of HTML effort on show. There was the announced acquisition of Nitobi, makers of PhoneGap – though note that PhoneGap itself is heading to the Apache Foundation – and demos of the Edge motion and interaction tool for HTML5. Adobe also told us about its work on CSS Regions and CSS  Shaders. I also saw how HTML export, including partial ActionScript to JavaScript conversion, is coming in a future version of Flash Professional.

My perception is that while Adobe is serious about stepping up a gear with its HTML tools, its heart is still with Flash. That said, there is a shift of emphasis away from Flash as a web plug-in, other than when it is the “Games console of the Web”, and towards Flash and Flex as a cross-platform development platform. Adobe is using Flash and AIR for its own Touch apps, previewed at MAX.

Let me add that the new features in AIR are huge, in particular the ability to package the Flash runtime as part of your app, called Captive Runtime, and the ability to extend your AIR app with native code. Cross-platform mobile tools are a particular interest of mine, and Adobe’s offering is strong in this field, though it will never be the most efficient. Adobe is also pressing ahead with something like web workers for ActionScript, providing a form of concurrency, though this is not in AIR 3 but planned for a future release. Another big new feature in the Flash runtime is Stage 3D, accelerated 3D graphics which enabled the Unreal demo mentioned above.

Nitobi’s Andre Charland was at MAX and I could not shake off the thought that he will find joining the Flash company difficult.

image

It will be near-impossible for Adobe to be equally enthusiastic about both PhoneGap and AIR, and given that Flash and AIR are so deeply woven into the company’s products I suggest that PhoneGap is more likely to be neglected.

Take a look at Adobe’s agenda for the Back from MAX event in London next month. It is 100% Flash and Flex.

What about the MAX attendees? I have contradictory evidence here. I noticed that a session on Building mobile apps with HTML, CSS and JavaScript (ie PhoneGap) was packed out, while the session running at the same time on What’s new in AIR – and what’s next was sparsely attended. This session was repeated, which means Adobe thought it would be a popular one. I was also surprised by how few went along to hear about Flash Professional Sneak Peek: a glimpse at the future which was a fascinating session if you are interested in the future of this tool. Adobe must have been surprised too, as it was in a large room.

image

That said, a session on native extensions for AIR was moved from one of the smallest rooms to one of the biggest and was still full. There was also great interest in concurrency in the Flash runtime. Many of the attendees I spoke to saw themselves as Flash and Flex developers and there was more talk about how to fight off the perception that the tech world is moving to HTML, than of how to encourage it.

Getting rid of Flash may seem like obvious progress to someone annoyed by the Adobe updater, or who is an Apple iOS enthusiast, or who does not like the idea of proprietary plugins. It does not feel like that though if you have a browser-hosted app to maintain and enjoy targeting a single runtime rather than testing in every browser, as well as using features of Flash that are hard to replicate in HTML.

Adobe’s design and development platform is still Flash-centric, which is either good or bad news depending on your perspective.

See also Down but not out: Flash in an HTML5 world.

Subversion 1.7 released: just one .svn directory per working copy

Yesterday saw the 1.7 release of Subversion, the widely used open source version control system. It is a significant release with many new features, bug-fixes and performance improvements, and I suggest reading the release notes or complete change log. One thing to highlight is that the default working copy metadata storage is now a single sqlite database per working copy, rather than a .svn direction containing metadata in sub-directory.

I upgraded my TortoiseSVN, which is already updated to 1.7, and tried upgrading one of my own projects. Here is the .svn folder before the upgrade:

image

and after

image

Those pesky .svn folders can be a nuisance so this is a welcome change, although there is a downside as the release notes warn:

It is not safe to copy an SQLite file while it’s being accessed via the SQLite libraries. Consequently, duplicating a working copy (using tar, cp, or rsync) that is being accessed by a Subversion process is not supported for Subversion 1.7 working copies, and may cause the duplicate (new) working copy to be created corrupted.

Subversion is less fashionable since the advent of distributed version control systems like git and mercurial; though for corporate development Subversion remains popular because a centralised system is easier to control.

WANdisco’s Jessica Thornsby has a helpful post on the new 1.7 features more details on the benefits of the new working copy metadata managements system.

Adobe: no new features for open source BlazeDS data services

Adobe’s Damon Cooper, who runs the BlazeDS and Data Services team at Adobe, has posted about BlazeDS vs the paid-for Data Services.

It is a curious post, in that he simultaneously highlights new features coming in Data Services 4.6 while also giving a number of reasons not to use BlazeDS.

BlazeDS is the free and open source version of Data Services, for publish/subscribe messaging and remote object invocation of Java objects in a Flash or AIR application.

He points out that the LGPL licence may be problematic; he emphasises that BlazeDS is unsupported; he says that while it is open source there are no non-Adobe committers; and as the knock-out punch adds:

Additionally, while we will absolutely be making sure we keep BlazeDS fresh and the bug fixes flowing, we don’t currently have any major new features planned for BlazeDS. That could change, but we’re currently full-out on delivering innovation to our customers have asked for in Data Services and we are full steam ahead there. 

It does sound like a retreat to me; and while I do not think Adobe is under any moral obligation to continue developing BlazeDS it does make me wonder what has changed between the moment in 2007 when Adobe decided it was a good idea to open source part of its LiveCycle Data Services, and today.

At Adobe MAX last week Adobe announced the acquisition of Nitobi and with it the open source PhoneGap project. PhoneGap is heading to the Apache Foundation – probably a good thing considering that Adobe sometimes seems to struggle when it comes to managing open source software.

Google offers the web a new language called Dart – but why?

Google has announced an early preview of Dart, a new language for web applications. The news is not a surprise, especially if you have been keeping track of the developer conference GOTO Aarhus, whose organisers had pre-announced that Google would be announcing its new language there, as indeed it did.

image

Dart is a curly-brace language like JavaScript, Java, C, C++ and C#. In Dart, as in C# and Java, a class can implement multiple interfaces, but only inherit from a single class. Dart supports both static and dynamic typing. Google says it can be executed by a Dart VM, or converted to JavaScript:

Dart code can be executed in two different ways: either on a native virtual machine or on top of a JavaScript engine by using a compiler that translates Dart code to JavaScript. This means you can write a web application in Dart and have it compiled and run on any modern browser. The Dart VM is not currently integrated in Chrome but we plan to explore this option.

Google also says that you will be able to “execute Dart code directly in a VM on the server side”, so you can infer that Google has Dart in mind as an alternative PHP as well as to JavaScript. The company is using the phrase “structured web programming” to describe Dart, and this phrase appears in the announcement and as the subtitle on the Dart site. The implication is that JavaScript code tends to be poorly structured and that Dart will promote more maintainable code.

In the preview Dart only runs in Chrome, Safari 5 and Firefox 4+ – spot the missing browser vendors.

At first glance, Dart looks like a promising language, though I find myself asking what it is really for, when it bears a strong family resemblance to existing languages, and bearing in mind that the Google Web Toolkit, which compiles Java to JavaScript, already enables structured programming for web applications. The list of problems which Dart solves in the technical overview is not all that compelling.

Google states that:

Developers have not been able to create homogeneous systems that encompass both client and server, except for a few cases such as Node.js and Google Web Toolkit (GWT).

This is or was one of the attractions of Microsoft Silverlight, presuming you use C# on both server and client, but Silverlight is a plug-in that was never going to run on an iPad and from which Microsoft itself is now retreating; though it is worth noting that Dart is not unlike C#, especially the latest version of C# with dynamic features.

I guess that Dart is a consequence of the failure of ECMAScript 4.0, which was a cooperative effort to create a more modern and advanced JavaScript. Google is now going it alone; the key question is whether it can win support from others such as Apple and Microsoft, or whether this will be a Google language for Google on the server and Chrome on the client, or an interesting experiment that never really catches on.

Do we need Dart? I would value hearing from others what you think of Google’s proposal.

CodeRage free online conference for Delphi and RAD Studio starts next week

Embarcadero’s CodeRage virtual conference starts next week from October 17 2011, and is worth a look if you have any interest in Delphi or the new RAD Studio XE2.

There are sessions on 64-bit Delphi, the new cross-platform FireMonkey framwork, the new LiveBindings data binding system, Prism (Delphi for .NET), and extras including a session on Regular Expressions in Delphi and elsewhere, Dependency Injection and Delphi Spring, unit testing with Delphi, and using 3D graphics in business applications.

Of course you could wait for the replays to be available, but if this is like previous events there is a chance to ask questions to people who might actually know the answers, so there is an advantage to the live event – though the event is schedules for Pacific Time so the afternoon ones involve a late night if you are in the UK.