ailon's DevBlog: Development related stuff in my life

Dear Microsoft, This is not Funny Anymore!

11/23/2010 5:36:42 PM

wp7racistI’ve got my Windows Phone 7 yesterday and so far I really like it (more on that later). Officially there are still no Windows Phones over here in Lithuania, so I had to get mine from abroad. That said, even though it’s sad that I have to go through hoops to get access even to free apps and can’t get paid apps at all, I wasn’t going to write much about it. After all WP7 is not yet officially launched in my country. That is stupid in it’s own merit but oh well.

I thought that it’ll be all resolved once official carriers start selling the phones next month. But today I found out that phones are out in countries like Norway, they can even be WP7 developers (unlike us) but they can’t officially access the marketplace unless they fake their country in settings.

image

I mean seriously, WTF!?!

I can totally understand why it isn’t possible to provide access to music & video parts of the marketplace. Microsoft doesn’t have full control over that content. But apps? What is the deal here?

It would be interesting to hear the official version of the problems involved in accepting my regular VISA or MasterCard credit card if I feel like paying for some fart apps. Sometimes I have been denied shipping of physical products, downloads of legal music by major labels, but this is really beyond understandable and feels plainly racist.

Tags:

Developing Controls for Windows Phone 7 as a Business

11/22/2010 10:48:07 AM

Yesterday I couldn’t sleep and was thinking about feasibility of developing Windows Phone 7 (Silverlight) controls as a business. Since I’m already in the the WPF/Silverlight control business and we already have an open-source charting product for WP7 this is a really interesting and sensitive topic for me.

Here are some of my thoughts. Some are facts, some are pure speculation and/or brain dump.

As you probably know, at this stage Windows Phone 7 is a consumer platform and the only way to get and distribute apps is through Windows Phone Marketplace. This makes it pretty easy to see the current state of the whole market/ecosystem.

image

As of this writing there are almost 2500 apps in the marketplace. Almost 600 are games meaning about 24% of the total number. Obviously the total number of apps is going to grow over coming months and years but I guess we can assume that the proportion of games will stay at approximately the same level. Let’s fix it at a nice number of 25%. Out of the rest of the apps a really large chunk are various “flashlight”, “fart” and other simple apps. These are not a target market for custom controls either. I’d say the number of apps that would benefit from advanced controls is no more than 10% of non-games (pure speculation based on non-scientific observation).

imageSo let’s say apps using 3rd party controls constitute 7% of all apps (I’d say that’s in optimistic range). Also, let’s say that the total number of apps grows to about 50,000 over the next 1-2 years. That’s roughly 3500 apps.

Now I’m not sure where to get the actual average number of apps per publisher but my guess is that what says “1325 Top publishers” in Bing’s Visual Search for Windows Phone 7 Apps is actually a total number at this point in time.

So basically the average is close to 2 apps per publisher. Meaning that with 50,000 apps in the marketplace we’ll have ~1750 publishers interested in 3rd party controls.

Now I believe most of the publishers are one man shops or really small companies. I guess the average number of developers per publisher is not more than 2. So let’s say these publishers are going to spend $1000 per developer on 3rd party controls over the next 2 years (again optimistic number, imho). That makes the market worth no more than 1750 x 2 x $1000 = $3,500,000 over all 3rd party control publishers. And that’s on the optimistic side in my opinion.

Conclusion

This post is pure speculation and I would like to hear your thoughts either based on more facts or deeper knowledge or just higher intelligence, but as I see it now the market is really small.

That said I still see some reasons to participate:

  1. These are still Silverlight controls and should cost less to adopt from desktop Silverlight than writing from scratch. That said WP7 Silverlight is going to be 2 versions behind pretty soon and that imposes serious challenges balancing between doing things the better (new) way and making them work on the phone.
  2. Sooner or later Microsoft is going to open the platform for enterprise development and distribution and that is going to be a much bigger market for control developers. The question is when is this going to happen? But hopefully this happens sooner than later and you’d want to be in the game when it does.

Again, I’m sorry for posting such a speculative rant, but if governments can expect 3% higher budget incomes by upping taxes by 3% why can’t I speculate using the same “Excel logic”?

Tags: , ,

Email of Happiness or How to Stop Hating Email

11/20/2010 1:21:52 PM

The problem

For many, many years my relationship with email could be described by this scheme:

suckyemail

I have a number of public email addresses, with messages forwarded to a single “central” mailbox. For all these years I’ve had this central mailbox always open. If someone sent me an email to any of my addresses I would get it immediately. And I don’t mean it would go to my mailbox immediately. I mean I would read it almost immediately. That became especially true when in several recent years I’ve had this central inbox configured to sync to my phone.

It was pretty common that I would wake up in the middle of the night for some random reason, look at the clock on my phone, notice that there’s an email waiting, read it and loose sleep for the rest of the night. During the day, when I was working on some project, I would see that I have new email, switch out of my mental work state, read the email and switch back to my work state. This sounds instantaneous but it’s not. And in many cases the email would consume me and I’d start doing things related to that email, abandoning what I was doing before for longer periods.

The most ridiculous thing is that I thought this was normal for a proud geek like me. It took me reading Timothy Ferriss’s “The 4-Hour Workweek” book to realize that there was something wrong with this scheme.

Timothy Ferriss’s Solution

The idea is that most of emails you get are not urgent and can easily wait for a few hours without anyone even blinking. And if there’s something really really urgent, they’ll call. Obviously this is not always true. If your work is answering emails, this won’t work. But we are not talking about edge cases. This definitely works for me. So I switched to checking email twice a day (around 11am and 4pm). Which can be represented by this scheme:

rareemail

You’ve probably noticed that there’s no smile on the face. This approach didn’t cause any problems where one might expect them. In almost a month I’ve been practicing this, I haven’t got any real complaints from anyone noticing that I reply a few hours later than before.

Problem is that in addition to “problematic” email, I get some “happy” email (notifications of licenses for my products sold, messages from nice people, etc.). Reality is that I’m absolutely not worried that I’ll get a bug report 2 hours later than before, but I have a psychic itch for happiness. What if I made an extra $1000 and don’t know about it yet. I don’t want to delay happiness for later. I don’t mind happiness interrupting whatever it is I’m doing.

Enter my solution…

Email of Happiness

What I decided to do is create another “secret” (non-public) mailbox. This email address is not to be exposed to anyone (even your loved ones, best friends, VIP clients, etc.). In other words email should get into it through only one source – my central mailbox. In the central mailbox I setup rules to forward “happy” email to this new address and have that new mailbox “always on” while still checking my “central” mailbox twice a day:

happyemail

I figure that if I ever need to have an important email exchange with someone which doesn’t fall in “happy” category, I can setup a temporary forwarding rule for this conversation and remove it when I’m done.

Technical Difficulties

I’m currently in the process of setting this up and it turns out a little more challenging than I expected. The challenge is not to expose your “happy” address to anyone for as long as possible (via replies, appointments, chats, etc.) and this proves a little difficult using different systems (webmail, phone, etc.) but I think I’ll figure it out and update this post once I do.

Tags: , , ,

Who Wants HTML5 to Succeed?

11/19/2010 5:45:29 PM

Yesterday I’ve had a short twitter-chat with Laurent Bugnion in response to this tweet:

image

This chat got me thinking about motivations of most of the biggest players driving HTML5 forward. Here’s what I think.

Apple

Apple resorts to praising HTML5 only when they need to justify why there’s no Flash (Silverlight, etc.) on iOS devices. In these cases HTML5 is the answer. But when it comes to comparing HTML5 apps to native iPhone apps there’s no comparison – native apps win hands down. And apparently there’s going to be an app store for the desktop Mac OSX. So Apple’s main interest is in controlling the apps (and I’m not even talking about sales revenue here) that run on top of it’s operating systems/hardware. I don’t see HTML5 fitting well into this plot.

Adobe

Adobe was close to world domination in RIA (or at least de-facto standard) up until Apple killed their dreams with the no-Flash debacle on iOS. And HTML5 was Apple’s weapon. I’m sorry but I’m not seeing Adobe as someone who want’s HTML5 to succeed.

Microsoft

Microsoft came up strong about HTML5 in IE9. It sounded strong enough for some people to pronounce Silverlight dead. But why would Microsoft want something that could run on Linux, Macs, etc. as well as on Windows to be a RIA platform of the future? I can see 2 answers here:

  1. they are confused and will come to their senses later;
  2. they will “extend” the standard to a point that “cool” apps run only on Windows.

Now in the second case that won’t be the HTML5 generating the buzz right now. That will be MSHTML5 or something.

Browser vendors

I’m not talking about Microsoft, Apple or Google here. I’m talking about the other 2 major browser vendors who have browsers at the core of their businesses: Mozilla and Opera. I don’t think they have any end-game in this. They are just trying to make great products that users would want to use to browse the web and what that web is will be decided by other players.

Google

That leaves us with Google. I believe they are the only big party that has a genuine interest in making HTML5 succeed as a cross-platform standard. After all they have the deepest current investment in the area with all of their awesome web apps, Chrome OS, Google TV, etc. But I doubt that they are strong enough to overcome the obstacles in form of above mentioned companies. After all Google is currently in direct competition with all of them, so why would they hand the torch to Google?

Conclusion

I think I’ll have to agree with Laurent’s statement. I believe there will be HTML5 “standard” in the near future, but it will be along the lines of what all the other HTML incarnations always were – good in theory but requires a lot of duct-tape to glue it all together into something working across browsers. And it will be up to enthusiasts (like the creators of libraries such as jQuery) to make it all kinda work.

I’d like to end this post with “History Repeating” by Propellerheads. Enjoy…

Tags: , ,

Flex 4 for Silverlight/.NET Developers. Part 1. Introduction

11/9/2010 11:22:34 AM

As readers of this blog probably know, my main occupation over the last couple of years was .NET (WPF/Silverlight/WP7) side of amCharts product line. If you are familiar with the product you know that it started as Adobe Flash product and now expanded into Adobe Flex world too. I always wanted to be able to understand first hand what’s going on in our Flash/Flex products but was delaying the dive into Adobe world time after time. Now I finally got an opportunity to do something with Flex and had no excuse to skip it once again.

I decided to give Adobe’s own video course titled “Flex in a Week” a try and finished “Day 1” at this point. From the first second I felt that I’m looking at everything through .NET (WPF/Silverlight) developer’s perspective and thought that I’m probably not alone at this and it could be useful for people like me to have some articles about Flex targeted at .NET developers. So here we go…

Disclaimer: I’m not leaving .NET or something like that. This is just a side project to widen my personal professional horizons and be in the loop of stuff happening in other parts of amCharts product family and RIA world.

Tooling

I won’t try to disprove the myth that developers working on MS stack are very dependent on tooling and start straight from the tools.

The Visual Studio equivalent in Flex 4 world is called Flash Builder (formerly Flex Builder). Here’s how it looks

Flash Builder

It’s an Eclipse based IDE which is available as both Eclipse plugin or standalone package. I haven’t worked much with it yet but from what I’ve seen even though it’s not as sexy as VS2010 or Blend it looks like a pretty capable decent modern IDE with all the color-coding, code completion, design mode, property editors and other stuff one would expect.

Flex itself is an open source framework and it’s SDK is available for free. Flash Builder on the other hand is a commercial product which will set you back from $249 for Standard Edition to $699 for Premium Edition. There’s a 60 day trial which I’m currently using, but there’s no equivalent of Express editions of Visual Studio. So if you want an official professional IDE be prepared to shell out real money.

Terminology and conventions

Flex projects are compiled into SWF files (pronounced as “swiff”) which are equivalent of XAP in Silverlight. You can run Flex projects in browser via Flash Player or on desktop/mobile via AIR runtime. However (at least as I understand it at this point) unlike Silvelright you have to decide upfront if your project is targeted at Flash Player or AIR.

image

Flex uses a markup language called MXML for declarative UI layout (XAML in Silverlight) and ActionScript for code. ActionScript is ECMAScript based language (think JavaScript on steroids). A default MXML page looks like this:

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
   3:                xmlns:s="library://ns.adobe.com/flex/spark" 
   4:                xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
   5:     <fx:Declarations>
   6:         <!-- Place non-visual elements (e.g., services, value objects) here -->
   7:     </fx:Declarations>
   8: </s:Application>
Pretty familiar, eh?

Visual Studio solution equivalent is called workspace, projects are just projects. Projects can be packaged (exported) into a single FXP file (for easy sharing?) and imported back into workspace.

What we, .NET developers, call controls is called components in Flex world. In standard component world there are 2 sets of components with basically equivalent default look and feel. Why is that? Well, historical reasons.

First is the older MX library which can be customized via property settings and styled with CSS (!) but has a hardcoded layout. So, if you want to customize it beyond what you can achieve via properties, you have to create your own class inherited from the standard component.

The new component library is called Spark and can be customized via what .NET developers call templates, which are called skins in Flex. The skinning/templating mechanism is pretty similar to Silverlight. One thing I’ve noticed so far is that Flex skins (can) contain ActionScript code.

   1: <s:Button x="70" y="126" label="Button" skinClass="mySkin"/>

As for custom/user components there doesn’t seem to be any differentiation like in Silverlight (user controls vs. custom controls).

Classes are named using Pascal case notation which was called “upper camel case” in the videos. Differently from .NET world all class members are named using camel case.

Data binding is done using curly bracket syntax where you just place the name of the object and property to bind to:

   1: <s:Panel x="38" y="12" width="198">
   2:     <s:TextInput id="myTextBox" text="test" x="14" y="12"/>
   3:     <s:Label text="{myTextBox.text}"  x="14" y="46"/>
   4: </s:Panel>

This code results in the output like this:

image

As you can see even though obviously there are differences so far it doesn’t feel like a totally unfamiliar ground for Silverlight developers.

to be continued …

Tags:

MVPonT – Most Valuable People to Follow on Twitter

10/9/2010 11:40:44 AM

A week or so ago I was watching my twitter timeline with all the new and renewed Microsoft MVPs announcing their MVP statuses and congratulating one another. Then I tweeted this:

Too bad they don't award MVP to people who talk MS related sh*t on twitter and blog occasionally. In such case I'd be MVP for sure. #mvpbuzz

And immediately had that “aha!” moment. Less than week later I’ve launched MVPonT.

largeLogo

The idea is that twitter users can nominate other tweeter users as most valuable tweeps in their field (as identified by hashtag) and then other users can vote for them or nominate their own.

Here are some categories that should be of interest to the readers of this blog:

There’s much more. Check out the complete tag cloud for more hash tags or start your own!

As you can obviously see the site was started by developer in a community of developers but it’s totally not limited to developers and might go well into mainstream. The only noticeable venture in mainstream so far was with Russian hashtag #ru where fake Russian president totally dominates over the real one (well deserved btw).

I need your help with going into new areas! Nominate tweeps in your area of interest and we’ll all have a good resource to find most valuable people to follow in any field.

Thank you!

Tags: , ,

Unit Testing Combo WPF/Silverlight Projects

9/23/2010 8:24:52 PM

With release of WPF 4 and Silverlight 4 creating WPF and Silverlight applications sharing the same code became easier and less frustrating than it was before. The main techniques that I described in my series for WPF 3.5/Silverlight 3 (“Add as Link”, partial classes and preprocessor directives) are still the most reasonable approach for this task.

It is also commonly agreed that your ride will be smoother if you start with Silverlight. This doesn’t mean that you have to leave WPF for later. What this means is that you create files in your Silverlight project and “Add as Link” to your WPF project (not the other way around). The main benefit of this approach is that you get Intellisense , etc. for Silverlight and, since Silverlight doesn’t have all the classes, methods and overloads that full .NET framework has, you won’t be tempted to use them.

A very simple solution utilizing this approach would look something like this:

image

So What About Unit Testing?

If you are some unit testing fanatic you might want to unit test WPF part with MSTest (or other testing framework) and separately unit test Silverlight part with Silverlight Unit Test Framework. Now this would be good in test reliability but I can bet you won’t run both of them anyway and since most of your code is identical you would probably want to unit test that common code with only one of the testing suites.

It wouldn’t come as a surprise if you decide to use MSTest running inside Visual Studio over SilverlightUT running in browser. The problem here is that you are doing Silverlight project first and you can’t add a reference to your Silverlight project to the MSTest project.

image

So what you have to do if you want to go this route is constantly add new files to your WPF project and reference that project from the test project.

image

Problems with this Approach

Unfortunately this approach is far from perfect.

First of all it’s problematic to do TDD/tests first. When you write a call to a not yet defined method and try to generate method stub using Visual Studio you get this error:

image

This happens because you have MyControl.cs file open from a Silverlight project and the tool tries to generate the stub into WPF project and fails because the file is already open from another project. Now if you close the file as the message box suggests, the generation will succeed but it will open the file from the WPF project and you won’t be doing Silverlight-first unless you close the file again and reopen it from the Silverlight project again.

Then there’s a similar problem with refactoring/renaming. When you have your file open from the Silverlight project and you rename a method, class, property, etc. using Visual Studio refactoring tool it won’t be renamed in the test project. So you’ll have to go and do a bunch of manual finding and replacing.

These are obviously not critical issues but pretty annoying nevertheless. It’s very important that writing tests is as painless as it could be or you won’t write them. And pain is pretty much a part of the process considering these issues.

Hopefully there’s a better way to unit test such projects and I’m just not aware of it. If so, please, let me know in the comments.

Shout it kick it on DotNetKicks.com

Tags: , , ,

Side Effects of Silverlight Marketing

7/1/2010 9:47:07 AM

Note: this post is about marketing to developers (not general public).

Yesterday Tim Heuer published a blog post titled “Top issues for Silverlight” where he summarizes reported Silverlight issues. Apparently number one issue is “WPF and Silverlight feature (dis)parity”. Tim writes:

It’s a little weird to call this one an issue with Silverlight, but this was seen requested more often in these areas that it is worth calling attention to.  Some of the genesis of this angst comes from an expectation that WPF applications ‘just work’ in Silverlight and not understanding the areas of the subset in both XAML and the .NET base class libraries (BCL).

Now this is true but one has to wonder where this expectation comes from.

Silverlight is NOT a subset of WPF

The root of this problem (at least how I see it) is the initial marketing message of Silverlight for developers was that it is a subset of WPF. Now Microsoft is a serious and cautious company and you would hardly find any direct evidence of this but this is what gets stuck in minds of developers who know about WPF and/or Silverlight from various presentations before they dig deeply into development.

It’s hard for Microsoft insider to realize this. That is not that obvious even for someone who is working with both WPF and Silverlight. But if you take someone who does some real work with either WPF or Silverlight but not both and ask them what’s the relation between WPF and Silverlight, most of the time you are going to hear the mantra – “Silverlight is a subset of WPF”. I’ve heard developers, project managers, etc. with no experience in WPF and/or Silverlight repeat this numerous times. And that was exactly as I saw things before I started coding with both. This is encrusted deeply in the minds of developers and is the main source of frustration when they realize that this is not exactly the case.

I guess with all the advances in Silverlight over the recent years this disparity became a little more expected than before but the “subset” idea is pretty much still alive. Now I don’t know what needs to be done to kill this mantra and I’m not even sure Microsoft’s business departments want to kill it but I think this is the main source of this “issue” being number one.

Silverlight for Windows Phone 7 is NOT Silverlight

This subtitle is a little too drastic on my part but I’ll explain what I mean in the next few paragraphs.

One might think that WPF vs. Silverlight case was one of it’s kind but just this spring during MIX10 conference while unveiling Silverlight as one of the main developer platforms for Windows Phone 7 Scott Guthrie said this: “It’s not Silverlight Lite. It’s not Silverlight Mobile. It’s Silverlight.” (watch MIX10 Day 1 Keynote).

Now the wording is really clever. And later he explained that it’s Silverlight 3 with some parts of Silverlight 4 and phone specific stuff. He never said that you can run exactly the same code on the phone as you can on desktops and those who were interested in WP7 development understood that. But majority of the folks who just listened to this as high level overview have this notion stuck deeply in their minds. They believe that they can continue working on their Silverlight apps as they did before and then if they decide to move the app to WP7 they will only have to shuffle the UI a little to fit the smaller screen.

Do you think they are going to be frustrated when they find out that this is not the case? What do you think is going to be the top issue for Silverlight for Windows Phone 7? My guess is “Silverlight and Silverlight for WP7 (dis)parity”.

Shout it kick it on DotNetKicks.com

Tags: , , ,

Book Review: Framework Design Guidelines. Conventions, Idioms, and Patterns for Reusable .NET Libraries by Krzysztof Cwalina and Brad Abrams (Second Edition)

6/11/2010 3:38:05 PM

5138dM4PHnL._SS500_ This book is a must-read and a must-have for anyone developing .NET libraries and frameworks. It’s basically an internal Microsoft document describing how .NET itself and related frameworks should be developed.

Guidlines are divided into DO, DON’T, CONSIDER and AVOID depending on how strong authors feel about them. In addition to official guidelines the book is filled with notes and commentary from other Microsoft gurus. Quite often these notes are even more valuable than guidelines themselves. That said there were a few places where guideline was just thrown out there without any explanation of the reasoning behind it. Sometimes it was obvious but a few times not so much.

If you are an experienced .NET developer you probably follow most of these guidelines automatically but this book provides all of them in one place. You can force your less experienced colleagues read this book and save them from learning these rules the hard way. And when in doubt it’s an excellent reference to turn to.

I must say this is not a fascinating read. To tell the truth it’s one of the most boring books I’ve ever read. Nevertheless it’s extremely valuable and I don’t hesitate to recommend it to any .NET developer. And even if you don’t do .NET you can gather quite some wisdom from it.

If you follow tech news you probably know that Brad Abrams left Microsoft and went to Google, so, I guess, we shouldn’t expect a third edition of this book (at least by the same authors) in the foreseable future. So this is probably as good as it gets for now.

Buy this book from Amazon

Tags: ,

Online Tool to Get RSA Public Key in XML Signature format

5/24/2010 6:14:01 PM

Last month I’ve posted a short how-to about getting XML Signature foramatted public key from Base64 encoded certificate. Now that I’ve launched a sub-site for my online tools I thought there’s no reason to leave that post as a how-to only, when most people just need to use it once.

So I’ve made a simple online tool that does just that – you paste your base64 encoded RSA public key into a form and get XML signature formatted version. No need to implement this yourself.

What's that for?

If you need to say verify data in .NET signed with private key and you don't have/want the public key (certificate) installed on your machine, the easiest way to go is to load public key data from XML string using RSACryptoServiceProvider.FromXmlString() method.

Problem is that it accepts key information in XML Signature format (the one with <RSAKeyValue><Modulus> etc.) and there is no easy way to get it in that format. Most of the time you get the key in base64 encoded form or in binary form from which you can get the base64 version.

This tool lets you get the XML Signature version from that base64 representation.

Tags: ,

Copyright © 2003 - 2014 Alan Mendelevich
Powered by BlogEngine.NET 2.5.0.6