Archive for the ‘Software Development’ Category

Lot’s of Static

Wednesday, January 4th, 2012

I’ve been using WordPress for a few years now as the software “engine” behind my blog. When I’ve aided others in blog creation, I’ve generally pointed or assisted them along a similar route. Recently, a trend among nerd / developer literati is a move to static generated web sites with no active backend database and software generating the web pages on the fly (i.e. WordPress). The benefits (and deficits) are legion, but the adventure itself is the most intriguing — so I’ve started tinkering with my own static site generation application. These (apps) are pretty much a dime a dozen these days, but what they generally lack is a polished fronted UI accessible via both Mac and iOS platforms that is user friendly and useable by non-developers. Finally, a good pet project for me to work on!

As part of the transition, this website will probably be looking a bit different in the near future. I’m also leaning toward ditching comments. I don’t think this is a great travesty as 1) very, very few people actually read my blog — especially when I average about two posts a year) and 2) those very few probably have other great ways to share their thoughts. Also, I’m hoping this project will reinvigorate my desire to post some useful thoughts here!

Yes. We want native apps.

Sunday, January 16th, 2011

I could probably blog a post a day about my disdain for web apps, cross-platform apps, and any other lowest common denominator computing experience. I refrain due to the fact that I wouldn’t want to bore the living crap out of my dad, my brother and the one or two other people who read my blog on occasion. Even so, I have made my feelings known on a few occasions, although usually a bit tangentially:

Alex Payne has penned a very cogent work on yet another user-experience failure of the mythical first-class cross-platform toolkit / language. I love this comparison:

Imagine a new restaurant that wants to make the most of their burgeoning lunch traffic. They start serving low-quality meat: after all, it’s cheap, plentiful, and requires nothing more than placing a different order with their distributor. For a few weeks, profits are up. But pretty soon, so are customer complaints, and the stars on their Yelp page are rapidly dwindling. The owner doesn’t understand. The meat isn’t great, sure, but it’s perfectly edible, and for a while it seemed like the restaurant was making more money and attracting new customers. What went wrong?

Of course, no matter how times IT departments and businesses flaunt the idea that the Web or Flash or cross-platform widget toolkit is “good enough”, the fact of the matter is:

Do People Really Want Native Apps?

Yes.

Pure Heart, Clean Code – Part 2

Thursday, November 25th, 2010

A few months back, I gave a short tutorial on how to integrate a code formatter / beautifier (uncrustify) into Xcode 3. Unfortunately (or fortunately), an alpha variant of an all new and improved Xcode 4 is available to members of the ADC. In an attempt to not break any NDAs, I’ll try to document this method in a generic way. Fortunately, it requires no configuration within Xcode 4 itself.

Interestingly, the method I’m about to discuss is also valid in Xcode 3, but not as efficient as the method I described in the previous article, as it doesn’t allow for a full document “cleansing” in place (one must select the code to be cleansed first). Before Xcode 4 finds its way to a final release, I imagine we’ll have many other options available to us – including one that will allow us to fully replicate the previous functionality.

Automator Template Selection

The gist of the following method is to use an Automator script that calls uncrustify and attach it to Xcode as Service that shows up in the Services menu. Tony Arnold has created three Automator workflows to provide similar functionality. I really don’t like how all of them work – purely due to the limitations of the method used. For example, Tony’s Uncrustify Current Document mimics the original functionality from my initial article but instead of processing the document live, processes the underlying file, causing some odd state in Xcode and a fairly unpleasant user experience. Therefore, I’ll just discuss how to create the Uncrustify Selected Text variant. If you want, you can just bypass the next paragraph and use Tony’s version, but come back afterwards because I have one more additional tip.

I’ve never really used the Automator before. It’s actually pretty slick. First, open Automator and choose to create a new Service template. This will create a new Services based workflow. You will select text and Xcode as the parameters to the new service workflow. You will drag one Action, Run Shell Script and enter the following as the script:

/usr/local/bin/uncrustify -q -c ~/uncrustify.cfg -l oc

The astute notice this is pretty much the same from the previous article. Save your new workflow to ~/Library/Services/ as Uncrustify Selected Text. Now, when running Xcode, a new option will become available in the Services menu when text is selected in the Xcode editor, allowing you to uncrustify your selection.

Automator Action

Oh, almost forgot the added bonus tip. Previously, we assigned a keyboard shortcut to the uncrustify task. There isn’t a direct method in Automator to assign a shortcut, but we can add it in System Preferences > Keyboard under Keyboard Shortcuts. Select Application Shortcuts and add a shortcut, selecting Xcode as the Application and Uncrustify Selected Text as the Menu Title. Pick your favorite keyboard shortcut, and you’re ready to go!

Microsoft and the End of Cross-Platform Application Frameworks (again)

Sunday, October 31st, 2010

Microsoft discussed strategy a bit this week at PDC. One of the more interesting themes was a shift in development platform strategies with a focus on HTML5 as the cross-platform methodology of choice and a relegation of Silverlight as the application platform for Windows Phone 7.

I see this not so much as an acceptance of the failure of Silverlight over Flash as the failure of Silverlight / Flash as a cross-platform hybrid platform – I think Apple has won (with HTML5) and Microsoft knows it. I’m not even sure that Microsoft is really that sad about it – they were worried about Flash for the same reasons Apple was. As has been twittered a good deal as of late, did we not learn anything from the complete failure of cross-platform application frameworks in the 90s (particularly Java on the client)? Cross-platform application frameworks are only good for the tools vendors and consultants – not for developers or the consumers. I’ll defend that statement in another blog entry, but I feel like I’ve probably already done that two or three times already in past entries.

HTML5 & the web is the Microsoft answer to cross-platform (funnily enough, it’s Apple’s answer as well) – a market they (nor Apple) could really care less about in the relative scheme of things – it doesn’t directly help their OS or their applications. It’s just a minimum requirement that must be met to have a viable OS. Silverlight (and it’s underlying WPF/.NET underpinnings) is going to be the native app platform for the Windows Phone and likely every other MS platform before it’s over with – which is probably pretty smart – it’s a good platform.

Supporting HTML5 and the web is only required to provide support for the lowest common denominator platform. Innovation isn’t going to take place in the lowest common denominator – it’s going to occur in the targeted platform space with native applications that take full advantage of the underlying platform. Otherwise, you could just give us all Chrome and be done with it, and as I have stated often before, common denominator cross-platform solutions breed mediocre user experiences and commoditize the entire computing experience into a bland, boring space.

Yearly Pilgrimage

Sunday, July 4th, 2010

Another year, another WWDC. I generally blog after every WWDC, and this year I’m a bit behind. Honestly, I’ve been torn between watching all the WWDC video sessions and taking care of the house of woe (my whole house has been sick or demobilized for one reason or another for three weeks – including wife, both kids, and one of the two dogs).

Overall, this was the best WWDC for me yet — although this one was a bit different than past years. First, I realized, this was my 5th WWDC. That’s a bit mind boggling to me actually. It just seems like yesterday I started tinkering with Objective-C and Cocoa and cursing the bizarre syntax filled with brackets. It took at least a year I guess before I fell in love with the expressiveness and self-documentation of Objective-C, to the point where I prefer it now much more than anything else I have to deal with.

Rich standing in front of 1 Infinite Loop sign in Cupertino

Probably the more significant difference from previous years was the near total focus on the newly coined, iOS platform – all things iPhone and iPad (and probably more in the near future). Whereas most of my opportunities at my day job and even in my free time were focused on Mac OS X projects, the last year has slowly seen my desire to play more with the iPhoneOS rise. The release of the iPad has pushed me over the edge (although the iPad pushed me over like a Mack truck hitting me at 100mph). I have no doubt that the iPad is revolutionary to mainstream computing – much of which can be credited to iOS, and to the applications being developed in Objective-C and Cocoa. So, the timing of this years totalitarian focus on iOS caught me at the perfect peak of my interest.

The sessions this year felt very well focused, well organized, and much more helpful than years past. Not that the quality was poor before – I just think the solitary focus greatly increased the cohesiveness and content of the sessions. Better yet, these sessions have been made available within 3 weeks to practically everyone for FREE (versus past years where they cost non-attendees $500+ and generally took multiple-months to release). This is truly awesome. You can’t see everything at WWDC – this year even more so than in the past. Often, the videos are so delayed, their timeliness has passed and they’ve already gone a bit stale. Not so this year. I’ve been filling all my spare time obsessively watching these things – including the sessions I had already attended. They also look great on the iPad.

As far as aprés sessions, I did a couple things different this year. First, I took the pilgrimage to mecca and visited Apple headquarters on Sunday. A couple folks (Jeff LaMarche and Scott Knaster I believe) graciously organized a chartered bus from Moscone down to Cupertino for a small fee. Amazingly, I’ve never been to Apple HQ, and I really enjoyed the opportunity to set foot at Infinite Loop and talk with a bunch of great folks on the way there and back.

Of course, Tommy’s was excellent as usual (I went twice). And I definitely like Anejo better than Reposado (which I guess makes sense). Wholly different this year, I generally avoided the crowded parties and opted for dinners and drinks and such with smaller groups.

The yearly Stump the Experts was excellent as usual, minus some commentary that it might be the last year for the even. I certainly hope not — this would be a travesty and also eradicate one of the last vestiges of history and homage to the Mac, and everything that has come before. Not to mention, it’s just plain fun. In “honor” of my experience a couple years back, I got introduced to the crowd at the start of the show again and given free goodies. It keeps my Stump t-shirt streak alive at three!

For those who weren’t able to attend this year due to the sellout, please make sure to buy your ticket on the 2nd day after they go on sale to insure getting a ticket (2nd day – since I’ll be ordering mine on the first day and I don’t want to take any chances!)

Pure Heart, Clean Code

Tuesday, April 13th, 2010

A month or two ago while processing through a lot of old code, particularly a lot that I didn’t originally write (or at least I’m claiming I didn’t write), it dawned on me how pleasant a world it would be if I could quickly reformat the code – to make the code bend to my will… curly braces on their own line as God intended them… whitespaces where they belonged, and not where they aren’t, etc. So, the adventure began.

From many years with other languages and editors and IDEs, the concept that this would not only be missing from Xcode, but somewhat difficult to obtain was a bit foreign. Nonetheless, with a bit of Internet research, an external tool called Uncrustify, and some experimenting, I coerced Xcode to do my bidding. Oh, before I get started – the Edit->Format->Re-Indent option in Xcode is worthless, so we’ll just ignore it for this outing.

To note, I tinkered with multiple external formatters and the weak internal xcode formatter before I finally settled with uncrustify. Uncrustify has fairly good Objective-C support, can easily be integrated with xcode as a user script, and provides a centralized formatter for pretty much all languages that xcode natively supports.

First stop, acquire Uncrustify. I built mine from source, but if you want an easier route, it can easily be installed by using MacPorts.

Edit User Scripts in Xcode

Once you’ve verified that you have a functional version of uncrustify (uncrustify –version at the terminal command prompt should do the trick – I’m currently using 0.55), the next step is to integrate uncrustify’s usage into Xcode. We need to add a custom script, so open up Xcode, head to the Scripts menu (look for the funky little scroll-like icon) and choose Open Scripts Folder. We need to create a new script with the following:


#!/bin/sh
echo -n "%%%{PBXSelection}%%%"
/usr/local/bin/uncrustify -q -c ~/uncrustify.cfg -l oc+
echo -n "%%%{PBXSelection}%%%"

Input will be Entire Document. Directory will be Selection. Output will be Replace Document Contents. Errors will be Merge with Script Output. I set this script to have a key combination action of Shift-Command-P (P for Pretty).

The only thing left to do is to configure uncrustify to format our code in the specific dialect of style that we prefer. This task is actually quite a bit more difficult than expected. Uncrustify uses a very simple but daunting configuration file. My recommendation, take one of the supplied sample configs (ben2.cfg is very good), merge in the objc.cfg sample, and tweak as necessary. Once you’re done, place the configuration file where specified in your script (above, I used ~/uncrustify.cfg). For those interested, I’ve attached my uncrustify.cfg. I’m still tweaking it here and there, so it’s definitely a work in progress, but it does the job for the most part.

Now, any time my cursor is an editor, a simple Shift-Command-P will reformat my code quickly and to my liking. I find myself now often typing code very hastily without regards to style and formatting and following up with a Shift-Command-P to make it nice and readable.

Hypocritical Rancor

Sunday, April 11th, 2010

The last week has seen quite the bristling of a hypocritical and vociferous group of “developers” and technical pundits. The best recapping of this whole situation can be found at John Gruber’s blog: initial discovery and assessment. The two loudest crowds seem to be the Adobe Flash fans and the C# Mono folks.

Let’s just leave the actual “rule” from Apple aside for a moment and just speak from a user experience perspective.

First, let’s talk performance… The fact that you can make a good performing app with an intermediary language certainly isn’t proof that it isn’t much more likely to have a performant application that is written in a more native language. I mean, if hardware had not gotten faster, we would all be programming in assembly (or C). Abstractions are great for developers but not great for machines. There is a reason Java and C# haven’t taken over the desktop or game development – and the examples that can be given of the few sparse games in those two languages / platforms doesn’t change the fact that other than casual web games and a few Xbox toys, they aren’t used seriously by professional game studios. With mobile platforms, the hardware is going in the opposite direction from desktop hardware. Not to mention, I’m curious about the incongruities of a cross-compiler from a managed memory model to one that isn’t, but hey – maybe they’ve figured it out.

As for user experience, Gruber nailed it. The Kindle application is a very good example of the problem with many cross-platform libraries…. I’ve never seen an application for the Mac written in a language / library other than Objective-C / Cocoa that felt right – and that includes applications written in the Apple approved C / Carbon libraries (which are slowly being deprecated)… If MonoTouch is that good at traversing the paradigms between .NET and Cocoa, that’s damn impressive, but I don’t believe it… The problem is, that on every other platform, interface incongruities are just the norm – expected, so cross-platform libraries are not abhorred as greatly – the users aren’t as discerning. On the Mac and it’s derivatives, consistency of behavior and user experience are tightly defined. I haven’t seen people getting up in arms about the HIG (human interface guidelines). Did you know that you can be rejected from the app store from not complying with the HIG? Now, most would say that’s just more Apple restrictive behavior, but it’s not – it’s protecting the user experience and the platform. Obviously, most didn’t see the HIG requirements as offensive though, although these new requirements are truly enforcing the same thing.

Again, languages and frameworks are not difficult for any experienced developer to pick up. For most programmers, the basics of Objective-C and Cocoa can easily be picked up in days… proficiency can be attained in a couple weeks. Once proficient, why would you choose the targeted platform over another? .NET is a bit a richer than Cocoa, but certainly not worth forsaking the native platform, the tools, the documentation, etc. provided? Flash has no real benefits for a traditionally trained programmer.

As an aside, I think Mono outside of Novell is pretty much dead anyway. I can’t imagine it will ever make major inroads outside of certain niches – folks who need to develop for Linux but have a lot of .NET experience. Many couldn’t be doing Mono right now if they weren’t also Novell partners. Microsoft’s threats have gone a long way in making corporate lawyers nervous, and it’s only through the negotiated protections offered by the Novell / Microsoft partnership that have allowed some to move forward.

As much as everyone has belabored this iPhone OS issue, the rancor towards Microsoft and their general destruction of C# and .NET has never reached similar fervor. The real reason Microsoft has stifled these technologies is often applied to Apple – an anti-competitive bent of protectionism. I don’t deny – I’m sure there is a significant element of this in Apple’s intentions as well – but at least they have a pretty good logical and conceivably more benevolent reason as well.

Even Icaza said it:

“The most important part is that Microsoft has shot the .NET ecosystem in the foot because of the constant thread of patent infringement that they have cast on the ecosystem. Unlike the Java world that is blossoming with dozens of vibrant Java virtual machine implementations, the .NET world has suffered by this meme spread by Ballmer that they would come after people that do not license patents from them.”

Of course, Google is our angel – savior from the capitalistic bastards facing us in Cupertino and Redmond. If anyone thinks Google is any more noble and less evil, keep dreaming. Why aren’t they releasing all their new apps for platforms other than Android? Why did they buy AdMobile (which they knew would be a problem with the SEC) in a move to block Apple from acquiring it? To think that Google is any different is naiveté at its extreme.

In the end, I would rather the new iPhone/iPad platform be more open – or at least have more than one pathway to sale and deployment. But, the raucous rancor and fervor exhibited over the last week is nothing but hypocrisy. Bitter hypocrisy…

Will Work for Food

Monday, August 31st, 2009

Indie Mac developer Manton Reece has it right. This was exactly the motivation I needed to stop procrastinating and twiddling away my time that should have been dedicated to more productive pursuits. Time to fire up Xcode.

Apple Arrogance

Friday, July 17th, 2009

I really like Apple products – particularly their OS (be it for the Mac or the iPhone). I’ve never been particularly fond of Apple the company – primarily due to their apparent indifference to developers and even customers – an almost elite aloofness that states, we’re better than you, our products are superior – you’ll do it our way or you can go elsewhere. Often, it’s worked – at least over the last half-dozen years or so – because their products really are that good.

Unfortunately, I think this attitude has hindered broader acceptance and success. I’ve blogged before about Apple’s abysmal customer support, maintenance and repair policies – or lack of them (see previous rant). Limiting customers to a single avenue of hardware repair that can take days and weeks, including long waits at a retail store, is just reprehensible – especially if you expect to sell to businesses.

The iPhone app store is another good example of this arrogance. Marco Arment at Marco.org has an excellent blog post about Apple’s indifference to the issues developers are currently facing.

This arrogance and disregard for customers and developers will lead to Apple’s downfall if not corrected. It may be slow. It may be years. But it will happen. You can’t treat your partners and your customers this way forever – even with superior products.

A few more seconds…

Wednesday, June 10th, 2009

Last year at WWDC I had a near out of body experience. I related most of that here. To recap, I used some software that I work with at my day job (Landmark Digital Services) that I had shoehorned into an iPhone to identify a number of songs at an event at the Apple WWDC conference. To this day, I still consider it my 15 seconds of fame. I even have the audio someone in the audience captured of the event. A few months later, everyone with an iPhone would have access to this technology via the Shazam iPhone application (Shazam is a licensee of the Landmark Digital BlueArrow technology).

This year at WWDC, I was once again looking forward to Stump the Experts – the event that gave me my 15 seconds. I wasn’t planning on trying to identify any music this year. Everyone has the technology now, and I knew that if Fred Huxham and Mark “The Red” Harlan – the masterminds of this event were going to continue with the music identification tradition, it wouldn’t be recognizable by any published methods. I had my time in the sun. I was looking forward to meeting Mark again after his comments on this blog about the event last year. He even promised me a copy of his book on Texas Hold’em (which I’ll be reading on the plane ride back home).

I was a bit taken aback when at the beginning of Stump this year, I was invited onto the stage to sit with Apple Experts in front of a couple thousand people where the previous years events were retold and I was congratulated for “breaking” a part of the Stump. It was an amazing honor, and I thank Fred and Mark for extending my 15 seconds for a few more.

It amazes me how many times I’ve overheard people at the conference this year retelling the story of “that guy at the Stump”. Now that I spend more of my time managing developers and working with finance and business development, I have little opportunity to extend my geek cred with programming projects. Sure glad that I spent some of my spare time on that little skunkworks development project – it has definitely paid back in spades. It also reminds me why I started programming computers back on an Atari 800XL some thirty odd years ago – the thrill of creation and seeing a piece of code deliver its magic…

NOTE: If you happen to have any photos of the beginning of Stump this year, please let me know. I really would like to have a photograph of myself up on the stage!

Bunches of Books

Thursday, February 5th, 2009

In my new WoW-clean state, I’ve been slurping up books right and left. Years ago, before the distractions of WoW and babies and such, I tried to read at least one if not a couple technical books a month. This was a fairly expensive (but necessary) proposition at nearly $50 a pop. I also reviewed development books for a couple companies — usually one every other month (which I got paid for – helping to offset the cost of my monthly book purchases). Of course, six months later a new edition would come out or the book would become stale, often earning it a trip to Goodwill. After skipping the technical reading ritual for a couple years, I think I’m getting back into the groove.

(more…)

The Toolbox: rsync

Sunday, November 2nd, 2008

So, if your computer had a toolbox, rsync would probably be the screwdriver – one of the most frequently used and powerful tools in the box. Its use on the Mac doesn’t come without a few caveats, so I figured it would be useful to send out some very important information about its usage on a Mac to my staff – not all of which are Mac folks. After sending it, I thought it might be useful to others, so here it is…
(more…)