Developing for .NET 2.0 in 2012

When I tell people what I do at work they are often surprised that there is still someone doing this – it is 2012 after all.

The thing is – we develop Windows based desktop only software using C# and .NET 2.0. Our software writes plain ol’ files to disk. It seems that most people these days develop web apps using some (newer) language and/or framework depending on their server. Alternatively I meet a lot of developers doing mobile apps for iOS/Android.

It is true that most of what we do have some frameworks, languages or even platforms that are newer and possibly better than the one we use. But I really think that our situation is very unique – so please don’t throw away the .NET 2.0 idea yet.

First – we develop standard software. There is one version – and we sell it to all our customers. We do not do any customization or modifications based on single users. True – we listen to all our users input when developing – but that is a totally different story. We don’t sell our software based on the technology platform – we don’t have to attract new development contracts by being able to target a new platform like “mobile”.

Second – we target a relatively narrow business segment. This might be a very fuzzy definition for most – but this group is very conservative when it comes to IT investment and upgrade. In this target the users almost never have any control at all – IT is centralized and all upgrades or updates is planned and carried out with precision. They are usually not the first movers on new technology – they are actually often last movers. To illustrate – our company website has a unusually high amount of Internet Explorer 6 visitors compared to overall web statistics.

Third – our software is very often used at the core operations part of a business. This means that the preferred focus is “stable and predictable” compared to “new and shiny”. If we where to roll out updates that changed too much – users would not upgrade, they would demand a roll back and they would possibly think twice about upgrading in the future. A changing UI represents some degree of uncertainty concerning the effectiveness and predictability in the daily use of the software and therefore the business critical decision making that our software support.

This is why we are still targeting .NET 2.0 – we have no pressure to seek out a new platform. Our users have .NET 2.0 and is comfortable by having it. And we don’t need the shiny features that newer platforms provide.

Android is not fragmented – iOS is defragmented

When developers and industry people talk about the mobile OS scene the word “fragmentation” is often mentioned. What is meant is that iOS is essentially out there in one version – on a very few sets of hardware (differentiated by resolution and processing capabilities) that can easily be targeted/un-targeted with a check-in-a-box.

Android on the other hand exist on a market where hardware is essentially unknown until runtime. Screen resolution and processor/GPU could be anything. The operating system itself also leaves some fragmentation. Currently there are at least three major Android versions in use (depending on how you count them) – please refer to Platform Versions on the Android developer site. The part that is actually targeted when mentioning “fragmentation” is the “API Level” – currently there are 11 such to target for Android developers – fragmentation.

When I develop apps for Android I really don’t see fragmentation as a real problem. There are countless guides about selecting the right API level for your app – which is actually very easy – just go with the smallest you can. The diversity in screen size and device capabilities would be a problem – except we (yeah – I really mean the most of us) have a background in “real computer” application development or web development. Have a look at the video standards resolution illustration the browser display statistics and the OS platform statistics. Do you see the pattern?

In my opinion fragmentation is not really a problem. We deal with in everywhere we develop software. In every piece of software that we write we need to manually check something, add maximum or minimum sizes to UI components, check for camera support, check for network connection e.g. – It is not Android that is fragmented – it is iOS that is not-fragmented.

Peer-to-peer is ruining my connection!

Please note that these screen shots where taken later to show the mentioned scenario.

Last week my the hard drive in my iMac broke – so AppleCare had to replace it. It’s all taken care of but this kind of situation always leaves a lot of installing (no – I don’t use Time Capsule!).

The two last (at least that was what I thought) programs that I installed was the Diablo 3 Beta and Starcraft 2 – both from Blizzard Entertainment. The nice this about these two 10+ GB games is that i don’t have to find some disc in a closet somewhere – I just go download their installer which downloads and install the required data – while I am hoping for a faster connection.

The download of Diablo 3 was running very slowly and making the while browsing experience very crappy on every device in the house. I didn’t even bother to turn on the TV at the time (we have TV over IP) but I can imagine it would’ve had some trouble. The funny thing is that – all TCP throttling aside – there should be absolutely no problem browsing while downloading the game.

When D3 was done and the download time of SC2 sad ~50 hours I decided to go do something else only to realize that this wasn’t right – my head turned the numbers a bit and found that my promised connection speed should give me way faster downloads – either Blizzards server was having trouble or my ISP was screwing with me!

Fortunately the SC2 downloader has a connection status which revealed that it was downloading the huge game at approximately 100-150 kb/sec – no wonder this was going to take the best of two days! This didn’t quite add up with the fact that my browsing experience on every other device was very poor – until I noticed the upload speed – which was about 80-100 kb/sec.

See – my connection is about 20/1 Mbit where 20 is the download speed and 1 is the upload speed. When the Blizzard downloader was using the all the upload speed available on the connection no other traffic where really coming trough. I suspect that the throttling is done based on open connections and the Blizzard downloader had a lot.

The solution was to simply disable the peer-to-peer download option – which allowed the installer to download at full speed from the direct HTTP – at that time it was around 1.2 – 1.4 mb/sec while I was using another computer for light browsing and watching TV.

Why is Android releases so slow?

This is a translation and partial rewrite of a piece I wrote in danish: Opdatering Android (PDF).

For most people with an Android unit it is still a riddle why there can be significant delay (months) between when Google starts rolling out an update for their own Nexus-units to the day when “all” units are updated.

Compared to Apple announcements of new iOS versions following the availability and download from all their users worldwide. It is clearly not server capacity and bandwidth that Google lacks. The reason for the delay (especially compared to iOS) must be found in the early days of Android/iOS and the overall marketing philosophy.

When Apple makes iOS they also make the hardware it runs on. They specify what types of cell network the devices are compatible with and even what type of SIM card is needed. In other words: Full control. Android is produced as a software-only platform to fit on every smartphone in the world. The environment in which it runs is to a higher degree pre-defined by external sources.

This means that the software developers that make Android has a very hard time testing – at least in every possible real world scenario. Testing on specific networks using specific units and every combination of these would require hardware and physical presence beyond the point where it is a realistic alternative. On iOS these combinations are very few and very testable. The natural conclusion of the Android development team is that they need to ship software. So they do a soft rollout where more and more users get access to the update. This is done based on (as far as I has been able to determinate) IMEI numbers to get a representative roll out among possible configurations in “the real world”. During it this way enables Google to halt the roll out if errors occur without the errors affecting too many people/phones. An example of this was when the 2.3.6 upgrade broke the wifi-tethering feature on some phones on some networks.

Seen from a software development perspective this is a dream come true. For most users this is a nightmare where waiting becomes a pain while those around you might get the upgrade before you do.

Why the long delay on Android updates?

This is actually a modified + translated version of this peice I wrote in danish: Opdatering Android (PDF).

Google develops the operating system Android. The speed of the development is as fast as the whole smartphone business – and that is fast – which means that a lot of stuff is happening all the time. Android gets support for new functions and technologies like NFC, bigger screens e.g.. Many of these updates is about hardware support – both support of new hardware and improvement on currently supported hardware – and a lot of updates purely focus on the software that millions use every day. These are improvements of stability and overall use experience. When Google announce these updates most users (those who hear about them) feel a natural need to get these as fast as possible. Often it will take quite some time though – from the updates are announced by Google – until it can be downloaded and installed on the phone of a user. Why is that?!

In addition to that question – Apple is constantly announcing updates to their iOS platform that is ready to download on all units worldwide right away – or within very little time. If Apple can do this surely Google could to! I will try and describe why this update process is actually harder for Google – and why Apple don’t face the same problems.

Google develops Android with a specific reference platform. They have a piece of hardware (phone or tablet) which they develop a specific new version of Android for. The new version is tested to match the capabilities and stability of the hardware and software. The specific hardware implementation decides which features new versions of Android will support. Usually Android versions is build for the Nexus-line of phones which contains hardware features that Google wish to include. By developing this way Google is creating a software platform they can license to their partners and even Open Source.

When a hardware vendor (phones) develop a smartphone it will need an operating system. For every vendor other than Apple this is a choice between Android, Windows Mobile, Symbian, MeeGo etc. – if Android is chosen it means that the vendor uses the software platform provided and adjust it to fit the specific hardware implementation that is their new phone. This process involves writing driver implementation for hardware etc. and adding this to the Android platform. To be different on a market of so many Android phones many vendors choose to add another layer of software to the standard Android experience. Examples of this is the HTC “Sense”-UI. Customizations like this will also need to be adapted to specific hardware (phones) – which is usually a lot smaller task than customizing Android because it expands and extends software at a much higher abstraction level.

This means that when Google is ready with a brand new version of Android the hardware vendors need to determine of their hardware can actually run the new version including their own custom changes. This is usually a trial-and-error process which naturally means that it will take some time. Sometimes the network operators even have customizations and pre-installed applications. Which just adds another layer of development and testing and further delays the process. All this customization must be completed before the phone vendor can start rolling out software updates. Older hardware has limitations and might not get certain upgrades that are basically incompatible. Furthermore the hardware vendors make money selling hardware – not directly by supplying software updates – which leaves the simple question: Do they even want to do it?

The situation that Apple is in is a lot better in regards to software updates. They develop software (iOS) exclusively for hardware that they also produce. This means that the software developers making the new iOS version can actually test it on every single specific hardware unit that the software is ever going to run on. That effectively removes a layer of software development and testing compared to the Android model. Adding to that – Apple made the clear decision very early on that they will not support network operator customization. Yet another develop/test layer possibly removed. When the updates are distributed it comes directly from Apples servers into the iOS units (or though iTunes) – compared to Android which could be distributed from the hardware vendor servers or even from the network operator.

It is hard to imagine how this situation could be improved in the future – it will most likely require that Google put some kind of pressure on the hardware vendors. This is a possibility but it seems very unlikely considering that this would also up the requirements of backwards compatibility and future hardware demands of the Android platform – which will definitively slow down the development of new and much better hardware or even cause further fragmentation of the platform.

Rackspace – Ubuntu Cloud Server – LAMP installation

This week I’ve had the joy of setting up some servers using the Rackspace Cloud Server infrastructure. I’m very impressed by the level of professionalism and expertise that the whole Rackspace team has. Overall a very pleasant experience.

When spinning up a new server from scratch the first thing we would like it to get a LAMP sw-stack running. We usually select Ubuntu (newest – at the moment “Oneiric Ocelot“) and go from there (for a visual walk-through see the video at the bottom of the post).

First thing you want to do is to update the apt-get system, and then upgrade all installed packages:

apt-get update
apt-get upgrade

Then you can install the stack, starting with the Apache 2 server and PHP5:

apt-get install apache2 php5 libapache2-mod-php5

After that install MySQL on top of those:

apt-get install mysql-server mysql-client php5-mysql

Then run this to secure your MySQL installation (set root password, disable remote root access, etc.) and install phpmyadmin (optional – but nice to have):

mysql_secure_installation
apt-get install phpmyadmin

Finally you must restart your Apache 2 server:

/etc/init.d/apache2 restart

PS Vita

On february 22nd (launch day) I bought the PS Vita. The machine has nice specs and some nice features lined up such as AR and front + rear touch – but what really rocks my boat is the the fact that this handheld machine is the first generation handheld that is truly born online. Like the newest non-handheld console generation the online features are now expected in almost every game. Another great and really strong feature (the number one selling point for me at least) is the cross-play ability – the possibility to play (games made for it) across the PS Vita and PS3 platforms and share save games as you like! It sounds fantastic – especially when most of your sit-down time (like mine) isn’t in your home where the PS3 is.

When looking at the launch day game line-up these two killer features is actually one that is visible in most of the released titles! Cross-play is not as used in the current line-up as I could’ve wished – but more is coming – especially from Sony! Today I enjoy multiplayer gaming in WipEout with people on a PS3 while hiding in a corner with my PS Vita (now I apparently just need more friends who enjoy playing WipEout!). Almost every game (does anyone actually know a title that doesn’t) has some kind of network feature – be multiplayer or whatever – the experience is really enhanced!

The “near” feature – the ability to see people near you and what they are playing – is nice, but not a killer feature (for me – at least). Although I must admit that I’ve actually found a few new PSN connections using “near” – an overall neat feature.

By the way – “Army Corps of Hell” is amazing – not because of the music, cross-play or network features – it’s a nice bloody boss fight Pikmin!

More than 10 thousand installs

As I wrote in the blog post on Southbound Software this is just amazing!!

The first version of Read Later for Instapaper (it was called Instapaper Poster at the time) was put on Android Market during the easter period of 2011. Not even a year has passed and the app that I wrote for my own pleasure and for my own use has reached over 10.000 downloads – the usage is rising and more people each day start using the app as a part of their daily rutine – as I do in mine – awesome!

The app has been pumped in “niceness” (notification icon and offline post-ability) and there has been a lot of bug.. ehm… fixing – but the cure function of the program has remained the same through the 17 releases during this past almost-year.

It is my hope that the program can be improved a bit in the future – but it is currently a very potent tool. Thanks to everyone who has downloaded the app already – it mean a great deal to me.

Advantages of 64-bit

Nowadays people who buy Windows or install Linux are confronted with the 32- vs. 64-bit choice. There are several advantages including memory management etc. This question and responses on Stack Overflow pretty much sums up the main advantages and points to consider.

I wanted to do  a real world test comparing memory operations running in different modes. This lead to this question and some findings – posted on Code Review. Now I’ve done some more testing divided into four groups 32- and 64-bit pointer operations – executed in 32- and 64-bit mode. These are the output:

64-bit pointer, 64-bit mode

  • Loops: 100 Elapsed time: 6987.638000 Average: 69.876380
  • Loops: 200 Elapsed time: 13861.296000 Average: 69.306480
  • Loops: 300 Elapsed time: 20833.421000 Average: 69.444737
  • Loops: 400 Elapsed time: 27746.943000 Average: 69.367358
  • Loops: 500 Elapsed time: 34693.142000 Average: 69.386284
  • Loops: 600 Elapsed time: 39019.204000 Average: 65.032007
  • Loops: 700 Elapsed time: 38858.330000 Average: 55.511900

64-bit pointer, 32-bit mode

  • Loops: 100 Elapsed time: 5601.273000 Average: 56.012730
  • Loops: 200 Elapsed time: 11104.902000 Average: 55.524510
  • Loops: 300 Elapsed time: 16671.022000 Average: 55.570073
  • Loops: 400 Elapsed time: 22228.157000 Average: 55.570392
  • Loops: 500 Elapsed time: 27787.730000 Average: 55.575460
  • Loops: 600 Elapsed time: 33332.861000 Average: 55.554768
  • Loops: 700 Elapsed time: 38896.038000 Average: 55.565769

32-bit pointer, 64-bit mode

  • Loops: 100 Elapsed time: 13312.479000 Average: 133.124790
  • Loops: 200 Elapsed time: 22025.908000 Average: 110.129540
  • Loops: 300 Elapsed time: 33019.403000 Average: 110.064677
  • Loops: 400 Elapsed time: 44024.916000 Average: 110.062290
  • Loops: 500 Elapsed time: 55038.448000 Average: 110.076896
  • Loops: 600 Elapsed time: 66054.053000 Average: 110.090088
  • Loops: 700 Elapsed time: 77091.699000 Average: 110.130999

32-bit pointer, 32-bit mode

  • Loops: 100 Elapsed time: 13775.434000 Average: 137.754340
  • Loops: 200 Elapsed time: 27503.340000 Average: 137.516700
  • Loops: 300 Elapsed time: 41255.826000 Average: 137.519420
  • Loops: 400 Elapsed time: 54918.705000 Average: 137.296762
  • Loops: 500 Elapsed time: 67934.638000 Average: 135.869276
  • Loops: 600 Elapsed time: 66102.285000 Average: 110.170475
  • Loops: 700 Elapsed time: 77136.964000 Average: 110.195663

The obvious conclusion is that the best reason to select a 64-bit operating system is if you have a lot of programs running in 64-bit mode. And another point for captain obvious: don’t select 64-bit OS if the code you are running is 32-bit – it will hurt the performance. The result from running with 64-bit pointers in 32-bit mode being fastest is actually a bit surprising - but it might be a result if the test environment optimizing for better performance - this test is executed on a Mac OS X machine – running 64-bit natively. To make 100% proper conclusion I would have to dual boot the same OS in different bit-settings on the same metal – which is very impossible for me!

Hopefully I’ll have the time to test on other environments soon.

Your mailbox is not a mailbox!

Your house has a mailbox – in this mailbox all mail for the whole family goes. When you receive a letter someone needs to process the name written on it and hand it to the correct person. This is done to save a lot of resources by setting up multiple physical mailboxes. This is NOT the case with mailboxes for e-mail etc.

Over the recent years I’ve noticed kind of a trend among certain people. There are certain groups of people who are not really into computers and/or the internet(s) – but still acknowledge the fact that they are somehow required to have and use these as a tool.

The problem is that among these people there is a trend of over-sharing their tech stuff. That includes all their accounts. Computer login, Facebook account, e-mail account e.g. – I often get an e-mail where the sender is a two-name-couple or see people use a single login on their computer for the whole family and/or let guests use the non-guest account.

Certain things will get much better if we ALL just embrace the new millennia and use this stuff as it is supposed to!

  • Get your own mail account!
  • Get your own Facebook/social account!
  • and when using the computer: Get your own damn account!