OS X Weekly

Filed Under Software, Mac

I have been reading OS Weekly for a while, but today I read an article so ridiculous there they might as well rename it to OS X Weekly. The author (Brandon Watts) makes the claim that Leopard is better than Vista because it has no activation. It seems that he was under the illusion that Apple is producing and selling and operating system. What the author never realized is that OS X is a firmware for Apple hardware, and they don’t care on how many Macs you install it, as long as you pay them for the hardware.

Here is one ridiculous quote:

“Is the point here that people with multiple Macs in their home should buy the single-user copy of Leopard and install it on every Mac in sight? Obviously not. Apple has trusted us to use the OS as they have intended, and to be quite honest, that is flattering.”

Flattering only if one does not realize that Apple cares about selling the hardware, and you can’t install the Leopard firmware on any other hardware.

Claiming that OS X is better than any real OS because it is easier and free to install is like claiming that the “OS” on a Nokia mobile phone is the best, since it is free, easy and stable.

I know that Apple currently is offering the best package (hardware + software) and the stability and ease of use of their firmware is mostly because it sits on a fixed hardware (hence the mobile phone analogy). But one must be really narrow-minded to not be able to see that it is not the firmware (so called OS) that is on its own making it great. It is the fact that it all comes from one vendor. If Apple ever attempt to make an OS that you can install on any hardware, it will definitely not be better (I am personally sure it will be much worse).

Hit and run software product design

Filed Under Software, Products

Another week of frustrating product design meetings left me thinking what can one do when faced with the equivalent of hit and run management applied to designing software. Generally a hit and run product designer will leave the design process to someone else, or a group of people, but will randomly interfere with ideas, insist on them, even if they turn the existing design upside-down, and leave for some time, until he is ready for another hit. I’ve had experience with several such cases, and I never feel I have the right solution for the problem.

Hit and run
Image courtesy of Jay Kinney

What makes a hit and run software designer

Generally hit and run product designers fall into two categories - chaotic and busy. The chaotic ones generally don’t have a complete, coherent idea about the design, they just have strong feeling about a specific features/screens/workflows (sometims even contradicting). The busy ones are good designers, that think that they have the entire design in their head, but are too busy or undisciplined to put that to writing. Although for different reasons, both types behave the same and seem to do equal damage.

Does this work, really?

Well, yes and no. It can work in the short run really well, if the person is motivated, energetic and charismatic leader. I have seen a case of a software built exactly like that - with almost no written specification, a single leader hit and run designing and managing directly every developer. If he knows very well what he is doing, and invests a lot of energy the result is a pretty fast time to market. Cutting off that 30% for design and planning makes it somewhat faster to get a first version out. At some point however, the result of the hit and run management and design surfaced. The product was successful and out there, when it turned out that the bug count was constant. The bug database always had about the same amount of bugs. There was no specification to turn to, so a lot of uninformed patching took place. Also, getting faster to market meant adding features to a buggy product, just the opposite of the zero-defect policy. For almost two years the bug count was constant. Developers felt as if they were beating a dead horse, since at some point it didn’t make any difference weather you worked your butt off, or spent the week browsing the internet - the bug count at the end of the day would be the same. Not that bugs were not fixed - they were. But every bug-fix either revealed, or caused another one. After years the dead horse was re-factored into a new, well designed and maintainable software.

We’ve seen hit and run management, its not that bad!

It is not. Hit and run management is not half as destructive as hit and run design. Hit and run managers will change priorities sometimes and make you re-arrange schedules, but at the end of the day they don’t have impact on the quality and maintainability of the code-base. Hit and run design however, results in a lot of redesign (in the early stages) or patches (in the later stages).

What to do then?

I don’t think I have a very creative answer to this yet, but I still have some useful advise.

For chaotic types, which are usually not from engineering background, but know the target field very well, you will just need a lot of extra effort in the design phase. Just lock yourself with them in a conference room, and start writing the specification as they speak their random thoughts. It is up to you to structure the document, which will be really hard. You have to be alert, since the random feature they are just talking about can be in a total conflict with what they talked yesterday. Keep in mind they cannot think of the system as a whole, they can concentrate on just one screen/feature/work-flow at a time. When they come up with a contradiction, you should scroll the document back, point to them what they said yesterday and make them decide how to do both.

This will be a lengthy, painful process. At the end of the day you walk of with a signed off specification, and use it as a shield against all later “great ideas” that will impact the design and void months of work.

For the busy type this does not work. You cannot lock yourself with them, since they are very busy. My usual reaction here is to turn into a real process Nazi, claiming it is impossible to proceed without a written, signed off specification down to the last detail. This really isn’t like me, since I prefer more relaxed and agile development process. Insisting on cumbersome, bureaucratic process is really bad for startup companies, which need to be quick and flexible. And startup companies are the place where you will find hit and run design most often. So this is just choosing the lesser of two evils, not really solving the problem.

If you are facing something like this, drop me a line or leave a comment, I think there has to be a better way :)

Mac OS X virtualization - a double edged sword

Filed Under Software, Mac

In my last post I mentioned how the raising popularity of virtual machines was working good for the popularity of Macs. The more I think about it though, the more it works the other way around also. I have been recently checking out if some pieces of software I need have Mac ports. Without mentioning specific names, I am generally talking about thin clients to server-based services or games, which for some reason so far have had a Windows-only thin client.

I went to check out web sites and forums, and I was surprised how often the following discussion takes place in public forums (or blogs) between users and developers:

User: When will we have a Mac version?

Developers: Mac version is not planned for the moment.

User: Why? How is this possible??? You are loosing customers! And you will be losing more!!!

Developer: Uuugh… according to our statistics, we are not losing customers, they simply run our software in Parallels/VMware/Bootcamp.

It turns out that virtualization works against the pool of software for Mac growing. And we all agree that the best OS is the one that has the largest variety of software. So, as even though virtualization technology is helping Macs grow, it is also slowing down the native Mac software growth.

How Microsoft Won The API War on Windows only

Filed Under Software, Windows, Linux, Mac

Another release out of the door, and some time to put my thoughts in writing.

Did Microsoft lose the API war?

The title of this post is of course referring to the famous “HowMicrosoft Lost the API War” by Joel. I kept going back to that article when we were porting our product to Vista, as well as trying some of my personal projects on Vista. The more I think about it, The Raymond Chen Camp in Microsoft is still strong, and the API war is far from lost. And this article does not indent to pick on Joel, it just uses his article (which was very true in 2004) as a base to make a point.

Who makes the best APIs?

Also, apart from not losing backward compatibility, Microsoft are still kings at making their APIs developer-friendly.

Example - you want you application to make an HTTP request and get the result. Both Apple and Microsoft have an API (Apple calls its CFNetwork, MS calls theirs WinINet) for that. Ok, so you write you application to use the OS-supplied API for the task. But you have customers behind corporate firewalls, using proxies. The user has set its proxy setting in the system, and their browser is working fine, but you application is not. What to do?

Well Microsoft will advise you to simply call InternetOpen with INTERNET_OPEN_TYPE_PRECONFIG, which will make your application inherit the browser settings (direct or proxy). What do Apple suggest…. this! Tenths of lines of code against a simple parameter of a function.

This happened in a multi-platform project I managed. The Windows developer just took a glimpse at MSDN, added the flag and the proxy issue was forgotten on Windows. The Apple developer took almost half a day to understand the article, copy-paste the example and adapt it to his code. A big productivity win for Microsoft.

Does it matter?

Still, sadly, Joel was right about the outcome. Developers no longer care to learn new APIs from Redmond, and .NET is not very popular either. It is not because of the API war though. The API war played its part but what really mattered is the market and the widespread use of virtualization technology.

No matter how small the combined market of Linux and OS X is, companies don’t want to neglect that. These days you see more and more application sites offering OS X or Linux versions of their software, and more and more hardware vendors provide Linux drivers for their hardware. It is not a single OS world anymore. And this affects developers’ choices of tools and languages. Joel was talking a lot about the backward compatibility and the old code. But how about new code? What will you choose today, if you are starting a brand new software? If possible of course you will choose a technology that does not limit you deployment abilities. If you ever have the choice of .NET over Java - you will choose Java, or regret it later when a customer says “We like you application a lot, but we are a Linux shop, does it run on Linux?”. In that moment, it is not very comforting to say to yourself “Ok, we lost that sale, but hey, Linux is only 2%, why should I care”. And if you choose a technology that binds you to an OS, which today has 99% of the market, you are still gambling, betting all your money on the chance the OS market does not change in the lifetime of your product. Of course, all this is valid for a certain range of applications. But for this range, the developers have started turning away from APIs and technologies that are bound to a specific OS (.NET, Objective C) , and preferring (where possible) cross-platform tools and languages like Java, Python, wxWidgets etc.

As a developer, I am a huge .NET fan. This is the combination of framework and development environment that IMHO makes a developer most effective. As a development manager though, I am a Java/Python fan. Even with somewhat less productivity with the later two, you are ready to deploy on any platform out there and this is becoming more important.

The role of virtualization

The other thing that hurt Microsoft bad is the virtualization technology boom. The biggest advantage of Windows is the huge amount of software available on it. A lot of people have been tempted to switch to Apple or Linux, but were being held back by that specific application that they can’t live without, which is available on Windows only. Well, with the Apple switching to Intel (enabling software like VMWare and Parallels on the Mac) and VMWare doing a Linux version it is not a problem anymore. I know a lot of people that switched and are now running that favorite application in a virtual machine.

Conclusion

So Microsoft won the API war. It did not matter. To win the developers back to Microsoft tools and technologies, they should make them available on all platforms. If there was .NET for Mac and Linux I would, as a development manager, push the developers to use .NET. With .NET being bound to Windows - it is a hard call to make since you are burning your bridges for a Mac or Linux version.

Steve Jobs on drugs

Filed Under Software, Mac

Found these on the internet:

Steve Jobs - normal

jobs_normal.jpg

Steve Jobs - on drugs

jobs_drugs.jpg

P.S. Seriously, I was about to write about my frustration why Jobs thinks that Safari will wipe out 3 (FireFox, Mozilla, Opera) other browsers, but leave IE’s share intact. I just could not find words to describe it.

Apple reinvents Windows

Filed Under Software, Mac

The keynote presentation of Steve Jobs on WWDC 2007 had a pretty big reaction in various media. As usual, a lot of people were pissed of by Apple’s advertising. Just a few hours after the keynote was public Joel wrote:

Apple is and always has been severely dishonest in all their advertising when it comes to performance. This is the company that spent years telling us that the PowerPC was faster than Intel, only, suddenly, to change their claims midsentence without an explanation when reality caught up with them, in a scene almost exactly like the scene in 1984: “Merely it became known, with extreme suddenness and everywhere at once, that Eastasia and not Eurasia was the enemy.”

This is the company that’s about to release the iPhone on a slow, last-generation data network but is running TV ads that have edited out all downloads and waiting time that network entails.

These products may be cool, but I don’t understand why Apple should be allowed to lie so blatantly in their advertising about performance and get away with it. I’m sorry, but a web browser that takes a minute to launch is not going to win any converts on Windows.

I personally don’t care that much about the lies in Apple’s ads, since a lot of companies do that. I was a little confused by the fact that (as usual) the keynote had more negative talk about Microsoft products, than positive stuff about Apple products. This in not something new, but sound stupid combined with the fact that you want to announce your “new” features that Vista has for a year like sidebar in Finder, specialized folders like “My Pictures” and “My Downloads”, previews of content in icons and games.

Apple’s whole ad campaign and speeches are based on negativism, and I am really curious how will they advertise if they ever get out of their puny 6% market share. It feels strange to spend the first part of your speech explaining how bad Windows is, and then to announce that your third key feature is the ability to run Windows on your hardware. Apple is on the rise, the market share is growing, and bringing in games to the Mac is a really, really smart move. I can imagine that Macs will be a much more developer-friendly platform than PCs thanks to the fixed hardware. But in order to not piss everyone around, Apple should stop with the negative advertisements, or always be the underdog in the OS market.

OS Market Share

Microsoft CRM Web Services

Filed Under Software, Windows

Lost almost half a day evaluating the best way to integrate our licensing with our corporate CRM. Why am I writing this? To hopefully save someone else’s half day.

After a glimpse at the SDK I figured out I wanted to use the CRM web services. They were simple, and had just the functionality I needed.

I wanted to try them quickly, so I:

  1. pointed my browser to http://localhost:5555/MSCRMServices/2006/crmservice.asmx
  2. clicked on Fetch
  3. Entered a valid Fetch XML and clicked invoke

500 Internal server error

The rest of the day was spent trying to figure that error. I decided there is a problem with the web interface, so I wrote a small C# function to try it:

CrmService s = new CrmService();
s.Credentials = new NetworkCredential(”administrator”, “admin”, “organization”);
// or s.Credentials = System.Net.CredentialCache.DefaultCredentials;
s.Url = “http://localhost:5555/mscrmservices/2006/crmservice.asmx”;
string a = s.Fetch(@”
<fetch mapping=’logical’>
<entity name=’account’><all-attributes/>
</entity>
</fetch> “);
MessageBox.Show(a);

Same Internal server error.

FireFox gave me some insights, which still didn’t help me figure out what’s wrong:
System.Runtime.InteropServices.COMException: Exception from HRESULT: 0×80041D1F.
at Microsoft.Crm.Platform.ComProxy.CRMQueryClass.ExecuteQuery(CUserAuth& Caller, String QueryXML)
at Microsoft.Crm.Sdk.SavedQueryServiceProvider.Execute(String fetchXMLString, ExecutionContext context)
at Microsoft.Crm.WebServices.CrmService.Fetch(String fetchXml)

At the end of the day, all the 500 Internal server errors and cryptic InteropService exceptions boiled down to permission problems. I was using the administrator account, which is not allowed to use CRM.

The problem here is not that CRM didn’t work correct. The problem is that both IIS and the COM exception were too cryptic. The 0×80041D1F is described on some sites, but it is a CRM specific HRESULT, not something that error lookup knows about.

I really hope this article saves your half a day so you can do something fun with it.

The coolest way to install an OS

Filed Under Software, Linux

I’ve been doing a lot of OS re-installs lately, both at home and office. And I soon found out I hate installing XP, Vista, Red Hat, but I simply love installing Ubuntu. Why is that? One simple reason - the live CD. Once you boot the live CD you have internet, Firefox, icq, games, everything. You start the install and instead of watching stupid progress bars and slogans you can read some news on the internet, chat with friends, play a game or write a blog post (yes, I am writing this while ubuntu is installing in the background).

Is Linux ready for me?

Filed Under Software, Linux

Is Linux ready for me?

In parallel to my efforts to completely switch to Vista in my office, I decided to
check out on the progress of Linux. I was curious can I do all my daily job under Linix, so I installed the latest Ubuntu alpha in parallel to my Vista. I planned to spend roughly half my working day in Vista and the other half in Ubuntu. For the purpose I used my company Fujitsu-Siemens T4210 tablet PC, Vista business edition and Ubuntu 7.04.

Installation

Ubuntu installation was a breeze, but I had to put in additional 2 hours of
effort (reading forums mainly) to get the tablet and tablet buttons working. The Ubuntu forums are really helpful, and it is quick and easy to find exact steps to get your hardware working. I never managed to get the built-in microphone working, though.

Wireless networking is greatly improved in the latest Ubuntu. Much more stuff works out-of-the-box. Overall no problems here.

Doing work stuff

I started doing what I do normally, and overall I was able to to most of my work
under Linux. This included:

But I also found out I had to re-boot to Vista for some tasks. What I did not manage to do under my Linux:

Doing fun stuff

The conclusion

Linux has improved greatly for the last year. If I was writing this article for Ubuntu 5.x, it would have been much, much worse. It is now almost suited for work stuff. If I had found a reasonable Project, Visio and Photoshop alternatives - I would have switched, since overall I started to like Ubuntu very much.

For the fun part - its greatest strength (the huge freedom and choice) is its biggest
curse. Until there are world-wide Linux standard HALs for hardware accelerated video
and modern 3d sound, Linux is totally not ready for the fun part. And it is my favorite
part….

Refactor-able code

Filed Under Software

I have been thinking lately what is the best way to Stop over-engineering and still not fall victim of duplicate code (or even worse - very similar code).

At first glance, the approach of Test-first programming and refactoring seems to be the perfect remedy to over-engineering. What it basically says is:

This guarantees you that the code will be right-engineered. Not over-engineered (unnecessary complexity), nor under-engineered (duplicate, similar code all over).

The problem with that approach is that it does not work. It does not work because the “at all costs” rule above is frequently overruled by non-engineering reasons. A typical example will be when you decide not to re-factor to fit in the latest feature since you are too close to a release and you don’t want to introduce new bugs or void the testing already done.

Then you fall into the “I will patch it now for the release and re-factor later” down-spiral. So if you are stubborn on the “at all costs” rule, you will not be able to make your releases, and if you are not you will end up with an under-engineered code-base.

The root of the problem is that refactoring takes time and brings instability to the system. And to me there is no reason for that. We should be able to write code that is not complex at that moment, but is refactor-able (or refactor-friendly). Such refactor-able code will be easy and clear to refactor if necessary, but without doing it in advance. We will save time from the development (as compared to over-engineering it), but we will still be able to follow the “at all costs” rule, since refactoring will be easy.

My goal is to come up with a definition and how-to for refactor-able code. I am posting this much more as a basis of discussion and ideas, rather than as something carved in stone.

Definition: refactor-able code - code that is easy and risk-free to refactor
How to do it:
There is just one simple rule - Over-engineer in your head, do it simple. What I mean is to keep in your head a vision of how would you over-engineer it if you had all the time in the world. Then write the code simple, preparing it to match the vision in your head.
Since this is a really vague how-to, I will try to list cases in which you can substitute the urge to over-engineer something with much simpler preparations for that. Following is a list of examples

If I was over-engineering I would… Instead I will…
Split this into two modules and use callbacks to communicate Keep the two modules together, but keep the would-be-callbacks as separate functions.
Make a base class for the generic part and inherit it for this special case Do one class, keeping the “generic” methods together and don’t allow a lot of special-case code to go into the generic methods