My Rambling Thoughts

The Facebook selling pressure

finance

Initial shares: 421 million, 241 mil of which are from existing stockholders.

Existing stockholders? Yes, Facebook is on SecondMarket, something like a "dating website" for companies and investors to find one another. It's a way to get significant funding without going public.

Well, 421 mil shares in the public. It's just the tip of the iceberg. There are still 2.1 bil shares outstanding.

Here are some very interesting dates:

Lock-up Shares
+91 days 268 mil
91-181 days 137 mil
+181 days 1.2 bil

Do you have a date on 17 Aug and 15 Nov? :devil:

Tweaking the COE

transport

News: 3 changes to COE supply to kick in from August

Date: 30 May 2012. Source: ST.

Car buyers will get a small reprieve as a planned cut in COE supply from August will now be more measured. In an announcement following Transport Minister Lui Tuck Yew's pronouncement on mitigating the COE supply crunch early this month, the Land Transport Authority announced three measures.

Basically, the idea is to "borrow" from the expected high deregistration from the 2004 and 2005 cohort.

This can have some unintended consequences — it could make things worse in 2015.

There is an expected 100k cars at their 10-year mark in 2015. Many people are expecting the COE to fall because most of these cars will be deregistered, freeing up 8,000+ COEs per month. That's 6x the quota now. However, it won't fall back to its $10k value for two reasons:

  • These people would want to get another car if possible
  • LTA is always tweaking the COE formula

My Wild-Ass-Guess (WAG) is that the cat A COE will be around $30k.

Long term quota

There are 603,723 cars on the road as of Dec 2011. Given that we have hit the max road capacity, I'll say the long term plan is to have a stable annual quota. That works out to be 60k per year, or 5k per month. It is likely that LTA will withhold any excess of that to give to the lean years (2020-2023).

CPF Minimum Sum up and up

finance

The CPF Minimum Sum will be raised from $131k to $139k from July this year. It is supposed to be equal to $120k in 2003, adjusted for inflation.

The Medisave Minimum Sum is also increased from $36k to $38.5k.

In simple English: you will not see the first $177.5k of your CPF money. (Any shortfall in Special or Medisave a/c will be taken from the Ordinary a/c at age 55.)

The CPF is a good intention from the point of the state: to make citizens pay for their own "pension". But you know what they say: the road to hell is paved with good intentions.

Because the CPF locks up your money for over 20 years, by when it devalues by half or so, the way to maximize its value is to use it today.

3G hotspot to the rescue!

One of the cheapest broadband service in Malaysia is 512 kbps at RM66 per month.

It's not too bad, unless you only use it about two weeks a year.

A better option is to use prepard mobile broadband.

500 MB costs RM15 (valid for a week), 2 GB costs RM40 (valid for a month). Top-up is 1 GB for RM10 (3 days validity). Pretty good!

Being an opposition candidate

You'll never really know someone until he runs for election.

DPM Teo Chee Hean asked a fairly seemingly innocent question why WP did not send Mr Png Eng Huat to the parliament as NCMP if he was the best candidate.

I thought the question sounded illogical. Obviously Gerald Giam was the best man then. If Mr Png became a NCMP then, then DPM Teo would have asked the same question to Mr Giam now.

Mr Png told the bait and replied that he was against the NCMP scheme and opted out of the balloting.

Unsurprisingly, the minutes of the voting leaked out the next day. Mr Png was on the balloting list.

The damage was done: Mr Png's honesty and integrity was called into question.

Luckily, it was contained, because Mr Low clarified that everyone from the East Coast GRC team was on the balloting list, whether they wanted it or not.

And Eric Tan, who quitted WP because he wasn't selected to be the NCMP, came out to say Mr Png told him and others he wasn't interested to become a NCMP.

It isn't easy to run as an opposition candidate. PAP loves character assassination. You better live like a holy monk, or PAP will pick up any dirt on you and magnify it 100 times.

While I think WP will still win Hougang, I think it is an uphill battle.

Things against PAP: lack of public housing, cost of living, public transport, foreigners, the usual.

Things against WP:

  • This situation was entirely caused by WP
  • Some may desire estate upgrade now
  • Mr Png's "character issue"
  • Mr Png's track record

Mr Png described himself as a "semi-retired" businessman. I thought it sounded strange. Why "semi-retired"? Why not just businessman?

As usual, a newspaper investigated and found that Mr Png has closed 8 companies in 12 years (1990 to 2002). The first impression anyone would get is, what a poor track record. This is far easier than for him to explain in detail why he did that.

Three issues

Question 1. No one brought up the issue of Mr Yaw. We can understand WP's position; it is awkward for them. But PAP? Well, their side isn't that clean either. While the politicans are clean (their public image, at least), their "lackeys" aren't. Remember the under-18 prostitute case? PAP would rather not go anywhere near it.

It did seem to me WP should have fielded a woman. It should be easier for the public to accept.

Question 2. The mole. When the minutes was leaked, everyone thought it was a PAP insider. However, the "mole" said he revealed it because he couldn't stand to watch Mr Png lying. What a idealistic morally upright simpleton. You know the saying: with friends like these, who needs enemies?

It seems to me DPM Teo already knew the minutes beforehand, that's why he was able to ask such a directed question. So, there should be a PAP mole somewhere.

Question 3. Why does the opposition wash its dirty linens in the public so often and yet we never hear of such things from PAP? Did they swear an oath to their brotherhood? Difference in characters? Or to avoid economic backslash? We can't tell, except that we know it is really effective.

Facebook, nay, never heard of it

Strong insider selling.

Underwriters stepping in to hold the price at US$38.

Heard they won't do it anymore. Monday is going to be interesting.

Frozen grapes

Frozen grapes

Just the way I like it.

There was one time I put a bunch of grapes in the freezer because I wanted to cool them down quickly. However, I forgot about them, so they were frozen when I took them out.

And I found that I like it! :lol:

Speeding up PowerGrid

PowerGrid takes too long to play. I may try these to speed up the game, so that it can be finished in one hour.

Fast forward

The initial plants #3 to #6 are too inefficient. So, we'll start with power plant #7.

Everyone starts with two power plants by bidding. This is the same as skipping the first two rounds of the game.

Everyone places two free cities. This is the same as skipping one or two rounds of the game. Just five cities to go to Step 2!

Tweaks

Bidding is one-round only. This just forces everyone to bid their max value right away.

No hogging of resources until Step 3. It can take time to think whether to hog resources or not. Most of the time, we don't want to do it anyway.

Faster market obsoletion. If the lowest power plant in the market is less than #20, it will be removed at the end of the round. This is to make interesting and powerful plants appear faster.

Key milestones

The first milestone is Step 2. There is typically a "stall" situation just before this event where some or most players are boxed in and are unable to expand. Once Step 2 is reached, the cities open up again and players can expand once more.

(We may need some tweaks to deal with the stall situation, as it just drags the game.)

The second milestone is when the high-capacities plants become available. These can power 5-6 cities each. By this time, the end-goal of 15-17 cities is near, and whoever powers the most cities win.

Tale of four teats

Tale of Four Teats

We planned to use the Philips AVENT system, so we started with 2 feeding bottles with 1-month teat (top left). We thought there was no point getting the 0-month teat.

We were wrong; the 1-month teat flowed too fast for the baby. As a result, the milk tended to spill and it was a chore feeding the baby. (There was just enough milk, so we couldn't afford to waste a single drop.)

Two weeks later, I got the 0-month teats from my brother. It was still too fast for the baby, so the milk still spilled. It took at least 30 minutes to feed the baby in a start-stop manner.

After struggling for a month, Missus found the NUK latex teat (top right). It was a good fit. Finally, we could feed the baby with almost no leakage.

We had to get a new set of NUK feeding bottles as the NUK teats weren't compatible with the AVENT system.

But there was a problem, for me at least. The baby took his own sweet time to finish his feed. He drinks at a glacial pace of 1-1.5ml/minute, so 50ml could take 50 minutes!

The worst thing was, the baby sucked in a lot of air, so it was extremely difficult to burp him. He needed to be burped multiple times.

After a while, I found that it's easier to burp him once, then let him lie down. He'll be uncomfortable under 2 minutes. Then, lift him up and burp him again. Repeat as needed.

Needless to say, it was very time consuming.

After a really long time, I finally figured out why. The baby was latching onto the teat firmly, and that stopped the milk flow. I could prevent that by angling the teat slightly. I can tell because air bubbles would escape as the baby sucks in the milk.

(I have stared at the feeding bottle for so long that I can gauge how much milk is left — while still feeding the baby.)

With my new technique, the baby could finish 80ml in about 15 minutes. That's pretty fast! He also needs to burp just once or twice.

A side-effect is that the baby is more prone to throwing up milk, so I have to handle the first burp more delicately. (The baby tends to throw up a short while after he burps.) Because of this, Missus didn't really like me to use this technique.

The problem with the latex teats is that they wear out pretty fast; they lasted a mere 1.5 months. A pair costs $7.90. I don't mind buying it monthly, actually. But Missus doesn't like the latex teats as they get sticky as they degrade, so I bought the silicon teat (lower left).

I bought S-size (0-3 months). The baby sucked and sucked, but he couldn't drink, so he cried. This happened on every feed, and we had to switch to the old teats every time. We kept trying because we thought it takes time for the teat to break in.

I finally figured out why after one day. The reason was, the baby was using M-size (3+ months) latex teats.

When we first used the M-size latex teats, we were worried the flow would be too fast. But the baby drank fine, so we continued using them. I had forgotten about it.

(We got the M-size latex teat because it was bundled with the feeding bottle.)

So, I bought M-size silicon teats.

And... the baby doesn't really like it that much; it's too hard for him. He will only drink it if he is exceptionally hungry. Otherwise, he'll refuse to drink.

Just when we thought we had to go back to the latex teats, it dawned to us that our day-time nanny has no problems feeding the baby! Hmm...

We asked what teat she used. Pigeon.

So we got that (lower right).

Amazingly, it was totally effortless. 80ml in 10 minutes, zero spillage. Wow, just wow. Finally, feeding became straightforward after three months.

Downside: the baby tends to throw up — a lot. We have to take care not to lift the baby up for a couple of minutes.

Moral of the story? Not all teats are alike. Try another one if there is difficulty in feeding the baby. Don't invest too much into one system first.

The Red Diamond

Red Diamond 3D Crystal Puzzle

I first saw the 3D "crystal" puzzles in Toys "R" Us. I found them quite attractive, although Missus did not think so.

But they are quite expensive at S$15.90 for the smaller ones and S$39.90 for the bigger ones.

ToyStation sells one for S$8.90, but they have very few sets.

As a puzzle, I don't think it is easy to solve. There is no obvious pattern to the pieces, so it is entirely trial and error. Luckily, the instruction manual has a "cheat sheet", so I just followed the pieces' order. :-P

I'm thinking of getting a couple more for decoration purposes. As for the price...

We can get the small one at about S$2 on Tao Bao, and the large one for S$5-6. Can anyone not be astonished by the price differential? :-O

(Moral of the story: the S$ goes a long way overseas. Corollary: keep your expenses to a minimum in Singapore.)

Successful red bean soup!

Homemade Red Bean Soup

Tired of making soya bean drink (too much work), Missus decided to make red bean soup this time.

It's very easy, she said. Add red beans and sugar cubes to water and boil.

That sounded suspiciously like her recipe for soya bean :-D, so I asked her if she has cooked it before.

She said she had.

Did it turn out normal? I asked. I will check out Youtube, I said.

Surprisingly, it is that simple. Missus was vindicated. Well, she can't fault me for my lack of confidence. :lol:

The only catch is, you got to boil for one hour! (The gas bill.. *ouch*)

Closure: harder than it looks

programming

I'm unable to come up with a way to implement closures.

Yes, I know the activation records must be heap-based.

It is the only piece missing before I can implement a JavaScript-like language...

Still trying. :-)

Transition point

I'm officially past middle age. :cry:

Thomas train set

Thomas Crossing the Bridge Set

Never in the world have I thought that I would own this.

I must admit, it is quite fascinating to watch the train go round and round. :-P

Now I'm thinking of buying more rails. :lol:

I want to build a layout where multiple trains share the same track without collision. Call it puzzle-solving. :-D

rand() rant!

programming

I was very surprised when this code went wrong:

const char digits[] = "0123456789";
char str[6];
int i, len;

for(i = 0, len = strlen(digits); i < ARRAY_SIZE(str) - 1; ++i)
    str[i] = digits[rand() % len];

str[ARRAY_SIZE(str) - 1] = '\0';

printf("%s\n", str);

I expected a 5-digit string. Instead, random characters were printed.

After staring at the code for half-an-hour, I decided to print out rand():

for(i = 0, len = strlen(digits); i < ARRAY_SIZE(str) - 1; ++i) {
    int r = rand() % len;
    printf("r %d\n", r);
    str[i] = digits[r];
    }

To my surprise, negative numbers were printed! According to the rand() spec, it is supposed to return an integer between 0 and RAND_MAX.

It turns out that the rand() implementation was switched to this:

int rand(void) {
    return hw_block.timer_in_us;
    }

Which is an unsigned 32-bit integer. If the MSB is set, then it becomes a negative integer!

Returning the current timer tick may be a good idea if we need just one random integer, but if we need a series of them... this is about as non-random as it can be.

Subtle bugs?

You can argue my original code was wrong. strlen() returns size_t, not int. Using size_t won't have this problem, because it is unsigned.

Should we even use strlen()? Since digits is of a known length, we can replace it with ARRAY_SIZE(digits) - 1.

However, I don't like this approach because of the -1. Why do we need to minus one? Because of the trailing NUL that terminates the string.

I like to do this:

const char digits[10] = "0123456789";

...

    str[i] = digits[rand() % ARRAY_SIZE(digits)];
...

Which is in the spirit of other arrays.

This is legal C. It is explicitly allowed for cases like this. However, some C compilers issue a warning for it.

I'm going to do this in the future:

const char digits[] = { '0', '1', '2', '3', '4', '5', '6', '7',
  '8', '9' };

The unlucky 80

48 charged so far, 32 to go.

The easy question: why all high-flyers? At $450 to $750 per encounter, who do you think is willing to pay?

This is just one girl. Would this have been gone completely under the radar if she is above 18 years old? The hard question: are there more out there?

(But if you are really wondering, the answer is yes.)

Why do I say these men are unlucky? Her modelling website lists her age at 18 years old, the youngest possible for commerical sex. It's not like these men were looking for under-18 girls. These men were conned.

But that doesn't get them off the hook that easily. The law says 18. Unwitting or not, they still broke the law. The Singapore Government is known to interpret the law strictly when it suits them.

And it looks like the prosecution is out to shame these men thoroughly. Name, date, time and venue? All reported.

And it is succeeding. First, nobody likes to admit to visiting prostitutes. Second, these are people with good careers and/or reputation. That's gone overnight.

Photographers camped outside the Sub Court to snap photos of them. This is standard procedure. Scandals sell papers.

Some of the charged went to extremes to hide their faces. But some didn't. They just walk in and out calmly. :thumbsup:

So far, the champion is the 45 years old businessman, with a total of 4 encounters. But he is a businessman. What he does is his own business.

The only two with moral hazard are the primary school principal and the secondary school Head-of-Department. But this does not automatically mean that they will act improperly towards their charges.

The only people who cannot accept that are the Men-in-White, who cannot tolerate even a speck of dust, and simple-minded folks who grew up under their rule believing things are always black-and-white.

What I think

I'll say it's a "confluence of factors" that lead to the situation today. (Thanks to SMRT for an English lesson.)

On one hand, we have high-ranking and highly-paid folks who need an outlet, but they cannot risk being indiscreet in the real world. Thus, they opted for the highly discreet Internet-based "modelling" services.

On the other hand, we have girls who know they can take the easy way to "success", if you measure it by money.

They are able to command a high price for two reasons, I think. One, they are young. Two, they are locals.

(A quick detour: $450 x 80 = $36,000. If the girl takes 50%, it's $18,000. At 4 encounters a day, that's just 20 days work! Good money.)

And they do. The only problem is that they have to wait until they are 18, and some cannot wait.

Today, even a 15 years old girl can be very mature looking. Looks are deceiving.

Higher and higher!

transport

Cars up to 1.6L, $64,201. Cars above 1.6L, $91,000.

Wow, just wow.

$64k could get you an entry-level bread-and-butter Japanese car in 2007. Now? A piece of paper.

By the way, $91k means $24.90 per day over ten years.

Overtaken by times

Today, we are witnessing a transition from notebook / desktop to tablet / smartphone. This is a game-changer for many companies and not all the traditional big players will make it across.

Let's take a look at a few of the companies and their products.

Intel

Intel is the king of the desktop with its Intel x86 chips. It has won the desktop war against all its RISC competitors — Alpha, MIPS, PA-RISC, PowerPC and SPARC — (it was the underdog) and also against its long-time x86 competitor AMD.

But it has no presence at all in the mobile space. ARM is the king there.

Intel wants to use its Atom CPU, but it is handicapped for two reasons. One, Atom is not low-powered enough. But that can be solved, especially given Intel's technological might and manufacturing prowess.

Two, Intel does not want Atom to cannibalize its more powerful (and expensive) CPUs. And this is more critical because it's like Intel has one hand tied behind its back. This happens with a lot of traditional big companies as they move into new fields. They are held back for one reason or the other.

Microsoft

Like Intel, Microsoft is also the king of its hill with its Windows OS and Office software. But take a look, where are they on the mobile space? Like Intel, zero.

It's not that Microsoft has not tried. They have entered the mobile market twice — and failed. They have tried to create a pen-based tablet, but it didn't take off.

Microsoft had two problems. First, they didn't make their own hardware. Why not? I suppose they see themselves as a software company. Or maybe they do not want to upset their hardware partners.

Second, their tablet was just a notebook with a stylus. Issues? It was heavy with the keyboard. The OS was the same, meaning you need high-powered CPUs, lots of RAM and HD.

If you look at their attempts, they (i) look half-hearted, (ii) with one hand tied behind their backs.

I believe even Microsoft could not force a keyboard-less hand-based tablet for the simple reason that it would be too different. Their marketing would have rejected it. (Marketing usually can't see a revolutionary change if you put it in front of them.)

Windows 8 is their last chance.

Personally, I don't think Windows will ever make it to the mobile space, but they have a good chance on the tablet. Even so, they may never regain their OS monopoly status.

Adobe Flash

Adobe Flash was the way to achieve animation, fancy effects and stream video on browsers. Until two things happen: smartphones and 64-bit OS.

Flash was also not available on 64-bit OS for a long time, until Flash 11 was released in Oct 2011. But this is still fine because (i) 64-bit OS just became mainstream in the last year, (ii) the user can still run the 32-bit browser, which supports 32-bit Flash.

The killer: Flash was not available on smartphones for a long time. Even today, it is banned on iOS and is only available on some Android smartphones.

If a content provider wants to reach out to smartphone users, he cannot use Flash. In that case, should he use Flash at all? That's the killer question.

This is also why alternative platforms such as Air, Silverlight and Java will fail. They are not universally available.

Adobe, in a final attempt to bring Flash to smartphones, will recompile Flash into HTML 5 for you using its Wallaby tool.

What Adobe is doing is trying to bring the old way to the new medium. Will it work? Maybe. But to me, that's just writing on the wall.

Infinite loop, compiler bug?

programming

An innocent looking loop:

void wait(int *p, int flag) {
    int count = 0;

    while(*p) {
      if(flag)
        sleep(1);
      else
        ++count;
      }

    printf("%d", count);
    }

The compiler compiles it to:

void wait(int *p, int flag) {
    while(*p) {
      if(flag)
        sleep(1);
      else
        while(1) {};
      }

    printf("%d", 0);
    }

The code is buggy because p is not declared as volatile, so the compiler does not know *p can change outside of the program's control.

But the question is, what accounts for the compiler's behaviour? Infinite loop and hardcoded zero.

For a long time, I thought it was a compiler bug. But then I tried this shorter loop:

void wait(int *p, int flag) {
    int count = 0;

    while(*p) {
      ++count;
      }

    printf("%d", count);
    }

The compiler emits this:

void wait(int *p, int flag) {
    while(1) {
      }
    }

An infinite loop!

And then it struck me. The compiler is doing the right thing! For the second and simpler loop, it knows *p does not change within the loop, so it is equivalent to an infinite loop.

For the first and more complicated loop, the if statement is working because the compiler does not analyze into the function, so it cannot tell if *p is modified or not.

On the other hand, it can tell for the else branch, so it makes it into an infinite loop.

I have to chuckle here. Usually, when the compiler is able to optimize a loop into an infinite one, it is usually not what the programmer wanted. :lol:

Coke Light vs Zero

While I was collecting my merchandize after paying for it, the next customer brought up two cans of drinks and asked the cashier, "do you know the difference between them?"

The cashier replied negative. She then suggested the customer to ask someone else. As I was the nearest person, she pointed to me.

I took a look at the drinks. Coke Light and Coke Zero.

Ha!

Technically, there is a difference (they have slightly different ingredients). And their tastes are very slight different. But they are so similar that I take them to be the same product, but in different packaging.

"They taste the same", I said.

The customer wasn't convinced.

Not my problem.

A new set of pens

Pilot G-Tec-C4 pens

My blue pen has run out for a couple of weeks, and I was surviving on a crippled green pen.

Unfortunately, the Pilot G-Tec-C4 pen is not available in many places. You need a real book store.

Finally, I managed to go to Popular, where I got a few pens at once to stock up my supplies. They should last me a year or two.

The last time, I decided to try out a "non-traditional" color. I picked green color. This time, I got light blue and brown. (Green is now a normal color for me.) Let's see how I like them.

I'll love to get refills; they are cheaper. However, they don't seem to be popular (lower profit margin?). Also, the pen itself isn't that lasting. By the time I finished using the ink, the pen itself is also half-spoilt.

Macross blu-rays

Macross is coming to blu-ray in May.

The box set has 7 discs and costs 39,900 yen. The limited edition costs 47,250 yen.

It remains to be seen if the quality is superior than the remastered DVD version. It is a 30 years old cartoon and the production quality was not high to begin with. (There aren't much fine details.)

The movie Do You Remember Love (DYRL), from 1984, is also announced. It'll cost 7,140 yen. The limited edition will cost 13,800 yen. The LE has the Flashback 2012 music video, so it's like 2-in-1.

Both are Japanese-only and will not have English subtitles.

I really want to support them, but the lack of English subtitles is a show-stopper at these price-points.

(I bought several Japanese DVDs, including DYRL, without subtitles before, but I'm not so willing to throw away so much money nowadays.)

I'm not wondering whether Macross on blu-ray will appear as video files — with English subtitles — for download. They will be. I'm also not wondering about the video quality. There will be some encoding groups that put out "archival" versions. The only question is, how large will be files be?

I'm expecting 2.3 GB per 22-min episode (around 13.5 Mbps) and 19 GB for DYRL (115 mins at 18 Mbps).

I think I'll stick to the 720p version for the TV show. I expect just 1 GB per episode (at 6 Mbps).

Electrical charges up, what is new?

YearMin (Cents/kWh)Max
201227.59 (q1)28.78 (q2)
201124.10 (q1)27.28 (q3)
201022.87 (q1)24.13 (q3)
200918.03 (q2)22.93 (q1)
200822.62 (q1)30.45 (q4)
200718.88 (q2)21.38 (q4)
200620.49 (q2)21.64 (q4)
200516.06 (q2)19.57 (q4)
200415.44 (q1)16.35 (q3)
200315.24 (q1)17.81 (q2)

Rising year after year. Very close to the historical peak now.

This is why it is important to use energy-saving equipment. They will help us to save money.

No Java, no Flash, no Acrobat Reader!

CVE-2012-0507 describes the latest known Java vulnerability. It allows an untrusted Java applet to break out of its sandbox. To quote another blog:

This module exploits a vulnerability due to the fact that AtomicReferenceArray uses the Unsafe class to store a reference in an array directly, which may violate type safety if not used properly. This allows a way to escape the JRE sandbox, and load additional classes in order to perform malicious operations.

I'm not worried because I don't have Java on all my computers.

Timeline:

1 Aug 2011 Disclosed to vendor
14 Feb 2012 Patched by vendor
23 Feb 2012 Published
29 Mar 2012 Proof-of-concept (by the good guys)

Good response time. (Right.)

Java is supposed to be a safe language, how can this happen?

I don't want to take any cheap shots at Java. The truth is, programming is hard.

Inventing on Principle demos

The demos presented by Bret Victor have a shock-and-awe effect.

Demo 1

Demo 1

The first demo is the simplest: change a line of code and see the effect immediately. Then he adds on some icing: being able to change numbers via a pop-up slider, or colors through a pop-up color picker.

Demo 2

Demo 2

The second demo builds on top of the first. In addition to immediate visualization, the tool can record keystrokes and allow playback. You can pause at any instance, change some variables and see the effect on the "future".

Demo 3

Demo 3

The third demo is very similar to the first, but with non-visual output. This time, we are able to look at the effect on the function parameters and variables as we write the code.

Demo 4

Demo 4

The fourth demo is simulating a electrical circuit.

Demo 5

Demo 5

The fifth demo is a hand-oriented movie-maker that uses a two-hand input system.

Thoughts

The demo'ed development tools are very impressive. But I very quickly realize there is a "jedi mind trick" involved as well.

Demo 1 is within reach today. There are already experimental development tools that give immediate feedback for HTML/CSS.

But that is missing the trees for the woods. The point here is shortening the edit-compile-run cycle. When the cycle gets compressed, things that used to be difficult or impossible becomes possible and easy. It reminds me of Turbo Pascal.

When we program an embedded system in C, we'll never think about incremental programming. The edit-compile-download-reboot cycle is too long. However, we can do it for JavaScript. Edit, refresh and observe. It's close to immediate feedback.

Demo 2 is not common in development tools, but I expect them in a game editor that is used to create the game levels.

Demo 3 is also not beyond the capabilities of today's development environment. For example, the Microsoft Visual Studio compiles C code as you type. It just needs to go one step further to substitute values into variables.

I thought of another application when I saw the demo: we can use it to generate test cases quickly! (If we can save the inputs.)

Demo 4 is about visualization and simulation. I expect a electrical circuit simulator to have such capabilities already. But Bret's point is this:

Electrical circuit

And I think it is important to ask, why do we have these squiggly symbols in the first place? Why do they exist?

They exist because they are easy to draw with pencil on paper. This is not paper.

So when you have a new medium, you have to rethink these things. You have to think how can this new medium allow us more immediate connection to what we are making. How can this new medium allow us to work in such a way to what we were used to doing?

It is really the same situation with programming.

Our current conception of what a computer program is — a list of textual defintions that we hand over to the compiler — that derives straight from FORTRAN and ALGOL, late 50s. Those languages were designed for punchcards.

...

So there was no such thing as interactivity back then. And that assumption is baked into our current notions of what programming is.

C was designed for teletypes.

Demo 5 is cool. It shows a game-changer which may be missed: a two-hand input system. That is not possible with a single mouse. It is possible with a keyboard and mouse (ctrl-click, anyone?), but it doesn't feel natural. This feels natural.

It is also a good illustration how a new device can change the way we do things.

Whether you are awed by the demos or you dismiss them as mere "jedi mind tricks", Bret's objective is to make you think how things should be or can be, instead of accepting the status quo, just because they are status quo.

Thoughts after watching Inventing on Principle

A colleague pointed me to this video by Bret Victor. I was skeptical that it would be good — Software Engineering presentations are usually dry and boring, whereas UI presentations are all hype and no substance — and was reluctant to watch because it was 54 mins.

I'm glad I watched it. (But I'm still of the opinion that the presentation is too long.)

The presentation is divided into three segments.

In the first segment, Bret demo'ed five highly visual and interactive development tools that are radically different from the current ones. If you are a current practitioner and you are not wow'ed, you're not giving it enough thought. But if you just merely don't see the point or value, then you are the audience Bret wants to reach out to.

In the second segment, Bret talks about injustice and causes. He says barrier to computing is a wrong and an injustice. Although I often thought that our current UI and computers are too difficult to understand and use — just by watching my father use it — I just thought of it as a wrong, not an injustice.

Of his examples, Larry Tesler is the most prominent. He saw that the vi way of editing (command mode vs insert mode) was creating a barrier and dividing people into those-who-get-it (the computer people) and those-who-don't (the non-computer people). He created the editor as we know it today, together with modeless copy-n-paste.

In the third segment, Bret asks us to think about our cause. He talks about the most common path of being a craftsman and the less common path of being a problem-solver. But to have a breakthrough, we must go beyond these and have a cause.

But it is not easy because it takes time to discover what you like and have a broad range of experience to gain insight into problems. Bret said it took him ten years.

His principle and insight, in his own words:

If you choose to follow a principle, the principle can't be any old thing you believe in.

You'll hear a lot of people saying they want to make software easier to use. Or they want to delight their users. Or they want to make things simple. That's a really big thing right now. Everyone wants to make things simple.

And those are nice thoughts. And maybe they give you a direction to go in. But they are too vague to be directly actionable.

...

And likewise, I believe that creators need powerful tools. It's a nice thought, but it doesn't really get me anywhere.

My principle is that creators need this immediate connection. So I can watch you changing a line of code, and I can ask, did you see immediately the effect of that change. Yes or no? If no, I got to do something about that.

And again, all those demos that I showed you, came out of me doing that. That me following this principle and then they lead me to exactly what I need to do.

So if your guiding principle embodies a specific insight, it'll guide you. And you'll know if what you're doing is right.

On barriers

First, on Larry Tesler. His modeless editor contribution is significant, but I view that as an idea whose time has come. Even if Larry did not invent that, someone else will.

But the lesson here is really that Larry saw the barrier, when his fellow computer-oriented compatriots did not.

That is still true today. Even with fancy GUI, computers are still hard to understand and use. There is an underlying principle. If you understand it, it's easy. Else, you'll be struggling.

This applies to GUI as well as programming languages. For example, pointers represent a very high barrier in C. Yet, it is fundamental in C. If you don't get it, you won't get very far.

Object-Oriented Programming (OOP) is another barrier. Many old-timers weren't able to cross it. Luckily, OOP is not the fad like it was ten years ago, so today, nobody really cares whether you use OOP or not.

Even programming is itself a barrier. Some people don't get types, data structures and algorithms.

As seasoned practitioners, we don't always see the problem. We may accept the barrier as the learning curve to overcome. That's something we need to watch out for.