How I Enjoyed the Rock Paper Azure Competition

Rock Paper AzureIn mid-December, I saw an ad on StackOverflow.com and was immediately intrigued. “Rock, Paper, Azure!” was a contest run by Microsoft wherein programmers design bots to compete in a modified game of Rock, Paper, Scissors. The bots had to be hosted in Microsoft’s cloud computing platform, Azure, so you can easily see Microsoft’s motivation to give away some small prizes to influence developers into trying and (hopefully) adopting Azure.

Although I had plenty of things to keep me busy leading up to Christmas, the Rock, Paper, Azure marketing worked on me. I figured I could take 1 or 2 hours out of my time and write the best algorithm I could in that time. Besides, I would be entered into the grand-prize contest drawing just for competing with even the most simple of bots.

Bugs LanguageI was immediately reminded of a school project from an early Computer Science course at Ohio State. The contest back then pitted “bug bots” from teams of students in the course against each other. Each team started out with a handful of bugs on a large virtual checker board. A bug could “convert” another student’s bug by facing it and issuing the “bite” command. The bitten bug would then become a member of the “biting” bug’s army. The game continues until one team has converted all bugs. If I remember correctly, there were only a few possible commands:

  • “Detect” if an object (like a wall or another bug) was in front of it
  • “Move” forward 1 square
  • “Rotate” left or right
  • “Bite”

 

It may have evolved since then, but our bot did surprisingly well back then despite a very simple algorithm:

  1. If something in front, turn left, bite.
  2. Else, move forward, bite.
  3. Repeat Step 1.

 

I’ve often wondered what additional strategy I would write into my bot if given another opportunity in such a competition. Rock, Paper, Azure was the challenge I was looking for.

Microsoft’s version of “roshambo” came with a few twists, such as the introduction of the dynamite and water balloon moves. Check out all the details and rules here. I liked that it was a simple game but with competition against other developers’ bots came many options for creative strategy. Additionally, I was extremely impressed with how simple it was to build the basic bot.

Game Rule Highlights:

  • Bots compete each other throwing one of Rock, Paper, Scissors, Dynamite, or Water Balloon
  • Normal rules apply except that the Dynamite beats everything but Water Balloon and Water Balloon loses to everything but Dynamite
  • Each bot only gets to use Dynamite 100 times
  • First bot to win 1000 times wins the entire match
  • Ties carry over, so the next round could be worth more than 1 win (similar to “Skins” in golf)

 

It took me some iteration to come up with my eventual strategy, which turned out to be admittedly mediocre (98th place out of 162). I realized that my bot can keep track of the history of moves that it has made as well as the moves of my opponent. My plan was to try and detect if my opponent was falling into a sort of pattern. I was especially concerned about the end of the round when we both would be desperately throwing dynamite to close out the match. As you can see, my strategy only had a small amount of success.

Nonetheless, I thoroughly enjoyed my time creating and deploying my bot. I encourage Microsoft to search for more clever ways to get developers interested in learning and using their development platforms. In this contest, I got to expand my mind, learn more about Azure, and I even got a free t-shirt. Here’s to the next competition!

Advertisements

3 Silverlight Architecture Tips with Brad Himelstein

Recently, I dove back into XAML-based development to create some Silverlight plugins for a large web application. Most of my experience in XAML came from writing a WPF application from 2008 to 2009, so I had much to learn about the asynchronous data retrieval paradigm used in Silverlight. I had questions about UI Design Patterns, Service-Oriented Architecture (SOA), and how to reuse class libraries, so I asked Brad Himelstein, from CinCom, if I could pick his brain while we hit a few golf balls. Brad has continued working with Silverlight and WPF for a few years, since we worked together on the aforementioned WPF application.

Below is a summary of his tips as well as some quotes from our conversation.

 

Tip #1: Use Model View ViewModel (MVVM)

Me: “Do you ever use any sort of patterns for the UI?”

Brad: “MVVM

Me: “I am just now getting introduced to that. What are the benefits?”

Brad: “It is great, because you just setup the data context and do all your databinding, and it just magically works. Two-way binding works as well.”

 

Brad identified additional benefits during other parts of the conversation. MVVM’s primary purpose is to separate the concern of the behavior of an application from that of the user-interface design. It is a practical implementation that is cleaner to understand and easier to pass back and forth between designers and developers versus the default approach of placing logic in code-behind files. He provides sample MVVM source code here.

 

Tip #2 Extend Proxy Classes with Shared Custom Code

In my application, I use WCF RIA Services to query server objects and return them to the Silverlight client. This technique simplifies the process of retrieving service data and populating local objects because a local proxy object is created and populated automatically. In Brad’s words, “If the web service returns an object of class ‘Foo’, we don’t need to redefine ‘Foo’ in the Silverlight app.”

Unfortunately, I had a great deal of logic included with the retrieved classes that I also wanted to be able to use in the client. I asked Brad how to elegantly work around this limitation of Service-Oriented Architecture.

Me: “What I was hoping to get with RIA Services was, say I’ve got some class I’m returning from the service. I can load it with data easily but I have additional calculation properties on this class, such as FullName, which is just a property that returns FirstName and LastName concatenated. A local proxy object is created automatically for use in Silverlight, with data populated for FirstName and LastName, but the proxy does not retain calculation logic. Since I have a server-side object that has calculation properties defined, how can I share that code for use with the Silverlight client and the proxy object?”

Brad: “If you know you’re going to use FullName, then just create another string called FullName and set the property on the server so it is passed down to the client in the object, because it is not going to take those calculated properties and bring them down.”

Me: “But then that FullName would have a state when it returns.”

Brad: “Remember, you can extend everything. So on the client side, you can alternatively have your own Foo class, which can be used to extend the partial Foo class that is returned from the server.”

Brad’s suggestion was enough to help me come to a solution that fit my needs.

 

Partial Class Extensions

Let’s use the sample Class “User” to continue our example from above. In such a class, I can place fields of the User, such as FirstName and LastName in one file named User.cs. User class should be defined as a partial class, so we can combine definitions of the class from 2 separate files. Hence, in another file, named UserCalcs.cs, we should define calculated properties, such as FullName. At this point, the server behavior will work as it always would have if we had just implemented all properties and fields in the one file. However, the Silverlight client would not yet know about the FullName property.

 

Shared Files

An important limitation of Silverlight is that it can only reference projects that are compiled as Silverlight projects. In other words, Silverlight cannot natively reuse definitions from standard .NET class libraries. What it can do is recompile normal .cs files into a Silverlight assembly.

To do this, right-click on the Silverlight project in your Visual Studio solution and click Add Existing Item. Navigate to the file that contains the calculated properties, UserCalcs.cs. Click the file, and then click the down arrow next to the Add button. Choose Add As Link.

The Silverlight project will now compile this partial class definition. It will extend the proxy class as well as the server side class from the same file. Therefore, maintenance of those calculated properties can be shared between the client and the server side code from one file.

 

Tip #3 Learn HTML 5

Ok, Brad didn’t actually say this so bluntly, but it was a recurring theme of our discussion. Based on recent information about upcoming Windows (8) releases, Silverlight’s future is unclear. From what I have heard, Microsoft is committed to version 5 of Silverlight (current release is 4) but has made no guarantees beyond that. Windows 8 will have 2 versions of its Internet Explorer 10 browser: tablet and desktop. The tablet version will not allow plugins, like Flash and Silverlight. Some have summarized the decision by stating that from Microsoft’s standpoint, Silverlight is “no longer strategic.”

Still, the death of Silverlight development, especially in corporate environments, is distant. Here is a great Microsoft client decision workflow about the correct technology to leverage based on your needs. I believe it reinforces the idea that even after Windows 8 is released, new Silverlight applications will have their place.

Lastly, even though Windows 8 tablets will not allow Silverlight plugins to be loaded within its browsers, native Windows 8 tablet apps will be developed using WinRT. As Brad informs us, this gives us Silverlight developers hope, as WinRT is still “just C# and XAML.”

 

By

How to Query the Yahoo Fantasy Football API in .NET

The Coveted League TrophyAs technical co-commissioner of my Keeper Fantasy Football league, I perform a good deal of administrative duties during the offseason. I have to sort through all the player transactions from the season to determine which NFL players are eligible to be kept within our league rules. One year, at the end of the 2010 season, I waited too long to gather this data. I normally click through the Yahoo Website to see all the historical transaction data necessary. However, after a certain point in the year, Yahoo removes access to the year’s information.

Luckily, in late 2009, Yahoo opened up their Fantasy Football API. Therefore, I was able to implement a .NET solution to retrieve the data I needed. Below are the steps I took.

The goal of our solution will be to create a simple ASP.NET Web Forms application that authenticates to Yahoo and then enables us to query the API.

Perhaps the most difficult hurdle to overcome is authentication. Yahoo uses a web standard called OAuth, which is a “simple, secure, and quick way to publish and access protected data”. You can find out more about it here, as I do not plan to delve into the low-level details of this protocol. The difficulty I found was that there are not many examples of .NET applications using this technology on the web.

To help us authenticate, we will leverage a .NET library called DevDefined OAuth.

  • Create a new Web Forms solution and add a reference to this project or compiled dll.

In our next step, we will create a simple button (named AuthenticateButton) in the Default.aspx page to kick off the authentication process.

  • Create a click event handler for your button. Enter the following code in the code-behind:

string requestUrl = https://api.login.yahoo.com/oauth/v2/get_request_token”;
        string userAuthorizeUrl = https://api.login.yahoo.com/oauth/v2/request_auth”;
        string accessUrl = https://api.login.yahoo.com/oauth/v2/get_token”;
        string callBackUrl = http://domain.com/Query.aspx”;

         protected void AuthenticateButton_Click(object sender, EventArgs e)
        {
            var consumerContext = new OAuthConsumerContext
            {
                ConsumerKey = “[provided by yahoo]”,
                SignatureMethod = SignatureMethod.HmacSha1,
                ConsumerSecret = “[provided by yahoo]”
            };

             var session = new OAuthSession(consumerContext, requestUrl, userAuthorizeUrl, accessUrl, callBackUrl);

             // get a request token from the provider
            IToken requestToken = session.GetRequestToken();

            // generate a user authorize url for this token (which you can use in a redirect from the current site)
            string authorizationLink = session.GetUserAuthorizationUrlForToken(requestToken, callBackUrl);

             Session[“oAuthSession”] = session;
            Session[“oAuthToken”] = requestToken;

             Response.Redirect(authorizationLink);
        }

 

To obtain your ConsumerKey and ConsumerSecret strings to place into the above code, go Yahoo’s Developer Projects Site and create a project. When creating your project, enter the Application URL (e.g. http://domain.com) and App Domain (e.g. domain.com) of the deployed location of your web site. Also, make sure to enable access to the Yahoo Fantasy Football API.

Take a look at the value in the callBackUrl string above. This needs to be edited to be an address on your web site. As part of the authentication process, Yahoo calls back to a URL on your site and therefore requires your site to be accessible from the public web.

  • Add a new web page to your project named “Query.aspx”
  • Place the below code in your Page_Load event handler

        protected void Page_Load(object sender, EventArgs e)
        {
            OAuthSession session = (OAuthSession)Session[“oAuthSession”];
            IToken requestToken = (IToken)Session[“oAuthToken”];

             // exchange a request token for an access token
            string oauth_verifier = Request.QueryString[“oauth_verifier”];
            if (!String.IsNullOrEmpty(oauth_verifier))
            {
                IToken accessToken = session.ExchangeRequestTokenForAccessToken(requestToken, oauth_verifier);
                Session[“oAuthSession”] = session;
            }
        }

 

Now that we are finished implementing the authentication code we can write the query submission logic.

  • Add a textbox (named QueryTextBox), a label (named ResultsLabel), and a button (named QueryButton) to the Query.aspx page
  • Add a click event handler for your button. Enter the following code in the code-behind:

        protected void QueryButton_Click(object sender, EventArgs e)
        {
            string query = QueryTextBox.Text;
            IConsumerRequest responseText = ((OAuthSession)Session[“oAuthSession”]).Request().Get().ForUrl(http://fantasysports.yahooapis.com/fantasy/v2/” + query);
            ResultsLabel.Text = responseText.ToString();
        }

 

You are now ready to query the Yahoo Fantasy Football API. Here is how you use it.

  1. Load the page by navigating to http://domain.com (replace “domain” with your website domain name).
  2. Click the Authenticate button

  1. Yahoo’s site will guide you through the steps to login to your Fantasy Football account and redirect to your site when finished.
  2. Enter an API Query into the text box and click “Submit Query.”

 

There are definitely improvements that can be made to our sample application. For instance, the results output from our query are not easily readable, but they can be simply output to an xml document or some other format for reading.

The amount of data that can be extracted from the API is huge and can be leveraged for some very creative purposes. For more information about the query syntax as well as available data, see the Fantasy Sports API Documentation.

You can download the code for the sample application.

 

Lastly, below are some resourceful links:

http://github.com/buildmaster/oauth-mvc.net

http://oauth.net/code/

http://oauth.googlecode.com/svn/code/csharp/

http://blog.techcle.com/2010/03/20/simple-oauth-integration-for-twitter-in-asp-net-mvc/

http://www.codeproject.com/KB/cs/Delicious-OAuth-API.aspx

http://code.google.com/p/devdefined-tools/w/list

http://developer.yahoo.com/fantasysports/

http://developer.yahoo.net/forum/index.php?showforum=122

 

Mind Map Software – a Great Tool for Brainstorming

Are you struggling to be creative? Looking for ways to organize your brainstorming sessions? Or maybe you’re just bored? I have found a good solution for when I am stuck in one of these situations. I look to Mind Map Software for help.

What is Mind-Mapping Software? It is software that helps you to keep track of related thoughts on a bubble-laden canvas. It produces a similar drawing to what you would have put on the chalkboard in 5th grade. Remember that? When no idea was a bad idea?

 

The nice thing about good Mind Mapping-Software is that it speeds up the rate at which we can record information while brainstorming. I type faster than I write so if I can brainstorm digitally, then I am less likely to forget a key idea I had before recording it. Additionally, soft-copies are more easily stored (than 50 white-boards) and can be updated later.

I have used a few of these applications and have definitely found them useful but I would like to do it more. I am just looking for the perfect option at a good price. Below are a couple neat options:

Installed Applications

Mind Manager – I understand this to be one of the leaders in the market, and at $349 it better be robust. I downloaded a trial and was impressed with the software. It had many templates for creating different types of documents, like organization charts and process flow charts. It was also very easy to add new nodes (spacebar) and new child nodes (insert), which is my most important feature.

Using Mind Manager reminded me that these Mind Mapping Software applications are also great for capturing flow charts. During times when you are trying to explain how a process works or how different things interact, fire up the software and draft a quick mind map diagram. Sure, you could use Microsoft Visio to do it but since you’re getting familiar with your Mind Mapping tool you might as well use that.

FreeMind – This is the other leader. It is open-source and free. The interface for this application is not nearly as beautiful as that of Mind Manager, but for technically-savvy folks like us, it is just what we need. FreeMind also suggests some other interesting uses for their product here, such as for a task list or meeting notes. I would choose FreeMind if I were going to install a windows application, but that’s not what I really want…

iPhone Applications

It would be extremely helpful to be able to record brainstorming sessions on my mobile platform (iPhone). Usually, when I am sitting in front of my computer, my head is buried in my work, writing code, blog posts, or email messages. I struggle to take a step back and reflect while sitting at my desk, because I tend to act on the first idea I have with my computer so close and accessible. The best broad thoughts I have seem to arise when I am not distracted by my computer: waiting to board a plane, riding a bus, or running on a treadmill. I’d like to capture those thoughts as seamlessly as possible.

iBlueSky – I am still searching for the perfect iPhone Mind Mapping application and this is not it. It is $9.99, seems limited, and only has a 3.5 star rating in the App Store. It is amongst the leaders of iPhone Mind Mapping applications but I think I will pass on it.

iThoughts – I am definitely going to give this a try. It is $7.99 and looks very intuitive. It has a 4 star rating in the App Store. I am excited to use this with my Bluetooth iPhone keyboard.

Google Wonder Wheel

Google Wonder Wheel is in a class of its own. It’s useful and yet many people do not even know it exists. To use, search for a topic in Google around which you are trying to brainstorm. How about “Mind Map iPhone Applications?” The lowest option on the left menu should be “More search tools.” Click that. Then click “Wonder wheel.”

I could not describe this tool any better than GoogleWonderWheel.com:

“Did you say mind mapper? This tool is a built in mind mapper with the intention to sort out search results in a logical way of relevancy creating a visual wheel of terms that can make your searching enjoyable and time effective at the same time.”

Clicking around the wonder wheel reveals related topics to what was originally searched for. It’s how I generated the chalkboard image above. I recommend playing around with it as you never know what it might help you to find.

Surprising Costs of Windows Azure Hosted Services

This summer I had a few days to twiddle my thumbs between quitting my job and starting with my new employer, Unstoppable Software. Creative ideas ran wild inside my head, the time off made me feel like I had an infinite amount of time to make them tangible. I whipped up a few websites and wondered where I could cheaply host them since they were built in ASP.NET MVC. Naturally, the first thing that came to mind was to store them in Windows Azure. After all, my BizSpark benefits included a reasonable amount of free service and I wanted to learn more about how the hosting service worked.

At first, this turned out to be a great idea. I was able to quickly get my site up and running in a Production environment on Windows Azure with a custom domain. Best of all, hosting was free!

Getting a working site in Production ended up being my biggest mistake.

I soon realized that I wanted a second hosting environment so that I could test development changes without affecting the working application in Production. Windows Azure’s easy to use deployment interface suggested the creation of a Staging Environment.

Azure Deployment Interface

 

The Staging site worked great. It allowed me to test with a different URL until I was satisfied with the results, then pushing my code to Production. Unfortunately, deploying to a second environment doubled the rate of consumption of a key cost metric, Compute Hours!

A Compute Hour is an hour of application use multiplied by the number of server instances. This is calculated regardless of the state of deployment (Suspended versus Active) and the environment (Production versus Staging). I was very surprised to discover this when I found a charge (below) for Microsoft Online on my credit card statement. Apparently, other developers found out the hard way as well.

Azure Deployment Cost

 

I expected the Compute Hours to be accumulated only by my Production environment. I certainly did not expect my billed rate to increase simply by following the best practice of using a Staging environment to test my application, especially if it was suspended when I was not testing. Additionally, I had incorrectly assumed that Compute Hours were only calculated when my web application was processing requests (of which I was not receiving many). I had not really thought about the cost since hosting was free at first. My recommendation to Microsoft is to make it more obvious to developers that the cost doubles when using an additional environment. I would also like to see a long-term Azure strategy for hosting low-traffic sites. Luckily, I found out about the increase in cost without running up a huge bill.

Implications of Windows Azure Container Types

In 7 Reasons I Used Windows Azure for Media Storage, I described the download process involved in streaming a large video through a Silverlight applet using the Microsoft cloud offering. My scenario involved the use of public containers to store large files (blobs) for a web application. Public containers are convenient because they can be accessed via a simple GET request. Unfortunately, being that simple begets some negative behavior. By being accessible via a simple URL, any user on the web can link to that file and/or download a copy for personal use.

If you are already using public containers, do not be alarmed as if your storage is entirely exposed. I tested my site by typing a URL in which I removed the file name and the result indicated that the URL could not be found. I immediately breathed a sigh of relief. In other words, even public containers do not act the same way that IIS would if the Directory Browsing setting were enabled.

Example URL: http://{ApplicationName}.blob.core.windows.net/{Container}/

Still, for cases in which public containers are not satisfactory due to their openness, the alternative is to use private containers.

Private containers are similar to public containers and remain fairly simple to use. They require the inclusion of a unique key during the GET request for stored files. This is extremely easy using the Azure SDK sample, which abstracts away the details of what must be included in the request.

Effectively, the container type determines where the request for Azure blobs come from. For public containers, the request comes from the client, because a simple URL fetches the file. In contrast, the request for private containers must come from the server. The server-side code embeds the key in the GET request, receives the blob, and processes it or delivers it to the client accordingly.

The obvious benefit to private containers being accessible only to the server-side code is that security logic can occur in it, thereby restricting who can access blobs to specific users based on rules. It also makes it much more difficult, but still possible, to download files stored in private containers for personal use. The drawback to this solution is that streaming now passes through the server, greatly increasing the bandwidth consumed by the application.

As described above, there are cases to be made for the use of both public and private containers. The best solution comes from weighing security requirements against bandwidth and development costs. Of course, there are ways to reap the benefits of both paradigms, but the above restrictions cover the “out of the box” web application scenario.

 

7 Reasons I Used Windows Azure for Media Storage

Windows Azure is one service that Microsoft offers as part of its Cloud Computing platform. Earlier this year, I began leveraging a small piece of the entire platform on my side projects for what is considered “Blob Storage.” Essentially, I am just storing large media files on Microsoft’s servers. Below I outline why I chose this option over storing the large files on my traditional web host.

 

General Reasons for Cloud Storage

  1. Stored Files Are Backed up

  2. Workload Scalability if traffic increases

  3. Cost scalability if traffic increases

 

Benefits of Microsoft’s Windows Azure

  • Easy to Learn for .NET Developers

I am a pretty heavy Microsoft developer so I more easily learned: how to use it, what the resources for learning it were, etc.

  • Azure Cheaper than Competitors

Thirsty Developer: Azure was cheaper than competitors

  • Azure Discounts with Microsoft BizSpark program

Azure is heavily discounted for BizSpark program members (Microsoft’s Startup program that gives free software for a 3 year time frame). BizSpark members get a big discount for 16 months, and a continued benefit for having an MSDN membership for as long as it is current (presumably a minimum of 3 years).

  • Ease of use

Retrieving and creating stored files is extremely easy for public containers. One can just get the blob from a REST URI.

 

How this applied to me

Traditional hosting had a very low threshold for data storage (1GB) above which it was very expensive to add on more storage. The same was true for Bandwidth but the threshold was higher (80GB). Instead, with Azure, the cost is directly proportional to each bit stored and/or delivered, so it is much easier to calculate cost and it will be cheaper once I get over those thresholds.

Using Azure for Storage produces the following Download Process

1. When a user requests a video file, he/she receives the web content and the Silverlight applet from my website.

2. Embedded in the web content is a link to a public video from Windows Azure storage.

3. Silverlight uses the link to stream the video content.

 

The link that my Silverlight applet uses to retrieve the file is a simple HTTP URI, which Silverlight streams to the client as it receives it. This is nice behavior; especially considering the file is downloaded directly to the client browser and does not incur additional bandwidth costs (from my traditional webhost) for every download.

 

What this means in terms of cost

There are several cost-increasing metrics as I scale my use of Windows Azure (see pricing below). Fortunately, Azure is much cheaper than my traditional web site hosting provider.

Under my current plan, costing roughly $10 per month, my hosting provider allows us to use:

80 GB of Bandwidth per Month

1 GB of storage space

For each additional 5GB of bandwidth used per month, a $5 fee is charged

For each additional 500MB of storage on the server above 1GB, the additional fee would be $5.

 

Fees for Windows Azure uploads & downloads can be easily predicted using the metrics below.

Azure Pricing (Effective 02/01/2010)

Compute = $0.12 / hour (Not applicable to this example)

Storage = $0.15 / GB stored / month

Storage transactions = $0.01 / 10K

Data transfers = $0.10 in / $0.15 out / GB

 

An Example

Let’s say that I average 80 GB of Bandwidth Usage per month on a traditional hosting provider. Because I would be using the full allotment from my provider, that would be the cheapest scenario per GB. Let’s assume that half of my $10 payment per month accounts for Bandwidth and the other half accounts for storage. In that case, my cost for Bandwidth Usage would be $5 / 80 GB, or $.06 / GB.

That may seem cheap, but remember that this price is capped at 80 GB per month. If my website sees tremendous growth, to say 500 GB per month then I would be in real trouble. For that additional 420 GB, I would have to pay a total of $420 per month. My total monthly bill attributed to Bandwidth Usage of 500 GB would be $425, or $.85 / GB.

In contrast, the Azure storage model is simple and linear. For the low traffic case of downloading 80GB per month, it would actually be more expensive. However, as Bandwidth Usage grows, the rates do not go through the roof. Case in point, my total monthly bill attributed to Bandwidth Usage of 500 GB would be $75 (assuming all outgoing traffic).

I could walk through a similar example for the cost of storage but I think you see the point. In fact, it would likely be even worse. Since my website collects videos, it would be more likely that the amount of storage used would grow faster than the Bandwidth used.

As you can see, Azure storage and bandwidth is much cheaper, especially after scaling over the initial allotment.

Note: Storage transactions are a negligible contributor to cost in comparison.

Why are there no programming books at the bookstore?

This post was written over a year ago based on frustrations of not finding good .NET materials at the bookstore. It is being published as a bonus post now after finally completing it.

A little about me:

– I live in the Midwest
– I like to program at bookstores
– My favorite band is Huey Lewis & the News

I like programming at bookstores. Armed with a laptop and earplugs, I find myself at my most creative and in flow when I am around interesting resources. Browsing a few technical or business books, my mind quickly reaches hyper-active problem solving mode. To play off the ancient proverb, when I find my hammer through reading, I immediately notice all the nails I have to pound.

In the Cincinnati area, Barnes & Noble and Borders are the most predominant bookstores with Joseph Beth coming in a distant 3rd. Bookstores are nice because they are open relatively late (compared to libraries), have coffee bars with Internet, and have seemingly infinite resources on a variety of topics (as compared to Starbucks). At least, they “had” a variety of resources. It seems over the last couple years these large scale bookstores have been phasing out the acquisition of new tech books. It used to be that I could go to the bookstore and utilize the books to do legitimate technical research. Now, it seems that only the heavily mainstream books are on the shelves.

In late 2008, when I should have been seeing books about the Entity Framework or Sync Framework soon after they came out, I did not find anything except on Amazon. The lack of books on new .NET frameworks continued when ASP.NET MVC came out and no physical copies could be found. My strategy used to be to check Amazon to see when new books were about to be released and then to travel to Borders on that day to perform the research I needed. Or sometimes I would browse the books at the store to determine if any were worthy of buying. For those that were, I then bought them on Amazon because they were much cheaper.

Unfortunately, the trend has continued. I am hard pressed to find any interesting books (or those that I have not read already) in the “Computers – Programming” category. And this used to be the key differentiator to me from the coffee shops on every street corner.

I realize that I may not be the ideal customer in the eyes of the bookstore. I have learned not to buy any books from them and commonly use the free Internet provided. However, I at least make a conscious effort to purchase an overpriced beverage every time I abuse the store’s resources.

With the above changes comes my growing disappointment. I miss having a central place to do research, skim random books, surf the Internet, energize myself with caffeine, and watch people. I don’t believe I can get that just from the Internet at home or a coffee shop. Additionally, I prefer to learn through reading books versus through the Internet, mainly because they tend to cover a wider spectrum of knowledge. Usually, a book goes through the basics to the intermediate and then the advanced. Books tend to contain straight-forward walkthroughs, executive summaries, and theoretical concepts. In contrast, the Internet tends to have very specific blog entries that solve a particular problem. When researching this way, I am forced to “jump right in” instead of following a complete tutorial targeting varying experience levels. It can be difficult to find high-level descriptions about a technology and why it is useful.

Is it useful to complain about a problem for which I am not offering a solution? I don’t know. I assume the bookstores are not making very much money by filling their inventory with programming books. Or perhaps authors are no longer producing content in the form of physical page turners. I just hope they know that the technology and programming books were a small part of the overall experience which caused me to buy their coffee. I guess attracting my “type” wasn’t worth it for them.

Perhaps when I win the lottery, I’ll unleash my solution to the dying bookstore industry. More on this in a later post…

Which Platform is the Best for My Mobile App?

I am currently sitting at the Cincinnati Microsoft office attending the CINNUG Mobile Development FireStarter. This free training session covers how to create mobile applications for Android, iPhone, and Windows Mobile phones. I do not have any immediate plans to create a mobile application soon, so what am I hoping to get out of this session?

3 Highlights I Want to Learn Today about Mobile App Platforms:

  • Pros & Cons of different platforms
  • Enough knowledge to be able to manage an outsourced app developer
  • Insight as to which platform is emerging as the leader

Throughout my career, I have been heavily focused on Microsoft development technologies. Often times recently, I have wondered if I should branch out to other languages and platforms. I have not yet done this, but if I were to move into mobile development (something I have limited experience with so far), it would be an ideal time to jump on the best platform as opposed to using Microsoft without questioning the decision. Therefore, I am happy to take advantage of this training session and glad that the format will discuss 3 different platforms.

What Did I Learn?

The training is over and I have formed some conclusions while generating even more questions. Below are summaries of what I learned.

Pros & Cons of Different Platforms

If I want to sell a mobile application then I need to make a good decision for which platform to build it. Each platform has its own benefits so it is possible that each platform could be best for certain types of applications. Below are the high-level Pros and Cons for each platform:

Android

Android Nexus One

Photo by Spieri_SF
    Pro

    Quickly gaining popularity

    Open source    

    Con

    Uses Java

    Somewhat limited for game development

iPhone

iPhone Image

Photo by William Hook
    Pro

    Most Popular

    Same OS for iPhone, iPod Touch & iPad

    Con

    Development requires a Mac

    Uses Objective C

    Only distributable through the app store

Windows Mobile/Windows Phone

iPhone Image

Photo by Brooks Elliott
    Pro

    Familiar tools and language

    Mature – platform has existed for a while

    Con

    No physical devices for new platform version (7)

    Adoption is a downward trend

 

Enough Knowledge to Be Able to Manage an Outsourced App Developer

Realistically, I am not going to drop all my plans or projects to dive in and write an iPhone application. I have enough wisdom to know that would probably be a waste of time unless I really want to learn iPhone development or if I had a great idea for an app for which I knew there was a market. Therefore, I don’t need to know at this time how to develop a mobile application. I just need to understand the highlights.

I am trying to prepare for the moment when I have that great idea for a mobile application. When that happens, I don’t want to be clueless about the next steps involved. I want to have a good idea for limitations of current platforms, which technologies are emerging, and how to move forward getting the thing developed.

Ideally, I will someday “own” a mobile application. When the time comes, my plan is to hire someone to build it, but I do not want to be ignorant to what is involved. By seeing these demos, I have been introduced to developing mobile applications. If I want to learn the details, I know where to start. If I want to hire someone else to develop a mobile app, I can now intelligently discuss the project and properly vet the person’s credentials.

 

Insight as to Which Platform is Emerging as the Leader

Perhaps the most important aspect to deciding which platform to develop for is how popular it is. Simply put, the bigger the market that my application can reach, the more sales leads that can be generated. So which platform will the most users be running when my application is finished and ready to be sold?

At the time of this writing, the iPhone is the most popular of these 3 devices. 2nd is Windows Mobile, with Android placing 3rd.

Most importantly, iPhone users consume the most network bandwidth out of all smart phone users. I believe this is a testament to the high user engagement with iPhones and consider this a forecast of its future growth. Some industry experts have opined that Google’s Android platform will emerge as the leader given its “open” paradigm is more beneficial to developers. Still Microsoft’s upcoming release of Windows 7 Phones may tip the market share into their favor.

I am by no means an expert, but my bet would be that the iPhone will be the dominant smart phone platform for the next few years. The barrier to entry for users is low and it already has a head start influencing the industry. Everyone that has an iPhone loves it and everyone who doesn’t have one wants one. I don’t know a single person who is excited for any Windows Phone news and only a few who are aware of Android’s developments.

If Apple ever allows the iPhone to be used with wireless networks in addition to AT&T, such as Verizon, look out! They will have removed the biggest barrier left to everyone wanting one.

Which mobile platform do you see emerging? Which platform would you recommend? Your opinion is probably more informed than mine.