Tuesday, June 29, 2010

The difference between social democrats and transhumanists

Genetic testing tells some people that they have a high risk of disease. They can prepare for it if they hear about the illness years before its onsalught.

FuturePundit predicted in 2007 what actions people will take when genetic tests reveal information about their future:

But which risks will be worth testing for? Those you'll be able to do something about. Suppose a genetic variation makes Alzheimer's inevitable at middle age and that diet has little influence on when you'll get it. Well, I guess you could decide to avoid taking on family responsibilities that you won't be around to fulfill. But initially the biggest potential for doing something about a risk will involve risks that can be influenced by diet or exercise.

...

What you should do when you discover 5 or 10 years hence that you have high genetic risk of a disease: Write your elected officials and argue for more research on the disease you are on course to get. Lobby for cures for diseases that will otherwise kill you and your loved ones.

This is exactly what Sergey Brin did when he discovered by genetic testing that he has a hereditary risk for Parkinson's disease.

The article also contains a description of social democratic attitude, where people are considered helpless victims rather than players who execute moves to improve their position in the go board of life:

In the study, a team of researchers led by Robert Green, a neurologist and geneticist at Boston University, contacted adults who had a parent with Alzheimer’s and asked them to be tested for a variation in a gene known as ApoE. Depending on the variation, an ApoE mutation can increase a person’s risk for Alzheimer’s from three to 15 times the average. One hundred sixty-two adults agreed; 53 were told they had the mutation.

The results were delivered to the participants with great care: A genetic counselor walked each individual through the data, and all the subjects had follow-up appointments with the counselor. Therapists were also on call. “People were predicting catastrophic reactions,” Green recalls. “Depression, suicide, quitting their jobs, abandoning their families. They were anticipating the worst.”

Thursday, June 24, 2010

This is a wrong place to debate Nokia's technology policy, since NDAs make it impossible to recite evidence.

The previous post got a lot of attention, but unfortunately you won't see similar topics in the future. This blog will continue to be about my private life and interests.

Sunday, June 20, 2010

Nokia, the next Geoworks?

Summary: Nokia gave a profit warning, because their high-end phones do not sell well. This post compares the problems of Symbian, Nokia's high-end phone OS, to Steve Yegge's analysis of why Geoworks went bankrupt.



What Geoworks?

Geoworks was a software company which wrote a windowing system and applications in assembler. In the end, it went bankrupt in the end of nineties. When Steve Yegge wrote about the benefits of high-level languages, he used Geoworks as an example how using low-level languages takes a toll on business.

His argument is that low-level languages make optimization impossible and implementing features slow. After the system reaches a critical point in complexity, usability starts to suffer. User see sluggishness, bugs and lack of features.


...But it's because we wrote fifteen million lines of 8086 assembly language. We had really good tools, world class tools: trust me, you need 'em. But at some point, man...

The problem is, picture an ant walking across your garage floor, trying to make a straight line of it. It ain't gonna make a straight line. And you know this because you have perspective. You can see the ant walking around, going hee hee hee, look at him locally optimize for that rock, and now he's going off this way, right?

This is what we were, when we were writing this giant assembly-language system. Because what happened was, Microsoft eventually released a platform for mobile devices that was much faster than ours. OK? And I started going in with my debugger, going, what? What is up with this? This rendering is just really slow, it's like sluggish, you know. And I went in and found out that some title bar was getting rendered 140 times every time you refreshed the screen. It wasn't just the title bar. Everything was getting called multiple times.

Because we couldn't see how the system worked anymore!


Which is higher-level language, C or C++?

One benchmark of language level is how many lines of code are needed to implement a feature. In high-level languages, the compiler does more work. The programmer has to write less code. This means that implementation is faster. There are also less bugs, since the lines of code which were not needed don't contain bugs, and because debugging is easier in small haystack.

C language is infamous for being low-level. Therefore it's paradoxical that Symbian Open C is a advertised as a productivity tool. But sadly it really is a productivity tool compared to Symbian C++.

The examples below demonstrate why. The snippets below read a configuration variable from a file. The scenario is that we want to run automatic system tests on a communication protocol and to automate the selection of an access point. It is stored in format "accesspoint=Winsock". The important thing here is the length of the listing, not the exact content.



// Read a configuation variable with 35 lines of code.
_LIT8(KAccessPointId, "accesspoint=");
TBool ReadAccessPointNameL(const TDesC& aFileName, TDes& aResult)
{
RFs fs; // File session
RFile file; // File handle
TBool apNameFound = EFalse;

// Connect to file server
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);

// Open file for reading
if (file.Open(fs, aFileName, EFileWrite) == KErrNone)
{
CleanupClosePushL(file);
// Read the file to memory (we can't use line-by-line
// reading with TTextFile, since it can't handle 8-bit text)
TInt size = 0;
User::LeaveIfError(file.Size(size);
HBufC8* content = HBufC8::NewLC(size);
User::LeaveIfError(file.Read(content->Des());

// Find the start and end of the access point name.
TInt start = content.Find(KAccessPointId());
if (start > KErrNotFound)
{
start = start + KAccessPointId.Length();
TInt end = start;

// Find the next newline.
do {
end++
} while(end < content.Length() &&
(*content)[end] != '\r' &&
(*content)[end] != '\n');
}

// Save the result.
aResult.Copy(content.Mid(start, end - start));
apNameFound = ETrue;
}

CleanupStack::PopAndDestroy(content);
CleanupStack::PopAndDestroy(&file);
}

CleanupStack::PopAndDestroy(&fs);
return apNameFound;
}



The same in C:



// Read a configuation variable with 20 lines of code.
const char* access_point_id = "accesspoint=";
char* read_access_point_name(const char* file_name)
{
char* result = NULL;
// Open file for reading.
FILE* file = fopen(file_name, "r");
if (file) {
char line[200];

// Read line by line and search for access point variable.
while(!result && fgets(file, line, 200)) {
if (strstr(line, access_point_id) == line) {

// Remove newline.
int len = strlen(line);
while (line[len - 1] == '\r' || line[len - 1] == '\n') {
line[len--] = 0;
}

// Get the value of the variable.
reuslt = strdup(line + strlen(access_point_id);
}
}
fclose(file);
}
return result;
}



Symbian C++ was written before people really knew how to do object-oriented programing. They completely botched all the APIs. The horrible descriptors were designed to counter memory overflows, which C functions don't check. Nowadays they just clutter the code. Symbian takes pride in being a microkernel OS, so they require the programmer to connect to servers to start sessions. This adds further lines. The exception handling with cleanup stacks vomits more useless lines. And if you think this is ugly, you haven't seen anything, like the use of active objects in the socket interface.

One C++ selling point is the syntax for classes. Well, Symbian has a 68-page coding convetions which gives very explicit rules how to name classes and which functions they should at least have. This nitpicking makes classes heavy structures, and decimates any advantage from syntactic sugar. Virtual functions are the only part of C++ which wasn't assaulted. Even templates were banned as too error-prone.

So Posix C really is a higher-level language. Just for comparison, here is the same in Ruby.



# Read a configuration variable in 9 lines of code.
def readAccessPointName(fileName)
file = File.open(fileName, "r")
file.each_line do |line|
if (line =~ /accesspoint=(.*)/)
# The (.*) in regular expression caught
# the access point name to $1.
return $1.chomp
end
end
raise 'No access point name in file ' + fileName
end



So it is unsurprising that App store contains 225000 appplicaitons while Ovi store contains just thousands.


GeoWorks attempted to get third party developers but was unable to get much support due to expense of the developer kit — which ran $1,000 just for the manuals — and the difficult programming environment, which required a second PC networked via serial port in order to run the debugger. (source)


But it's the user experience that counts...

Symbian phones are famous for having equal features but lower usability than iPhone. To demonstrate how difficult programming is visible in usability, I'll tell you about usging the file browser to read log files. The plain text viewer has several defects. If you open a large log, it announces out of memory error and shuts down. It underlines randomly some content which it thinks might be a link. It can't choose a small font to show lots of content, so you only see a few lines at a time. Luckily, there has been some progress in plain text viewer. Earlier, it used to crash with medium-sized files. Now it either shows it or announces error.

The way I see it, these defects reflect the difficulty of the programming platform. Usually programmers have some professional pride, which makes them fix errors and usability defects with time. What could be stopping it? We can only speculate.
  • Customizing the UI component which shows text would require too much work, since platform doesn't support dynamic loading and presentation.
  • Low level language necessitates big project sizes. This dilutes responsibility so that no one is responsible for the plain text viewer in the "buck stops here" sense.
  • There is a culture of fixing only showstopper bugs and leaving others there, since there isn't time to fix all bugs, as fixing a single bug is slow.

This way, we get "multimedia computers" which can't display plain text.

It doesn't have to be this way

Nokia does fine in low-end phones, which use the closed Series40 OS. Also the Maemo/Meego platform is promising, however the phone in N900 is still fresh software, creating issues in sound quality and usability. They haven't had time to finalize the phone. In compatibility with major desktop operating systems, Maemo's Linux kernel runs circles around Symbian. This will show up in usability sooner or later. You can always strip down the user interface to produce a simpler phone which is easier to use, but you can't put the solid Linux infrastructure to a Symbian phone.

In the long run, I'm optimistic about Nokia's future. Once they finalize the phone on Maemo and scrap the Symbian platform, they'll be fine. If you want to capitalize on this, the right time to buy Nokia shares is just before they start selling their next Meego phone. However, make sure that the press agrees that Meego has good phone, battery life and usability - if they botch them on Meego, they won't recover. However, I'm not putting my money where my mouth is, because I have enough economic Nokia risk in my life already.

Monday, June 14, 2010

FTO inverses the meaning of some symbols.

In some circles, owning an iPhone is a symbol of waste and disorganized life.

Naturally, people who advertise iPhones aim to associate different images with their product, and they are very successful at it since it sells so much. Don't ask me what it signals for those who buy them.

Neither group is "countercultural" in any way. They are both as mainstream as it gets.

Sunday, June 06, 2010

5 spheres of being human

People are similar in their vulgar tastes and different in their refined tastes. Below I list 5 things which are common to most people. The viewpoint here is how people can connect by talking, or alternatively to appeal to masses, despite knowing little about each other.
  • 1) Humans are physical beings. They eat food to get fuel and nutrients. They must exercise to stay healthy and fit.
  • 2) Humans are sexual beings. We are sons and daughters of people who fucked.
  • 3) People are social beings. Most of us can imagine ourselves to other people's shoes. Few prefer solitude to other people's company in the long run. We have instincts which analyze our status and role in the group.
  • 4) People are thinking beings who imagine, anticipate, analyze and read and write texts.
  • 5) People are mystical beings who have tendency to search answers to religious, spiritual and supernatural questions and experiences.

Unifying and separating spheres


SphereRole
PhysicalUnifying
SexualUnifying
SocialMixed
ThinkingSeparating
MysticalSeparating

In unifying areas of life, people undestand and believe what you say unless there is sepecific reason to doubt. For example if you say "I don't want to do it since it makes my back hurt" or "I'm horny" or "It would be so embarrassing", others believe unless they have specific reason to doubt you. For example, if a stripper wears a shirt saying "Mun tekee mieli", people know that she's doesn't mean it but manipulates you to separate you from your money. Social sphere is mixed, because it is common to question social evaluations ("There's nothing embarrassing in it").

When I say that thinking is a separating sphere, I mean that people doubt you if you say "believe me since I know this thing better than you do". Appeals to Thinking are credible only if the others agree already or the person has high social status, and even then they provoke resentment. Thinking filters people to narrow tranches which are on the same wavelength - for example most text-only blogs have few readers, and they appeal mainly to Thinking sphere.

By mystical exprience I mean a sense that some supernatural being is sending you a message or channeling itself through you. Believers do this when they aim to channel God by implementing His will on earth. You may interpret this metaphorically to mean a state of increased mental clarity or perception where your brains send positive feedback for getting into right condition. Outside religion, people have hard time even describing their mystical experiences, and those who can describe them have trouble interpreting what they mean.

Balance between spheres


Unfortunately blogs concentrate too much on Thinking and this may produce illusion that it is somehow more important than the other areas of life, more deserving of attention and analysis. During last years I have grown to hate this bias.

You are missing out much in life if you don't do any sports, if you don't have a sex life, if you don't have meaningful weekly social interaction, if you don't have any intellectual hobby or if you vehemently deny the possibility of mystical experiences. Two of these 'lacks' are pretty unavoidable: In the sexual sphere, not all men are needed, and nobody is interested in old women. In the mystical sphere, the experiences are rare.

There are lots of insults on people whose development is uneven in various spheres. "Meatheads" concentrate too much on physical. "Wankers" neglect sexual. "Wierdos" don't have their social instincts in place.