10
Feb
10

It’s not about the money, but it is

Advice that you frequently hear from successful people is that you shouldn’t embark on a career just to make money. After thinking about this, I think the reason they always say this is because having this belief in itself is an advantage in helping you succeed. External rewards are known to damp intrinsic motivation, particularly if you cognitively decide to do something purely for money. Instead, I believe successful people tend to see money as a measure of their success instead of an external reward. They are using it as a feedback mechanism rather than thinking that the money is their motivation for doing great work.

20
Dec
09

Evaluating Object Oriented Designs

When you’re trying to come up with a software architecture, you’re typically trying to define an ontology of objects. What do objects give us? Code reuse. Therefore any software architecture you create must take into consideration the future changes that are likely to occur. It’s difficult to foresee what problems will come up, which is where experience helps a lot. But when writing the actual code you must always ask yourself “If I write the code this way, will I be able to reuse this code without touching its internals?”

I’ve seen people pay lip service to architectures such as MVC but it’s quite clear when reading the code that they don’t understand that all MVC is really trying to do is allow you to separate the presentation and control logic from the actual data.

Another important aspect of this question is having single source data. For example, in a database you wouldn’t usually want to store a value in two different places where there’s a constraint that the two values must be the same, because if you change one, there’s a potential for a programmer to make a mistake and not change the other.

20
Dec
09

Software Development Scheduling

Scheduling relieves stress. However it is difficult to do accurately predict how much time tasks will take. They must be decomposed and thought about before the actual amount of work can be determined.

Some helpful tips:

  1. Decompose tasks into sufficiently small tasks such that you can determine the length of each task
  2. Give yourself extra time for mistakes and unforeseen costs, I’d say somewhere between 25-50% of what you’ve already allocated.
  3. Give yourself time to learn and evaluate the best way to do something. This is the intellectual of task of examining other people’s work and thinking about interface design, software use cases and requirements, and software architecture as well as various technologies. This depends on how well you know the technologies you’re working with, but it always seems there are things you don’t know about that could help you write better programs. Exploration is key here.
  4. Communication about the software itself is a large cost that is mostly fixed.
20
Dec
09

What Makes a Good Programming Language

1) A good module/namespace/package system. Polluting a global namespace is a terrible idea. Sometimes you’ll see a function in code and have no context for where it’s coming from and it could very likely be ambiguous in a language like php.

2) Static Typing is a required feature despite the increased verbosity because it makes functions well-defined. They take very specific inputs and produce very specific outputs. Without this restriction you must rely on the programmer to not make the mistake of returning different types. For example, in Elgg core which is written in php, a function that fetches objects will either return an array of objects or… false. If you write code that uses this function it’s retarded to write a special case check for “false” instead of iterating over an empty array.

3) Regular expressions and strings library – doing this stuff by hand is a pain in the ass and has been done a million times. Every language should make this extremely easy to do and special case it so its not ridiculously verbose to do as well. (ahem, Java).

4) First class/anonymous functions – this allows for some particularly simple code. e.g. map(func(x){},array()) turns multiline code into one line. It also allows for concurrency, i.e. concurrent_map(heavy_function, big_array);

5) Large, well written library – why rewrite the wheel?

6) Community/Open Source – learn how to write this language well by reading others code.

…and more to come

19
Dec
09

The Algorithm For Getting Better at Anything

Step 1: Attempt to do what it is you want to learn – you will either succeed or fail

Step 2: Analyze why you succeeded or failed

Step 3: Take data from step 2 and modify your behavior when you repeat Step 1 to improve performance.

18
Dec
09

Stress and eating

I think when people are under stress they look for sources of comfort. They play video games, or they eat, or do anything that produces comfort. Sometimes these activities are destructive. For example, comfort eating makes your health worse. Some people advocate exercising or eating well as remedies for stress, but this is difficult to do since stress causes you to stop doing these things. This is attempting to fix the symptoms and not the source of the problem. The fundamental problem is that something in your life is producing stress. From my own self-observations, I get stressed when I don’t work on things that I need to get done. Working hard is not stressful, but not working hard on something that you care about is. Some of the reasons that people don’t work hard on something they care about is maybe they think it’s too hard, or an overwhelming amount of work. This means the best way to reduce stress is first to identify what you care about that must be done. Then you must solve this problem. If the problem is extremely difficult or forbidding, then you must use techniques to break down the problem. I hypothesize that stress is a subconscious belief of the mind that you may be unable to cope with something going on in your life. For example, if you’re house is being taken away from you and you cannot do anything about it, that is an extremely stressful situation since there are no actions you can take to solve this problem. Whereas watching a series of videos to get rid of a parking ticket has a predefined simple path that makes it easy to solve and is therefore not stressful.

Let’s work out an example. Suppose I have to produce some software project within a month. First of all, a month’s worth of work looked at as one whole is a large and forbidding problem. We may never start. The first thing to do is to break this problem down into smaller doable parts. For example, you may mock up a prototype at first, figure out the typical use cases, figure out the software architecture, then write portions of the code. Breaking a hard problem down into easier problems dissipates the belief that the problem is too hard. The other aspect of this problem is, do you have enough time to complete the project? Since you’ve already broken this task down into pieces, you can now attempt to schedule them and see if you’ve enough estimated time to complete them. One thing about this is you should allocate extra time for unforeseen circumstances and this should typically be quite a lot. So for our monthlong example, we would want to complete most of our work by the second or third week and leave ourselves plenty of extra time to complete the work should unforeseen circumstances arise. You may notice that you’ll have to work weekends in order to reach that deadline, and have to work long hours. However, you’ve relieved all the WORRIES that you had about being able to cope with this problem. You know that you can cope the problem with these actions and have turned something that causes stress into a simple solved problem.

Some benefits of this approach is that if you complete the tasks assigned for a particular day, then you’re home free for the rest of the day and can partake in other things in your life. In fact, you are self-incentivizing to finish your work as quickly as possible rather than spread the work out over the course of the whole day. This makes you more time-efficient since you know if you complete your work you can relax and do something fun.

Another tip is to sequence and decompose the tasks for a day such that the easiest things are first and most of the tasks are not too difficult. Sometimes a difficult problem causes people to put off work because they’re worried about it, but if the problems are easy then the cognitive obstacles one must clear in order to start working are much less. Once you start working, then all the obstacles are much less since you are already “in the zone.”

The essence of relieving stress is proving to yourself that you can cope with the problems that come up in life.

The other facet of stress is that some of our beliefs may be preventing ourselves from relieving stress. Suppose you have the belief that you need to be with a certain person in order to be happy. You cannot control what the other person chooses to do, and thus your belief puts you in a position where you are potentially helpless. Putting yourself in that situation is very stressful, but ultimately it is ONLY A PRODUCT OF YOUR BELIEFS. This is when you must reexamine your beliefs and realign them with what is more realistic and healthy. For example, you should believe that there are many people with which you can be with to be happy, and that if you work at it you can find happiness by finding one of these people.

17
Dec
09

Exploring the relationship between teaching and entertaining

Most lectures and textbooks are fairly boring. Why is this? How can we make material more engaging. I think education should look towards entertainment industries for answers. Most material is fairly boring because of the fact lecturers are typically talking about things they understand well and hence have no frame of reference of what the beginner feels. The speaker doesn’t understand his or her audience.

Ira Glass has a youtube series on storytelling that is intriguing (http://www.youtube.com/watch?v=n7KQ4vkiNUk&feature=related). One of the important things he discusses is that good stories provide implicit questions and a sequence of actions. It could be that the human mind has evolved with storytelling as a communication mechanism is central. This means that teaching methods that are closer to stories, which have sequential actions rather than random access discussion, and also creating questions in the audience’s head is a fundamentally better way to communicate material.

I think one good example of this method is The Goal, an operations book which is written as a story. It was easy to digest and was able to get to the heart of the matter, entertaining and fun at the same time.

10
Nov
09

in praise of small changes

Recently I’ve been posting about the way small changes can make a dramatic difference over time. I really think this concept needs to be applied to education as well. Progressions in difficulty need to be defined, and students need to be put in positions where they can succeed. They must be allowed to succeed, to allow that dose of dopamine, to get their behavioral conditioning going and to build a sustainable habit of fun and learning. So much of human potential remains untapped because we don’t realize the subtle conditions required to bring out that potential. Sometimes working hard is the wrong thing to do, and working easy is the way to go.

Students are frequently misplaced in school. The student that received a C in mathematics because his family life was not stable and hence he could not concentrate not only pays the penalty of that year, but also pays compounding interest in the following years. A C in a prerequisite subject leads to more bad grades because topics are clearly more difficult when you do not even know the prerequisites. For a young student this obstacle requires a Herculean effort to overcome, and I would say nine times out of 10 (or worse), these conditions lead to a downward spiral. Strangely enough, this would imply that a teacher would be doing what’s best for a child by failing them rather than allowing them to pass without having adequately demonstrated ability. Failing a child and allowing them to leave school to focus on resolving family stability issues would be more productive rather than attempting to force a student through the material in my opinion.

In sports, where performance is king, this kind of method has always been obvious. Teachers could learn a lot about how to bring out human potential from coaches. I think this is part of why I’ve always loved basketball.

08
Nov
09

How do you know if someone is a good investor?

I’m trying to determine what I should do with my savings, and purely out of curiosity, I’d like to find the answer to the question, “Can an investor actually outperform the index?”

Which immediately brings me to Warren Buffet and The Superinvestors of Graham and Doddsville. Clearly, they’ve well outperformed the index and all follow a coherent strategy. The question then, is this pure luck or is it skill? I think this question is extremely difficult to answer and no one has a definite answer, and hence the value of charlatanism is high in investment. After all, if there were rigorous ways to define investor performance, then there is the implication that we know what the optimal strategy was, and how close to the optimal strategy the investors got. People pretending to be good investors could not be masked by luck.

But as it is, no one knows. In poker, the correct strategy depends only on what cards the players possess, and from that you can measure whether or not someone made the right move or not. The optimal strategy is certainly evident given full information. The only variable that is hard to define is the human on the other side of the table, e.g. (The optimal strategy may be to bet to receive a call, but the opponent will only call bets of value at most X, therefore you should bet X to extract maximum value, if you bet too much you will extract no value from a fold).

In contrast to investing, the way to evaluate a poker player’s skill is on a play by play basis, and not so much on the return a poker player receives on his play. A good poker player eventually makes enough good decisions such that his return will reflect his good play. The number of decisions a poker player makes during the lifetime of his/her career allows this convergence.

In investing, the landscape is incredibly complex, since anything that can happen in the world can effect a players performance. In poker, this would be the equivalent of poker cards suddenly changing or extra cards being thrown into the deck at random times. The expected value of your decisions changes randomly over time, and hence your initial calculation is frequently wrong unless you’re lucky and the world doesn’t change in a way that effects your decision. If you foresaw 9/11, then I applaud you.

Most people cannot predict the future. So how can we make an investment decision that takes this fact into account? I believe the Value Investment strategy of “margin of safety” plays a key role here. It assumes that the initial calculation of expected value is wrong and looks for room for mistakes. The larger the “margin of safety,” the more likely you will make a good return. As a poker player, I find this to be a sound strategy for making better decisions.

So how do you find the “margin of safety?” This implies that you can draw a line in the sand that says how much a security is worth, and this is probably the most difficult part. A margin of safety on the wrong line is deadly. I’m not sure how Buffet does this now, since I think it is practically impossible to find stocks trading below their “instrinic value” (what a company would be worth if it just sold off all its assets). I think he may be simply buying during times when the herd is afraid.

The other problem is that how many performance-measurable decision events does an investor make during a career? Is it enough to allow returns to reflect skill? I’ll let someone else tackle this one.

08
Nov
09

understanding your passion

Finding out what you are passionate about is typically difficult. I’d say that most people don’t know what they’re passionate about, or what passion is in concrete terms. But generally everyone will agree with the statement that passion is necessary for success. Why? Because passion creates motivation, and motivation is the fuel of hard work and practice.

I’ve come to realize I’ve had passing interests in many things, but I’m starting to believe that the way you can identify your passion is to simply let your mind wander, and see where it goes. If you frequently find yourself daydreaming about art, or writing a book, creating a company, becoming a chef, I think you’ve found the inklings of “passion.”

And I think passion is delicate, it can easily be squashed by negative experiences or it can be nurtured in a virtuous cycle to become something truly special. Which leads me to games.

Recently, there’s been media coverage of the success of social games. If you try to play any of these games (I’ve tried playing Cafe World), you will realize that there is a large component of “leveling up.” In other words, you take certain actions to improve your ability or status in the game, and are rewarded in the game by some form of positive feedback such as more experience points or money or items. There is also progressive difficulty in terms of levels, such that as the player becomes more capable, the goal of reaching the next level is made increasingly difficult.

I was chatting with a friend over dinner recently, and he told me that his theory of what makes games fun is that they are a metaphor for life. We constantly are trying to achieve and improve in life, and tangible rewards, accomplishments, and achievements are forms of positive feedback that push us along these paths. Maybe this is why people escape to video games, because in their own life they have not been able to “level up” – possibly due to outlandish expectations for the next level, or some other environmental phenomena preventing progress and reward for progress.

This leads to the interesting conclusion that to stoke the fires of passion, we must use goal-setting and motivation theory from psychology. Set goals that are reasonably achievable, and in the beginning they should be quite easy. Accomplishing the goal is typically its own reward. Increase the difficulty as you go along such that the task is not too difficult nor too easy. This is the virtuous cycle of what may otherwise be called intrinsic motivation. I think this is also why I’ve frequently heard of professional coaches avoiding putting athletes in positions where they will fail badly or be humiliated, as these elements most likely reduce motivation. People must have goals where they occasionally fail, but if the goals are hopeless then they may lose motivation.




 

July 2010
M T W T F S S
« Feb    
 1234
567891011
12131415161718
19202122232425
262728293031