Technological Musings

Thoughts of a technology enthusiast

NY Times shares their Coding Style Guide for iOS

If you’re developing iOS apps, and are looking for a coding style guide, I suspect this won’t be a bad place to start.

New version of Android has been Named

Kit Kat. With Nestle backing and everything.

Here’s the site: for the promotion site, and then a link that’s more obviously Android

Detailed information on Java 8

TechEmpower has posted a summary of expected changes in Java 8. So many of these features are long overdue, but I still be very thankful for them. Here’s a very short list of the highlights. If you develop in Java, check out the list, and let’s hope Java 8 actually ships in March 2014, and with all these features.

  • Interfaces can define static methods, and default methods.
  • Lambdas.
  • Better type inferencing.
  • Proper time library
  • Some functional additions to Collections
  • Concurrency additions
  • Annotations allowed in more places

Developer Productivity is not easily Measured

Martin Fowler has just published a post discussing this topic.

He makes several good points about the fact that people have been trying to measure software productivity for a very long time. The first attempts were lines of code, but of course we all know the fallacies of that. In fact, we now believe that fewer lines of code is better than more lines of code.

Another attempt at productivity is function points. Again, just like lines of code, this can be very misleading. If a developer duplicates lots of code, they will have many function points, but I think we all agree that their code is not better.

At the end of the day, the only measure of productivity should be business value. It doesn’t matter how many lines of code I produce or how many function points or anything else, it all comes down to business value in the end. Once you know the business value, then you may start to evaluate the productivity of a developer. And again, even this is hard. Most developers work in teams, and therefore it is difficult to assess the productivity of a single developer.

Many managers complain that if they can’t measure it, they can’t manage it. Martin calls this a cop out. Businesses manage things they can’t really measure all the time. Company lawyers, marketing department, educational institutions. And yet they still figure out a way to manage these.

Martin also references an article written by the Economist that assessed productivity increases in business due to computer investments in the 90s. The article was written in 2003, and it wasn’t until then businesses were seeing the benefits of investments they made in the 90s. So not only is it difficult to measure the productivity, but there is a huge lag on seeing the returns.

I agree with Martin’s conclusion that we need to admit our ignorance here. It’s very difficult to measure our productivity, so therefore it makes selling our services that much harder.

And here’s another post that covers a very similar topic. The author has been asked to measure development many many times. He has tried various measures, but none of them have worked. His conclusion is similar to Martin’s and mine, you just can’t effectively measure software development.

Be a Do-Leader

A great video of Scott Hanselman’s presentation at Webstock ‘12. It’s all about getting things done by getting rid of those things we do that aren’t important. Well worth watching.

I particularly liked his analogy of the refresh action on Twitter being like a rat in a cage with a bar to pull. When the bar is pulled, it would cause an electrical impulse to be sent to the pleasure centre of the rat.

He likened this to the pull and release action on Twitter to do a refresh. I’m feeling low/bored/…, so do the pull and release to get more pleasure from Twitter. This could also be applied to Facebook/LinkedIn/Google+/Email/any other thing that isn’t truly productive.

Providing Incentives That Work Is Very Hard

Here’s a great story of an economics professor wanting to provide incentives for his children to help them with potty training. Even at that age, the children figured out how to game the system.

The conclusion of the author is that rather than trying to control behaviour through external incentives, get the people to actually care about what you want them to do. Explain the importance and value, get rid of the disincentives and barriers, and watch them get it done.

This is very well summarized by this quote

“If you tell people where to go, but not how to get there, you’ll be amazed at the results.

George S. Patton “

Speech Recognition Software

Here’s a very interesting video by a developer that had such severe RSI that he couldn’t type anymore. He had 2 choices. Either give up typing (which of course would have meant a career change), or find an alternative to typing.

Obviously, like any dedicated programmer, he chose the latter, and started using voice recognition software. The first thing he realized was that the existing software is aimed more at dictating notes, and not at programming. Can you imagine saying ‘public void s-e-t-N-a-m-e-(String name) { (where the dash is a pause because the speech recognition wouldn’t know what to do with setName).

Using Speaking Naturally and Dragonfly, he was able to provide custom words to control what he wants to do. Very impressive, and worth watching at least some of the video. As the linked article states, the demo starts about 9 minutes in.

As a result of this, I’ve been doing some experimentation with Speech Recognition. Starting with Vista, Speech Recognition has been built into Windows. It was also available as an add-on for XP. Out of the box, it’s actually quite good. Again, not for programming, but for dictating notes and emails, it works surprisingly well. I’ve only been using it with either the built in mic on my laptop, or the mic in my webcam for my desktop computer, so I suspect that’s contributed to some disappointing results. I intend to get a proper headset and see how well it works.

Speech Recognition not only recognizes words, but allows one to control the computer. ‘open idea’ will open IntelliJ IDEA on my computer. ‘open sublime’ will open sublime text. ‘Press ctrl-shift-L’ will do just that. ‘show chrome’, ‘close’, and several other commands also work. You can even say ‘show numbers’, and it will put numbers on all items that can be clicked. You can then say the number, it will highlight it, and if it’s correct, saying ‘ok’ will perform the click. Needless to say, I’m impressed with how much is there, and how well it actually seems to be working.

Here’s a link to the reference manual.

Doing some googling, it would appear the Mac used to have something like this, but now all it appears to have is dictation. And even then, this feature isn’t all that useful. You can say up to 30 seconds of text, and then you have to wait for it to round trip to Apple. So, not only do you need an internet connection, but all your speech gets sent to Apple.

Nuance continues to develop Dragon Speech Recognition software. The two entry levels available for Windows don’t appear to offer much more than what Windows Speech Recognition offers. In order to get full customization of both template text as well as commands, you have to move to Dragon Pro. Now you’re talking $600 for the software. Of course, one can use Dragonfly with Windows Speech Recognition or with Dragon as the developer did in the video. I may investigate that as well.

There’s currently only one version of Dragon available on the Mac. It looks like it supports custom commands/actions via AppleScript, so that would mean it can do most of what the Pro version on Windows can do, but at the $200 price mark. I guess there aren’t that many people on Mac looking for Speech recognition.

As I have to be careful how much typing I do, or at least be very careful about my setup, being able to avoid typing some of the time would be very beneficial. Expect to see ongoing reports as I continue to try out various things. I think my next purchase will be a proper headset so that I’m giving the software the best chance of working.

My main concerns are background noise. How well will it work in the average office environment, and how quietly can I speak and still have it work. I’m sure people around me don’t want to hear all of my emails and notes being read to them.

Versioning Software using Maven Versions plugin

I’ve had some experience with the Release plugin, but because of the number of times it commits to the repo, it cannot be used for Continuous Delivery.

Here’s an article that describes a workflow using the Versions plugin. It also leverages the fact that generally speaking, cloning a repo using a DVCS is quite fast, and much faster than it was using SVN. It also focused on reducing the number of steps. Basically, it does 1 clean/compile/test cycle, and doesn’t do any commits to the SCM. It merely tags the changeset in the repo.

To summarize. Clone the repo, use versions to set the version. clean/compile/test/deploy. Tag in SCM.

The changes to the pom don’t get committed to the SCM, but because of the tag, it’s easy to know which changeset was the build.

This will work fine with Git, but because of the way Mercurial does tagging, this will not work. A tag also requires a new changeset, which would trigger a build, which would…

Also note that the Versions plugin supports many other things relating to versions both of the project and of dependencies.

Developing an Android app using the new Android Studio

I’ve started developing an Android app using the new Android Studio. It is based on InteliJ IDEA and therefore very good for editing java code, but as it’s beta software, still has some rough edges.

I created a blank sample app several times, would start making changes (I was working through the First App tutorial), and then manage to break things. They would stop compiling, or the compiler couldn’t find resource definitions, even though they were still there.

I’ve discovered a few of the things I did wrong, and figured I document them both for my own future benefit, and the benefit of others.

When Android studio creates a project, one of the files that it creates is called This file indicates where the Andoird SDK is located, but is machine specific. The file itself states not to change it as it will be generated and modified by Android Studio. It also states that it should not be put into Version Control.

So, I obliged, and didn’t commit it. When I’d clone this repo on another machine, it would not be able to compile. I was using import project and perhaps that’s the problem (I never commit IDE related files into version control).

Regardless, the best way I’ve found to handle this is to define the environment variable ANDROID_HOME instead, and delete the file. This seems to work consistently for me.

The other big mistake I made was using the ‘exclude directory’ option on the build directory. If you don’t do this, the generated R file, as well as others keeps appearing in the open dialogs. I should never need to look at it, so I wanted it removed from my list.

The problem is if you exclude the folder, it appears IDEA then doesn’t look in it for the R file at compile time, and can’t compile your code. Spent quite awhile before I figured that one out. Bottom line. Don’t exclude the build folder.

The designer seems quite good, and the interaction overall works well. Not bad for a Beta piece of software.

I’ve also discovered a helpful site for quickly generating the various qualities of images required for Android development. It’s not going to be as accurate as hand crafting the various resolutions, but for getting started, it’s extremely helpful. Android Asset Studio.

Is a Product Backlog Useful?

An interesting post about Product Backlogs, and how, if not properly controlled, they can very quickly get out of hand. The author has a list of 7 negatives that can result from a poorly managed Backlog.

We’ve all seen it. A backlog that identifies all the features a product will have in order to go live, as well as all the various requests other parties have added. They get estimated and re-prioritized all the time. Hidden dependencies creep in, and delays start to occur. Next thing you know, the backlog is an impediment itself.

The author suggests that the backlog should have very little, if anything in it. If a feature is important, the Product Owner will remember it. If it isn’t, it will get forgotten. No more wasting time estimating and reorganizing unnecessary features.

This also allows for a quick refocusing at any point in time, and also for innovative thinking. If items are put into the Back log too early, they often get over defined, and the solution gets embedded in the requirement statement.

Definitely things to keep in mind when running a team.