Archive for Uncategorized

Developers in a Post-PC world

Photo09071631_1.jpg

Army of Me 5.25" floppy

So, last week I tweeted about the “Post-PC” world and sounded like a bit of an arrogant tosser.

Post-PC is the shift from devices built for personal creation to devices for consumption. I need to create.

https://twitter.com/#!/craignicol/status/166969581137707008

Today, I’m going to try and explain myself by sounding like an old fart.

My first computer was an 8-bit Toshiba MSX (yep, powered by Microsoft – still waiting for by MSX Basic MVP ;-) ), which wasn’t as popular as the other 8-bit platforms, but it shared one important feature : it booted into a programmable console. Anyone who wanted to use one of these machines had to start by learning a few lines of code, and it was the same code that a lot of the available software (well, games) were written in, so the user immediately started learning how to create new software. And that became important to me on each new platform, because I wanted to understand how they worked and what I could do with them.

I then moved on to Amstrad CP/M and then DOS machines. Still condole based, but there was a division between developing for the devices and interacting with them. I could easily load up QBasic in MSDOS and start writing graphical games (and then later port those to Borland C++), but there wasn’t a need to learn code to use the machines. Definitely an advantage for the average user, but at least the development tools were still one step away. That philosophy is one reason why I run Ubuntu on my home machine – it comes installed with Python :-D

And then came Windows 95 and development became an add-on. The computer grew up and divided those who wrote software into a special class apart from the normal users.

And then we get the Post-PC era, where not only do the devices not come with development tools, there are no add-ons available for those devices to develop on. The development has moved not only to another machine, but to another OS. So, we now need 2 devices, and the world of development becomes more disjoint from the world of users. I can see the benefits of it, I can see the different optimisations that need to be made for different use cases (and I understand why a lot of developers have a string reaction against Ubuntu Unity for a similar reason), but it leaves me with a nagging question of where the next generation of developers will come from. When your primary device is for consuming software that others have developed, the jump to developing your own software isn’t just a leap to learn a new package, it’s a leap to a new platform, which is a much bigger, scarier and more expensive step.

Unless the web wins, and all the Post-PC devices have a decent Javascript editor (or can run Cloud9 IDE or similar in their browser).

But maybe I’m just old and have a skewed view of the world.

For those in the audience who started developing in the Windows 95 era when development meant downloading something new, and taking a bigger step, what inspired you?

And what will inspire the next generation of developers to step up from their Post-PC device to a development PC?

Comments (1)

Apprentice programmer

unlit olympic flame

Let’s talk about plumbing, and customer service, and an experience I had recently with a company I won’t name. Overall the experience was good, but I don’t want anyone to get into trouble because they’ve misinterpreted what I have said here. (and if you’re wondering about the picture : the Olympic flame isn’t lit either).

A couple of months ago, our gas combination boiler failed. It refused to start and complained that the flue was blocked. I sighed because we’d had the bearings on the fan replaced last year. So I called the service company to get it fixed.

A couple of days later, I was working from home to let the service technician in. He was fairly young but identified a problem. Unfortunately, a new part was required, so he had to come back the next day. He came back, replaced the part, fired up the boiler and all looked good. The next morning, no hot water and a flue warning :-( it was the weekend by this point so we got a senior employee, who identified an error in the replacement part (fitted the wrong way) and identified the original problem as a blocked inlet. 5 minutes to identify, 1 hour to dismantle the boiler to get to the blockage and put it back together.

He finished, switched the boiler off, and then made sure it fired when put back together. Problem solved.

So, what did I learn, and why am I posting this on a programming blog?

Firstly, a monthly fee means that I didn’t have to worry about callout or parts, which was great, and left me less annoyed than I might have been.

Secondly, your first fix might not be the right fix. It looked right and it passed the first test, but caused problems later on (at the next restart). Ever written the wrong test and thought the problem was solved? Threading has caught me out in that way before.

Thirdly, just because it passes the test, doesn’t mean the problem is fixed. The boiler fired easily when the case was open and there was more airflow, but didn’t fire when the case was closed. Ever had a bug that only appeared in production or in a system test?

Fourthly, experts will find problems quicker than rookies, but rookies still need to learn.

Fifth, sometimes the only way to fix a problem, even a small one, is to tear everything apart, blow on it, and put it back together again.

The second guy also said something that struck a chord, as I’ve been trying to do it myself : he was disappointed that the company didn’t send the junior out with him so he could pass on his experience so that he’d learn for next time. Apparently, the fault itself is rare, so it’s a good learning opportunity. For developers : fix your own bugs, as there are a lot of things apprentice developers will see in the first few years after they graduate that are rare enough not to come up in university but common enough to be real problems in the real world. For example,
trusting user input (and the related buffer overrun bugs).

So, what have you learned from other professionals?

Leave a Comment

Weekly (Scottish?) Developers Google+ Hangout?

I had an idea for running a book club for Google+ Hangouts, but after David Christiansen turned up, it became a more interesting catch-up, covering HP selling off WebOS, and discussing zaproxy ( http://code.google.com/p/zaproxy/ ) penetration testing tool and JIRA agile project management tool ( http://sandbox.onjira.com/secure/Dashboard.jspa?os_username=jens&os_password=password ).

Some good chat, but we were wondering if other Scottish Developers would be interested in a weekly Friday lunchtime hangout to shoot the breeze on the tech stories, tools and blogs of the week.

If you’re not on Google+ and need an invite, give me a shout and I’ll email one back to you, or click here for an invite : http://goo.gl/P0p2b . If you are interested and on Google+ come and find me at https://plus.google.com/112347442728934313588 and jump on in next time. Web cams and mic optional (if you’re a fast typist), but you will need speakers to listen in.

If there’s more good info, I might even start a weekly blog on it, but we’ll see how much interest there is.

What do the rest of you think?

Craig.

Comments (2)

Justice in Pakistan?

I’ve had an idea in my head for a while that I wanted to start
blogging about things a bit more political than my technical blog. Not
party political, because frankly, that bores me, but political in the
grander sense. Today I was having a discussion on Facebook about Osama
bin Laden, and whether killing can ever be a good thing. And I would
say that the question isn’t what is right, a question of if it is OK
in this circumstance, but not in that circumstance.

It is a question of justice and forgiveness. If justice and
forgiveness are to mean anything, then they, like the human rights
they are based on, must be universal. We cannot say “this person is
not worthy of justice” because then justice is hollow and becomes a
tool to control others by imposing values on others that you would not
follow yourself.

To demonise one man for his actions dehumanises both him and those who
oppose him. Simply calling him “evil” absolves you of responsibility
to hear his grievances. Not listening to the victim does not justify
the crime of murder. And for those who would say that he would not
give his victims compassion, I would ask why you choose his actions as
a guiding principle when you condemn those same actions in his hands?

Will this death undo all those who have died before? No. Will it stop
future terrorist attacks? Unfortunately not. Is celebrating death,
anyone’s death distasteful? Of course.

Do you want justice, revenge or compassion? What sort of person do you
really want to be?

Comments (2)

QConLondon 2011 : Day 3 review

Sorry for the big delay in getting this post out (one word : deadlines), but for both of you who’ve been waiting eagerly for this, here’s my review of day 3 of the QConLondon 2011 conference, unfortunately too late for the QConLondon Key Takeaway Points and Lessons Learned. For me, it was a bit of Mono and a lot of web. I’ll also include a quick round-up of the whole conference.

Keynote : Things I Wish I’d Known / Rod Johnson

A great dose of Dr Seuss philosophy to start the final day as Rod Johnson of Spring Software spoke about his experiences building a start-up, and included some advice that everyone should think about their career from that perspective, to find opportunities. He admitted from the start that this was not a technical talk, and I must admit that although I’ve used Spring.Net in the past, I never paid much attention to the Java world that inspired it.

As the rest of the conference showed, Spring has won the battle of ideas. Dependency Injection is part of the toolbox of every decent .Net and Java developer (and probably many others, but I’ve less experience there), but at the start of Spring, it was a hard struggle : there was a reason there was a gap in the market.

A lot of the talk covered similar ideas to the Pretotyping talk from the previous day, talking about throwing away ideas is easier than throwing away code, and adding that the best way to prove a concept is to try and prove yourself wrong. Mistakes are good, and can be recovered from, so long as the legal side is solid.

There was a lot of advice that seemed to be pitched more to the QCon SF audience, about how and when to pitch for funding (hints : hype is worth more than numbers, and always budget high because it will cost more than you think). It wasn’t a talk I think I would have attended had it not been the keynote, but there were some interesting takeaways, and it’s given me a bigger appreciation of the entrepreneur culture.

Advanced Reflection / Jean Baptiste Evain

This talk from JB Evain was primarily a demo of two very cool tools that come under Mono : Mono.Reflection and Mono.Cecil. There was one very interesting selling point : Mono.Cecil is used by ILSpy – an open source alternative to RedGate’s Reflector Pro. The overall theme was how to treat programs as data, so that behaviour can be changed at run time, and how System.Reflection falls a little short, such as missing support for multi-dimensional arrays.

The Mono.Reflection library consists of a set of extension methods over System.Reflection to add features such as Property.GetBackingField, and also to provide IL dissassembly at runtime.

Mono.Cecil works at the assembly level, providing a full object model for assemblies that works in Mono, .Net, Silverlight, Compact Framework and Windows Phone 7, and can interrogate cross-platform, allowing a desktop app to reflect over a WP7 assembly. There are some restrictions on support for code generated by System.Reflection.Emit() and for signed assemblies, but there was a great demo of the capabilities Mono.Cecil can add to a project, by enforcing an enum restriction on a generic type in a library class, that caused a compile error if a non-enum type was used in client code using code injection to insert IL bytecode into the compiled library. He then went one better with a preview of Milo, which used expression trees rather than IL to inject code for a much cleaner looking extension mechanism.

Node.js: Asynchronous I/O for Fun and Profit / Stefan Tilkov

Ever fancied writing your server side code in JavaScript? If you listen to Stefan Tilkov, maybe you will soon. He talked about a few of the headaches I’ve experienced in the ASP.Net/IIS world (and I’m sure they exist elsewhere) : how do you efficiently handle concurrency when you have a long-lived thread in a thread pool that spends most of its time eating memory and waiting for I/O from local storage or a back-end server? A thread that blocks is eating up resources and getting in your way when you want high throughput, especially for streaming.

Node.js, built on Google’s V8 javascript engine (part of the Chromium project), uses a single-thread event-loop style, similar to the UNIX select() that never blocks on I/O, because it passes that handling onto the kernel. This is the same concept as Nginx.

Unlike traditional servers, Nginx doesn’t rely on threads to handle requests. Instead it uses a much more scalable event-driven (asynchronous) architecture. This architecture uses small, but more importantly, predictable amounts of memory under load.

Node.js uses the Javascript callback architecture, familiar to any web developer who’s used XMLHttpRequest, exposing a number of I/O events, and exposing the entire API as asynchronous by default to encourage a high-performance architecture. The downside is that the code can be hard to follow, especially when multiple functions are chained together, although InfoQ has a few articles discussing libraries for making Asynchronous Javascript easier. It’s definitely worth having a look at the node.js samples from the talk if this interests you.

Webmachine: a practical executable model of HTTP / Justin Sheehy

HTTP is a state machine. Look at how Webmachine sees it:

Webmachine is not a web server, or a REST framework, it’s an Erlang toolkit for building HTTP-based systems, by allowing you to override the state machine above as you wish. It’s a strict implementation of the HTTP standard that has turned up a few problems with the structure of the spec. It was described as a “gateway drug into Erlang”. It’s a fascinating project, and it’s been ported to a few other platforms. It feels to me how all HTTP engines should be written, although sometimes I like having a framework. As he said, a framework is “a finished app with some bits ripped out.”

Secure Distributed Programming on EcmaScript 5 + HTML5 platforms / Mark S. Miller

This is a hard one to talk about. I’ve seen the talk, I’ve seen Mark S. Miller’s QCon SF talk, and I’m still not 100% sure I follow it. The basic idea is that we need a better way to transmit secure information between 3rd party sites. We need a way to transfer our trust in an ecommerce site to our bank so that they can pay the site on our behalf without compromising our details in the process. The solution, Dr. SES, seems to be an API-key on steroids, where the key itself is an executable piece of javascript, provided to the user by one server, that the user can then pass to another server, providing the ability for users to create side effects such as 3rd party authentication channels (SMS security?) and token revocation providing the user with greater control over how the associations they have created can be used.

The other brilliant part of the talk was the discussion of Ptolomy and the retrograde movement of the planets. The model of circular orbits was flawed, so additional circles were added to the models each time it was found to be broken. The argument was browser security was built the same way, with each security breach, a new circle was added, rather than rebuilding the model from scratch with security built in. The identity-centric model that has driven browsers until now should give way to the authentication-centric model provided by the strategies discussed in the talk.

HTML5 and the dawn of rich mobile web applications / James Pearce

James Pearce of Sencha gave a convincing argument that HTML5 is ready for cross-platform apps, helped by a few demos available on the Sencha site. The argument is helped by the rather fragmented state of the mobile market, where RIM, Android, Apple and Nokia are all significant players, each with their own language and capabilities.

The mobile web, he argued, is not just the web on a smaller screen. The new generation of web enabled devices have additional capabilities such as cameras, geolocation, accelerometers, and also, as many mobile websites forget, a phone. So don’t forget a phone number is much easier to use than a “Contact Us” form.

On the desktop, progressive enhancement is used to support older browsers without javascript up to newer browsers. On mobile, the baseline includes javascript and many HTML5 and CSS3 features, and progressive enhancement is used for querying for device access, using libraries such as caniuse.com, Modernizr and deviceatlas.com, as well as a number of frameworks to normalise behaviour across devices, such as jQuery mobile versions, and Sencha’s own frameworks, that include an MVC-based touch client that talks to a web services backend. He also mentioned the image resizing site at tinysrc.mobi. If you pass a URL as http://i.tinysrc.mobi/http://your.url.here : , the site will render the correct size for your device.

The other great tool mentioned in the talk was PhoneGap that allows developers to design an app using web technologies, then compile it down to a native app so it can be listed on the various app stores, providing device access that is usually not available to web sites.

Overall review

This was a fascinating conference and I hope I get the chance to attend again, although there were a few disappointing themes across the board. There was a lot of talk about the release fast, release often philosophy with only 1 speaker (Mike Lee) suggesting waiting a bit and making a better quality product is a valid strategy. The technical talks were the main reason I went, but I’m very glad I attended some of the less technical and more thoughtful talks, and talks about technologies I’m probably never going to use, because they made me think about the problems I’m trying to solve in a different way. Webmachine was a perfect example of this. I can’t see myself ever using it in a project, but I might use one of the ports, and it definitely made me think more about HTTP and what it means, which has fed back into my understanding of REST and web technologies in general. I think that breadth is the key to this conference. If you’re going next year, be sure to embrace the diversity.

Leave a Comment

Lessons learned from the Feedly for Android beta 1 (via Building Feedly)

A fascinating insight into moving from iPhone to Android development, especially with regard to different users and UX expectations. And interesting talk of a cross-platform framework.

We released on Wednesday the first beta of feedly for android – for both phones and 10" tablets. Here are some of the lessons we learned during the last 5 days. The good Android has an open app distribution model so we started by pushing the app to our website, invited 50 users and tried it for 12 hours to see if they were any major show stoppers – very valuable given that there are a lot of different types of phones and we only tested feedly on … Read More

via Building Feedly

Leave a Comment

I don’t know

As we start the new year, there’s something I’ve noticed amongst developers, particularly when talking to clients, that we need to watch out for. There can be a reluctance to say “I don’t know”, so I just want to say, to anyone reading this, sometimes it’s OK not to know.

I don’t mean telling someone “I don’t know, go away and leave me alone”, but I certainly don’t expect everyone to know everything. Sometimes you need to go and investigate, check some commit logs, or read some blog posts. Sometimes you need to dig out a debugger or a profiler and investigate, and sometimes, you’re not the right person to ask.

If you don’t know, say so, it will give you time to find out, or an opportunity to set up a task for yourself or someone else. There’s no shame in not knowing. The things we don’t know are the things we’ve yet to learn, the things that inspire us to keep going (and if they don’t, are you really a developer?)

So, don’t be afraid to say you don’t know, so long as you know what you’re going to say next.

Leave a Comment

Commenting

This is a programming blog, but I hope you’ll forgive one meta post on New Year’s Day, especially as it came from a thought in last month’s BCS magazine.

The Blogs most likely to get comments are the controversial, or plain Troll posts, where people comment to disagree. It is much harder to inspire someone to comment to agree with you than to disagree. I’m not going to try and change that, but I will point out some recent additions to my posts : you can now like on WordPress or Facebook, and you can retweet. So if you see a post you like, here or elsewhere, please spread the word. Positive posts and useful information should get more attention.

I’ll do my best to keep sharing the good information on Twitter, delicious (which I hope will survive), and on this blog.

So, is anyone reading Blogs or rss feeds today?

Leave a Comment

Visual Studio multi-line search and replace

A regular expression to find all files where <body> appears after <head> :

\<head.*(.*\n)*.*\<body

Leave a Comment

MonoTouch Error – Missing UIKit.h

From Ben Hall (via Google Reader) – Using Mono to write an iPhone app. Hopefully the first of many posts.

MonoTouch Error – Missing UIKit.h: “MonoTouch Error.pngIf you haven’t heard about MonoTouch, then you need to be on twitter. MonoTouch allows you to write iPhone applications using C#! It’s in early, private, beta at the moment but it is very cool with huge amounts of potential.

However, on my first attempt to compile an application I received the following error:

‘uikit.h no such file or directory’

UIKit.h is one of the iPhone SDK files. I knew I had the iPhone SDK installed, however it turns out I didn’t have the 3.0 SDK! After installing the latest version, the application compiled without a problem. A note of the future in-case you hit the same error.

UPDATE: Sorry about edits, I was playing around with MarsEdit and the formatting.

Leave a Comment

Older Posts »
Follow

Get every new post delivered to your Inbox.

Join 937 other followers