The shield of YAGNI

Diposting oleh good reading on Sabtu, 31 Maret 2007

YAGNI (you ain't gonna need it) is a good principal, but like anything, too much of a good thing isn't very good at all.

Yagni is a tool to keep us on track, to help us make decisions and guide us in our development. Like any other practice, it does not stand on its own without logic and reason. Sometimes its thrown around like my parents used the phrase, "because I said so." And while that works well for a crying three year old who wants to stay up late, any catch all phrase is dangerous.

When I am writing code, I add abstractions I don't need. You can argue this goes against yagni, because you don't need it (and you ain't gonna).

These abstractions are not there to support behavior that may exist in the future. They are added because, when things change (and they always do), it has ALWAYS been a lot more painful when they did not exist.

There is a very distinct difference between this and adding extra functionality or abstractions to enable change you think will happen.

This is an important difference.

Next time you are having a discussion and yagni is brought up, think about which one is driving what you supposedly don't need.
More aboutThe shield of YAGNI

Homemade Sushi

Diposting oleh good reading on Rabu, 28 Maret 2007

Since there are only 3 of us at home this week, decided to make sushi for dinner last night. Despite the fact that I have made these sushi for the 5th time this year, I still couldn't manage to roll the maki neatly :(

I find it very tricky to be able to spread the sushi rice evenly on the sheet of nori (Japanese seaweed). Even if I could get a decent rolled "log" of maki, I always "deformed" them when trying to slice it into pieces. Instead of neat round shapes, they ended up in irregular forms. I wonder how many times I must try before I could get a nice and neat on my maki?!

For the filling, I used crab meat sticks (my kids favorite), cucumber, salmon spread (ayam brand) and some pork floss. The combination of these ingredients was just right, although they were not the ones used in authentic California rolls.

With these basic ingredients, I made 4 types of sushi...Chumaki, Hosomaki, Gunkan-maki and Uramaki.

Maki Zushi
Maki Zushi or rolled sushi is made with a sheet of seaweed spread with vinegar flavored Japanese rice and then rolled up with different fillings. Hosomaki are small sushi rolls about 1 inch in diameter. I simply rolled up crab meat sticks with some mayonnaise to form these thin rolls. The medium ones are called Chumaki, around 1 1/2 inches wide. I have not ventured into making Futomaki which are large rolls, more than 2 inches wide.


Gunkan-Maki (Battleship Sushi)
These are special type of the nigiri zushi(finger sushi). Battleship sushi is make by wrapping a strip of seaweed around a small oval-shaped rice ball, and topped with soft fillings such as fish roe. The collar of nori that's wrapped around the rice ball make the sushi looks like a tiny vessel...hence the name battleship sushi. I made mine with pork floss and salmon spread toppings.

My younger boy enjoyed making the rice balls. Somehow, small kids simply like to play with anything that they could shape with their hands, like playdough and making sandcastles.


Uramaki Zushi (Reverse Maki)
These reverse maki or inside-out rolls are wrapped with the rice on the outside and the nori within. This is supposed to be easier to make than Chumaki as the sushi rice on the outside helps stick everything together when you roll it up. On the contrary, I found it more difficult as the filling couldn't stick on to the nori, as such they were not firmly bounded together. I coated the outer layer of rice with toasted black seasame. The seasame really enhanced the taste of the maki, and they were the most delicious of the lot!

More aboutHomemade Sushi

Xbox is Down!

Diposting oleh good reading on Selasa, 27 Maret 2007

And the oblivion expansion, Shivering Isles, comes out today.

What timing... not like I'd be playing anyway, being that I'm at work and have to paint my living room when I get home :(
More aboutXbox is Down!

Bonus Session

Diposting oleh good reading

Oksana and my session about pair programming is now featured on the bonus session page for devteach, check it out!
More aboutBonus Session

Dried Fig Muffins

Diposting oleh good reading on Senin, 26 Maret 2007


Dried figs are very healthy snacks. A cup of figs will give as much calcium as a cup of milk. Besides being rich in calcium, they are also high in dietary fiber and contain other minerals such as iron, potassium, omega-3 and omega-6 essential fatty acids. I used to eat quite a fair bit of dried figs when I was pregnant, they are really a good alternative source of calcium since I didn't really like milk.

I didn't know that dried figs could be added to muffins until I came across this recipe from a cookbook, Muffins by Williams-Sonoma. It didn't take me too long to get a pack of dried figs to try it out.


Unlike most muffin recipes where dried fruits are simply added to the batter, this recipe recommended that the dried figs be soaked in a mixture of orange zest, apple juice and melted butter for an hour. This softened the dried figs and turned them into a rich mahogany colour. When the muffins were still baking in the oven, my kitchen was filled with this sweet and enticing "perfume" of dried figs. The pleasant aroma lingered till the muffins were completely cooled. The muffins were a little on the sweet side (although I did cut down on the sugar a little), mainly due to the figs. My little one though I have added in a candy in the muffins ! The texture was a little dense, but overall the taste was really delicious. Definitely a wholesome and healthy bake, good for breakfast or as tea-time snacks.

Ingredients:
(makes 11 muffins)

375g dried figs
90g unsalted butter
250ml apple juice
grated zest of 1 orange
315g plain flour
2 1/2 teaspoons baking powder
1/2 teaspoon salt
125g granulated sugar
60g dark brown sugar
2 large eggs, lightly beaten
1 1/2 teaspoon vanilla extract/essence

Method:
  1. Remove the stem and cut dried figs into quarters.
  2. Heat apple juice and butter in a saucepan over low heat until the butter is melted.
  3. Remove from heat and add in the figs and orange zest. Leave to cool until the figs are softened, about 1 hour.
  4. Preheat oven to 190 degC. Grease muffin cups with butter or line with muffin liners.
  5. In a mixing bowl, stir together the flour, granulated sugar, brown sugars, salt and baking powder.
  6. Make a well in the centre and add the cooled fig mixture, eggs and vanilla. Stir until just combined. Do not overmix, the batter will be slightly lumpy.
  7. Spoon batter into muffin cups, filling to the rim of the cup.
  8. Bake for 20 ~ 25 mins, until golden, and toothpick inserted into the centre comes out clean. Transfer muffin pan to cooling rack and let cool for 5 mins. Unmold the muffins and let cool completely.
More aboutDried Fig Muffins

I am no electrician...

Diposting oleh good reading on Jumat, 23 Maret 2007

Considering the amount of time I spent as an undergraduate designing analog circuitry, I thought I'd be a decent electrician.

This couldn't be more wrong.

1. My dexterity skill is low, maybe a 9. I'm a klutz, have poor motor skills, my hand writing is illegible, the list goes on. This does not work well for wire manipulation. Actually this does not work well for manual labor in general.

2. Theoretical knowledge of electricity doesn't help much; it may even hinder you (it hinders me). In general, I like to explain everything, my husband calls this phenomena, Wendy's wack a** theories. I think coming up with connections and reasoning (more like randoming) is a lot of fun. With electricity, my theories are convoluted, usually involve Ohm's law, and are ALWAYS wrong.

3. I lack patience and after failing at wiring a circuit I start hacking away at it, just trying to make anything work... Constantly running back and forth to and from the circuit breaker. Like hacking code, this just wastes time and leads to poor quality. Not the best sacrifice when it comes to electricity in your home.

Recently, I've spent a great many hours changing a light fixture, outlets and switches around the house recently and I've come away with this knowledge:

1. A voltage tester is a worthwhile investment. I don't own one, but I really, really should. Its like coding without a debugger and with no TDD, a debugger would be quite useful.

2. Before you replace existing circuitry, study the current setup carefully before taking it apart. Otherwise, you will be confused by the 8 wires available when you only need 2.

3. Like working with other peoples code, working with others peoples circuits is scary, and things built a long time ago were built, well, oddly. Keep this in mind.

4. Refactor existing circuitry one switch, outlet, etc at a time. Its annoying, because you need to return to the circuit breaker a lot (unless you live on the edge), but at least you are always in a working state and you know when you broke your circuit.

5. If you are replacing an outlet with two pairs of wires, it is either powered by separate circuits or powering something else. You can check the hot side of the circuit to see if the bridge connecting the top and bottom is there -- if it is, then the bottom wires are being powered by this outlet, and you don't need to remove the bridge on the new outlet. If its not, remove the bridge on the new outlet. If you get this wrong, things will break.

6. Having a pair working with you is priceless. They can call 911 for you. And I was told this afternoon that your dog doesn't count (unless it knew how to call for help).

7. No matter how annoyed and frustrated you are, its never a good idea to do one more quick "test" without turning off power at the circuit breaker.

If I approached circuitry like I approached software, I would be a much better electrician! I suspect applying agile and xp methodologies work very well for all home improvements. I hope I remember this tomorrow morning!
More aboutI am no electrician...

Chewy Oatmeal Raisins Cookies

Diposting oleh good reading on Kamis, 22 Maret 2007

Almost two months back, my friend gave me a pack of rolled oats. I have not used it as I have yet to come across any suitable recipes. Lately, I have set some basic requirements when it comes to baking recipes...the amount of sugar and fat to be used should not be too overwhelming so that I could still indulge on the bakes without expanding my waistline further ;)

I finally found this cookie recipe that uses roll oats, with only 1 egg and vegetable oil instead of butter. It's taken from a cookbook, Homemade Cookies by Jacqueline Bellefontaine. The method for making these oatmeal raisins cookies is almost similar to the muffin method, where the wet ingredients(milk, egg & oil) are added to the dry ingredients (flour, rolled oats, sugar, raisins) to form a soft dough. The cookies were lightly browned by around 10mins in the oven, and I gave it a couple more mins to reach golden brown.


This is the very first time I have tasted any cookies that are made of roll oats. I was slightly taken aback by the texture of the cookies. They differ from the familiar crunchy texture I always associate with cookies. Instead, they are rather chewy, probably due to the rolled oats...and the middle is soft and moist, a result of the use of liquid oil, I think. I don't know whether this is the right texture and I seriously think that they are like half-baked cookies!

I personally have yet to acquire the taste of such kind of cookies, but surprisingly, my better half finds it very delicious! Well, like what he commented, "These certainly tasted not like cookies and not like muffins either", but he likes it that way...


Ingredients:
(makes about 36 cookies)

150g plain flour
150g rolled oats
1/2 teaspoon baking soda
150g light brown sugar
50g raisins
1 egg
125ml vegetable oil (I used sunflower oil)
4 tablespoon milk

Method:

  1. Preheat oven to 200 deg C. Lightly grease a baking sheet (I lined the baking sheet with parchment paper for ease in cleaning).
  2. Mix together flour, oats, baking soda, sugar and raisins in a bowl. (I 'plump up' the raisins a little by soaking them in water for a couple of mins.)
  3. In another bowl, whisk together the egg, oil and milk.
  4. Make a well in the centre of the dry ingredients and pour in the egg mixture. Mix together to form a soft dough.
  5. Place spoonfuls of dough well apart onto the baking sheet, and flatten slightly with the tines of a fork.
  6. Bake for about 10 mins. Transfer cookies to a wire rack to cool completely. Store in an air-tight container.

More aboutChewy Oatmeal Raisins Cookies