Where Development Will Be Sunday, Nov 1 2009 

There is a nice podcast out there where Bob Walsh and Patrick Foley talk about entrepreneurs and small businesses. In the last episode Bob predicts that developers will work in ‘many many millions of small enterprises’. Conventional work in cubicles will be left to developing countries and won’t exist in developed countries. I understand this position if you live in sunny California and pretend to be a thought leader of some kind but let’s be honest:

I would say that ‘many many millions of small enterprises’ will be located right in the developing countries. The real advantage of the US programmer is its location. If you have to meet with clients or attend company meetings location is important; so welcome to the cubicle…

Mac OSX vs. Linux: Chasm in usability of software installation Monday, Feb 16 2009 

I would like to highlight one of the reasons why Linux did not get its way into the desktops yet — though it’s free, have good drivers coverage and tons of applications: installing software is a pain. Actually, it starts well: typical distribution has an update manager with GUI where you can check applications you need and hit OK to install them. Updates also work fine. But what if this distribution does not have the tool you need in its list? That’s where it breaks…

You may try another packages system; maybe they have what you need. But this would typically require messing with command line, finding all the required libraries and resolving possible configuration conflicts. And something of course won’t be available as a package and you will need to take the code from CVS and compile locally. It is all painful and really scares off 99% of users.

Mac OSX is a Unix too but they made applications management really simple. All application files are placed in one folder — application bundle. Finder even shows this folder as a single file to hide this fact from you; it’s an opaque structure. So you download an archive with this bundle (typically zip or dmg), extract it and drop inside Applications or any other folder. Easy! Need to remove the application? Just delete the bundle like other files. Need to replace it? Delete the old bundle and extract the new one. Very simple, no dedicated tool, all users can do.

If installation requires extra actions the software is packed in pkg file, but they are really rare and typically are system tools. OSX has a built-in utility that extracts pkg content in appropriate places and executes the required actions. Some applications, like MS Office, tend to abuse it but still such packages are self-contained: they don’t require you to find and install other packages so the experience is like you run a wizard. Still possible to do by most users.

The chasm in usability is made by decision in Mac OSX to distribute application libraries with application itself. Linux is an OS written by programmers for programmers — extra copies of files are considered bad. It’s a typical programmer’s decision: if you have a reusable piece of code you should reuse it wherever possible. Copy-paste is a big no-no in this field so every reusable component is packaged and distributed as a shared library. Now they win on space but users — they have to manage this huge dependency tree!

Hard drives are enormous nowadays; libraries are still very small. Typical library is smaller than one photo produced by my DSLR. My time spent on CVS and gcc costs much more than disk space. And that’s why (partially) my OS of choice is Mac OSX and not Linux.

P.S. If you are writing an application for Linux, please, don’t make a package for your favorite distribution: make a folder with all files you need so I can just download it as archive, extract and use. All users of all distributions will praise you!

Economy’s Train Tuesday, Feb 10 2009 

When I think about the economy it reminds me a train. We all sit in there and enjoy produce-consume cycle that moves the train forward. When economy is healthy it grows and we feel as if the train accelerates making the ride more joyful. But occasionally something goes wrong; within months we fell in recession and the train slows down. How could it happen? We need fuel to make it move — we need money; we borrow more than we can return, we play in Ponzi schemes and do other crazy things. Eventually, they grow over a threshold and burst; you can’t borrow above some limit, people loose trust in your enterprise.

Economy, as a train, may be pulled or pushed. Consumers pull the economy by purchasing goods and services while producers and banks push the economy by making these goods and giving credits. When pulling force slows down the government eases life for manufacturers and banks thus increasing the pushing force. And vice versa then manufacturers and banks break, the government stimulates consumers to increase their pulling force in hope that the pushing force will recover. But what if they break at the same time? That’s what happening in 2009…

The whole idea of the stimulus package is to take fuel for the train somewhere and keep it running in hope that money could be returned later. But you know, this plan may fail. If there are severe problems with the train, if people that travel in it just can’t produce more then they consume — the train will stop. So maybe instead of burning more fuel it makes sense to just slow down? By lowering ambitions, consuming less and working more it is quite possible to live and enjoy the life. By ignoring the problems it is easy to blow up the engine and stop forever; how do you think ancient civilizations did stop to exist?

The Ultimate Knowledge Test Thursday, Feb 5 2009 

I know the ultimate way to test your expertise in some area. It’s very simple and really shows how deep is your knowledge of the topic. It takes some time to undergo but may be well less then internship. You also don’t have to sweet through interviews and what’s most astonishing – you don’t apply to a particular job and at the same time you apply to every job in your domain. It’s also very truthful; you may convince yourself that you really know the thing but as you can’t fool the mirror to beautify the reflection you can’t fool this test because it’s too based on reflection.

The test is to write about the topic. That’s it, that simple. You may start a blog or write articles for someone – it doesn’t matter. A few writings may cover enough ground to show how well you know something. If other people can comment on them – that’s excellent; your replies will expose even more of you.

Writing also improves and expands your knowledge. After you’ve mentioned something or provided an example you should read it over and criticize. Is this statement valid? Will this example work? Typically you are confident of your writing but yet you are not sure about some parts. You check them and your assumptions turn into the facts that means knowledge.

You also share what you know and you should be proud of it. Other people will read and learn and refer to you; the process of educating other people is very gratifying.

So if you specialize in something there are no reasons not to write about it; you will improve yourself and other people. And if you fear to write then maybe it’s because you are not so confident in your expertise level? You see, the test works even before you start it…

The Three Levels Of Wealth Monday, Feb 2 2009 

The first level is no wealth. People at this level have no or almost no money and don’t possess any property. Some people, like monks, do it intentionally. Some have lost it in war or in accident; many refugees in Africa live in camps and effectively don’t have much of their own. But there are also people that just live without wealth and are happy. Well, maybe not exactly happy but little money and clothes are just good enough for them and they don’t care to change this situation. We call them ‘homeless’ since these folks don’t care about living in ‘real’ homes.

On the second level there are people with an income. Typically it’s a salary that they receive monthly and use to pay the bills. Many rent a flat or have a mortgage. What makes them grouped on level two is that they have to work for a living, and what is very interesting is that most of them remain on this level forever. Of course anyone wants to be rich and don’t go to work five days a week but in practice few people manage to get there. Living on the second level is just good enough for many and their dreams remain dreams.

People on the third level may not work till the end of life. They have enough money to support themselves for years. And typically a home of their own. It doesn’t mean that they have piles of money – they just could allow themselves to do what they want, where they want and when they want, and not to think about a job. How much money could that be? I think that two or three millions USD should do. It’s not too hard to calculate the amount – just sum up all the remaining salary that you will get in you life, plus some extra money, just in case.

This level is so interesting because you could see who you are – decide who you will be – lazy slump of meat watching tv the whole day, new-born artist, just a healthy shiny very social person or eccentric entrepreneur. I’m not on the third level yet, but it’s exciting to think about this – could it be like a new life?

Criminals’ organization Saturday, Aug 30 2008 

Yesterday I’ve seen a ‘Le Deuxieme Souffle’ movie. It was about a criminal who had escaped from a prison and returned to the previous life. He was depicted as a man with strong sense of honor, friendship and rules of the underworld. And after watching the movie I think I’ve finally got the idea why it’s so important for those people to have such rules. They are emphasized in almost every film about criminals!

Normal people are controlled by governments. There are armies of bureaucrats that formalize people’ relations and define punishments for violations. The result is less conflicts between citizens – since most of interactions are formalized they are predictable and perceived as fair. In criminal society there are no bureaucrats – you do what you want – just don’t get caught. This means no guarantees, no stability in relations and as a result more primitive life style. The only way to stand out in the absence of government or other ruling party is to build a personal reputation. And the only way to build such a reputation is to live by rules, rules of the underworld in their case. To this extent such criminals resemble medieval knights: laws were weak so a good reputation complemented and sometimes substituted the law. And maybe that’s what makes such movies interesting – we see strong characters that make their rules by living by them, not merely obeying rules enforced by others.

Zoo Monday, Feb 11 2008 

Once three programmers had decided to go to a zoo. After returning home they were explaining their wives what they had seen:

Ruby programmer: The first animal was like a horse. The second animal was like a horse too but ate leaves from the trees. The third animal was also like a horse but preferred to stay in the water.

LISP programmer: All animals had four legs. Among all animals with thin legs only one could eat leaves from the trees. Water-loving animal had thick legs.

Java programmer: I’ve seen zebra, giraffe and hippopotamus.


All life experience piles up in our heads in form of abstractions and categories. It’s natural to name them while communicating or thinking about something. When you have a present for your kid he wants to know WHAT is it – he wants you to name a category, a known abstraction. And if the time has not come yet you play with him telling that it’s something big and soft and brown to keep the kid intrigued. Tell him that it’s a toy bear and there is no surprise – the kid knows for sure what’s in the box.

When I’m writing a code I’m explaining formally how to accomplish some task. It’s hard to do without abstractions, and to use abstractions you have to name them.

I’ve grown out of iLife Wednesday, Jan 23 2008 

I have to admit that I’ve grown out of iLife suite. It was fun to play with it after buying a Mac but now most applications became unsatisfying compared to the existing alternatives.

iPhoto

It keeps a copy of every edited image. This copy remains even if original is deleted so this app is a huge disk space eater. It has only a basic set of image editing controls and export options are limited. The best tool to manage and edit photos is Adobe Lightroom; after using it to correct images iPhoto looks like a toy. Aperture is good too but I like Lightroom’s editing options more.

iMovie

The last good iMovie version was 6. After it has lost timeline it became a crap. Apple has Final Cut Pro application that is all you need. Express version of it is much cheaper and in most cases the one you really need.

iWeb

If you want to blog there are lots of sites that give free accounts. They also provide comments, stats and other goodies. If you want to share photos there are many sites that you may use too. The same for sharing videos. If you need a database and generated pages iWeb won’t help you. So the only thing left is to create a nice page with your photo, text “Hello, my name is John” and links to wordpress.com, picasaweb.google.com and youtube.com. Do you really need 300Mb application for this? RapidWeaver is much smaller and more flexible.

Garage Band

Many people nowadays have photo and video cameras but much less have midi keyboards and compose music. Maybe it’s great for musicians.

iDVD

The only app that makes sense to me. Of course I can write movie clips to DVD disk and watch them sequentially but not all DVD players can do it and it’s much more pleasant to look at themed menus. DVD Studio Pro is more powerful but I seldom need it’s complexity.

Code Bloat Thursday, Dec 27 2007 

I’ve read a recent rant of Steve Yegge about ‘Java bloat’ (http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html); language wars will never end. There always be cool languages and old ones and programmers will always invent something new and what’s cool now will be old within a couple of years…

The idea is that Java is verbose so codebase grows quickly, then it becomes unmanageable and thus it’s better to use other more succinct languages. And so Java developers are doomed. 

First I thought: there are millions of Java developers – how could it happen that they are all wrong? Ok, there is a chicken and egg paradox: Language needs libraries to be usable and libraries have to be written by programmers that use the language. There are two ways to break it: create a superb language so there are enough impressed programmers to write libraries and made existing libraries available through wrappers or some clever hacks. Java was a superb language; it was C – pointers + garbage collection. Now there are so many libraries for Java so it just can’t die any time soon. ECMAScript has chosen the second path – it uses Java libraries. Plus it’s quite popular because it’s the language of web browsers. Other languages like Ruby and Python seem to be not so superb and so have no so many libraries; they have not yet grown out of this chicken and egg hole.

As Joel Spolsky noted twenty years ago it was enough to read C book from K&R to be a programmer. Now there are lots of technologies and APIs available; programmer should know much more. I can’t remember all classes and constants from JDK; even those that I used in my code vanish from my brain after a while. Eclipse API is huge too. The only way to stay productive is to be able to quickly find information you need and good IDE is an information retrieval tool! Why people use autocomplete feature? Not just because it’s faster to type code; you can quickly find a right class method or attribute. Eclipse even shows javadoc comment for the methods in autocomplete list. Another crucial feature is the type search: you can press a shortcut to bring ‘Find Type’ dialog and type part of the class name; in the list below you will see all matching classes and may open the one you need. I’ve noticed that I rarely read JDK documentation – it’s so much faster to just find the appropriate class! And of course source code navigation; put cursor on the class or method and press F3 to open it’s declaration, press Cmd+Shift+G to find all its usages. There lots of other things that allows you to discover the code and semantics behind it; people use Java because strong typing makes code discovery possible. From the dirt point of view languages with strong typing imply structured dirt like houses and bridges while languages without type system imply just piles of dirt.

Using smart features of the language won’t save you from the complexity. The only viable cure for quantity is abstraction; and this means only one thing – create and use DSLs. Now it’s really easy to spawn your own language: have a look at ANTLR, it will do all the routine job for you. There will never be a problem with your boss that insists on using Java; you may always hide your DSL in Java app as configuration files. And yes, it’s the ‘Interpreter’ design pattern; your boss likes GoF, isn’t he? 

UFO Friday, Dec 14 2007 

Most computer games exist only within a very limited period of time. As computer abilities grow new games with better graphics and more complicated AI take minds of the players. But some of them remain enjoyable for years and become the ‘cult’ games. One of such pearls is ‘UFO: Defense’ (also known as ‘UFO: Enemy Unknown’) and its sequel ‘UFO: Terror from the Deep’. Released in the very end of 1993 it featured pseudo-3D graphics in tactical mode and polygonal 3D globe in geoscape mode. I’m writing this in the very end of 2007 and I admit that I still play in this game occasionally and prefer it to many other modern games.

Searching for the ‘ufo game’ you’ll find a number of remakes, but none of them matches popularity of the original. The only good one is ‘Pocket UFO’ but it’s more of a clone for a pocket pc rather than a remake. So looking back over the 14 years of the game existence I’ve tried to capture what was so great about this game that made it such a success.

1. Two games that feel like one.

First is called ‘geoscape’ and it shows the Earth globe; you build bases, do research, earn money, hunt UFOs and manage equipment. Second is called ‘tactical’ and there you directly manipulate soldiers to eliminate aliens on terrain. The great thing about these sub-games is that they heavily influence each other. Weapons available in tactical mode should be bought or researched and produced in geoscape mode; if you arrive at the UFO crash site in the night it will be dark; aliens and artifacts captured in tactical mode influence research and income in geoscape mode. Most other games concentrate on tactical part and have only rudimentary support for exchanging weapons or carrying them to the next mission.

In other games I often feel myself quite disappointed when I can’t take all captured weapons with me to the base or to the next level; in one well-known game I can take as much as my soldiers can carry in their hands so in the end of each level there were piles of ammo and rifles and my soldiers took most valuable items from the piles – why not just take everything automatically as in UFO? Someone thought that it would be more realistic but in the end it hurts gameplay.

2. Diverse and well-balanced activities.

In a typical ‘strategy’ game user most of the time clicks on units to go somewhere and attack someone. Interest to the game is kept by giving user new landscape and new weapons. Such limited gameplay quickly becomes boring. The great thing about UFO is that there are many more developed activities – managing research, production, building bases, tracking expenses, hunting UFOs and so on. And what’s most important is that they all affect each other. The game allows to build organization where I handle all aspects of it’s existence; this gives me the feeling of control and this means satisfaction…

Example of balance is weapons system: there are three categories of firearms – conventional, laser and plasma. The first one is always available and you may buy everything any time but it’s not very powerful. So you use it at the beginning of the game. Laser weapons should be researched first and you may gradually shift to it. Plasma is the most powerful; it also should be researched but it should be captured from aliens first. So you use plasma weapons in the end and laser weapons turn out to be a dead end. But the top laser weapon – laser cannon – is the best item to produce! It gives the most income so it still makes sense to research it.

3. Atmosphere.

And this one is a hard thing to describe. I think that most of it comes from comics-style pictures and ufopedia (internal library of all available knowledge at the moment in a game). But other things like colour scheme and tragic music also influence the mood. Modern games that use animated 3D models look similar to each other; maybe just because they are not so dark…

Next Page »