Reducing bug fixing time

When I first started learning programming, I learnt this phrase there are more than one way to kill a bird ie a problem can be tackled more than one way to accomplish a goal.  What I sometimes do is select the path that solves the problem quickly but with a low probability of success(or high if there is one).  For instance,  I will have some intuition on the part of the code that needs changing, without thinking through whether it is right or wrong, I would go change it then I test if it is fixed, if not I revert the changes. I  would try this about three times; if I haven't solved it, I just take the long guaranteed path to success.  These little quick chances of grabbing at straws tend to add up exponentially over a long period of time because sometimes you get an enormous payoff for little work.  It's like black swan investing for bug fixing. 

With this technique, one must be ever mindful of ruin.  You should be able to quickly revert any changes you have made.  Additionally, your tests must also guarantee that your changes indeed fixes the problem instead of just shifting it over to one side.

The collaborative mind

Ok, I going to try to make this as brief and short as possible.  It seem like everyone is running a collaborative filtering algorithm these days, the likes of google, facebook, HN, etc  By the collaborative filtering every man decides what he or she(group) will view, the choice is upto you.  Machiavelli once said fear is stronger than love.  If we had a choice of whether to hug someone or kill a snake in the room, we killed the snake.

These days with collaborative filtering everyone is being given these choices constantly.

Take a look at facebook,twitter,hn feed, count the negative words versus the positive.

Here is what you need to do:

 Filter your feed.  If your feed is not saying anything positive or happy cut it.

[That's it, I will spend a few days disconnected from the internet. ]



 

Achieving spatial flow

When you move to a new place you have to prove yourself and develop new friendships.  Every new school or new workplace I went to, I had to prove myself.  People just didn't assume I am who I say I am on my resume.  But, the weird thing is who I am on my resume is as a result of the people in the last place allowing me to be me without question.  For instance, I don't like being interrupted while programming.  In some places, this is looked down upon, so it will take a while to establish myself.  Other examples are: I don't like to multi-task; I don't like to rush; I don't like people arguing.  Basically, I have a lot of likes and dislikes that genuinely affect my productivity. 

The thing about being new is that people aren't ready to cater to your every wimp because they don't know how useful you are to them.  Also, combine that with the fact that they don't know each of your likes and dislikes and will have to learn each as time goes by, making the process long and filled with unpleasant experiences.  In essence, spatial flow concerns itself with achieving maximum productivity at a particular place. 

 

How do you achieve spatial flow?

1.  The brute force way is to stay at a place for 1 - 2 years.  If you haven't achieved your peak productivity in this time frame, consider moving on.  The timeframe I learnt through experience.  I have move from Antigua to Trinidad back to Antigua to Nottingham to Manchester to Scotland back to Manchester then to Chester. Moving this much gives me a sense of when I will hit my productivity peak in a new environment.  The longer you are at a place the higher the trust is between the parties at that place.  The higher the trust the more things one can do with members of the environment that can mutually benefit all parties involved. For instance, when we were working on Pock.it two of members were on vacation at the beginning.  If I didn't have the trust that they would be killing the project in the end, I would probably I have quit the project early.  Since, I know these guys were anchors and I'm a starting leg, I started working while they were on vacation.  Certain things can only be facilitated through trust which can take time to develop. 

2. A shorter way of achieving spatial flow is to carry your friends with you when you move.  I would say you need about two or more friends to break through barriers that inhibit productivity [The number comes from Asche conformity experiment].  Your friends serve as social proof as to who you say you are. They can say "Oh you were like XYZ in the last place, and it worked out well."  Basically, you can customize your environment without much resistance.  Spatial flow was easy to establish moving from High School to College because most of the people I knew in High School were in College.  It wasn’t as easy from University in Antigua to University in Trinidad. 

3. Have a list of items you need to be at your peak in the new environment.  Knowing yourself is half of the battle.  Example of items you need to be in peak spatial flow might be: a good desk and chair, establishing a routine, a particular archetype of friends[personally, I seem to do very well when I'm surrounded by a female XSTXs or male/female XNFJs.], cleanliness of your environment, having cooking utensils, etc. Knowing exactly what you need to be at peak productive you can seek to establish them directly. 

4. Try to establish yourself independent of your current space.  This means getting accolades that are internationally recognize, writing a blog/book/paper, participating in online forums, etc.  Anything you can do to show you are of some value that can be judged openly.  People don’t trust degrees; they know the process is closed, and there can be a whole lot of grade inflation.  I’m sure you can attest to knowing someone who doesn’t match up to what they say on paper.  There is no way that you can possible check every item on people’s resume, so they just assume you are phony until you can prove otherwise.  One way to avoid this is to create works that can be easily judged.

 

Implications of Spatial Flow

1. Don't break the flow unless you have to - Spatial flow takes a long time to develop; don't sacrifice it so easily.  It's a competitive advantage.  Spatial Flow is intangible, so it is hard to see all the value you are throwing away by moving around.  If you think of Basket Ball and a big talent moving from one team into the next, the first year they are not going to win a championship.  They first need to establish that chemistry (spatial flow) before they can do great things together. 

2. Don't establish flow if you aren't planning on staying - If you are planning on not staying at a place, don't try to establish spatial flow.  Your objective should be to move into the space you will like to achieve spatial flow quickly as possible.  Achieving spatial flow anywhere else is just a waste of time. 

3. Break your enemies’ flow - If you need spatial flow to achieve your peak, your enemies do too. Check Tiger Woods, for about two years his flow was broken due his extra-martial affairs.  His game failed him under the drama.  I doubt this was purposeful, but it indicates that you can beat someone who was considered essentially unbeatable if you mess with their flow.  I'm not going to tell you how to do that, be bad all by yourself.  I’m just saying it as an academic note. 

4. Help allies achieve their flow - I'm not going to explain this one. 

5. Select future friends who will be in the same space/place as you - To achieve flow quickly, you are going to need to carry friends from the space/place you are at to the space you are planning to be at.  I doubt you can affect people's choices, so the best way of going about it is selecting friends who indicate they would like to be in that particular space/place and have shown some indication of taking steps to getting there.  Not all your friends need to be going to this future space/place, but at least some should be going.

Awaiting the coming of the singularity

Everyday I'm working furiously[lol] to make my life better and that of my potential offsprings. But, what if I didn't have to? What if instead I just sat back and waited. Wait for what?

The singularity, the time where machine intelligence is equal to or surpass human intelligence. In maths, a singularity represents a point in a function that is undefined i.e unpredictable. Similarly, a future where machines are of equal intelligence to humans is unpredictable. Hypothetically, they can go on to produce even more intellgient machines, hence increasing the likelihood we can't predict their behaviour. This is the point in history where ideas and execution become one.

Take the best that human has to offer[think Guass], then add speed, immortality and  the ability to work constantly. Advances will be made rapidly. Matthew 11:5 - "The blind receive their sight, and the lame walk, the lepers are cleansed, and the deaf hear, the dead are raised up, and the poor have the g..." Pause. But, you get the point it will be good time to be alive.

Personally, I think it will happen in the next 25 years. I maybe wrong, but it will happen soon and very soon[hopefully it wouldn't take two millenia]. My main point is we have a lot of good things to look forward to in the future. Although the world and the people in it tells us that we have to achieve things by the force of our will, in reality, the real changes we see in society is normally a result of forces external to us.

But just incase the singularity doesn't save us, let me get back to work. And Happy New Years[my first post of the year].

Steve Told Stories

When Steve came through he told a story.  He told a story of being given up for adoption as a child to highschool educated parents.  He told the story of how his parents struggled hardto send him a presitgious liberal arts school, reed.He told a story about quitting to pursue his passion and how hard it was.  The story about collecting bottle caps and getting food once a week from the Krishna Temple.

He told a story of friendship(Woz), rivalry(Gates), love(his wife and kids).  Each one of these was an epic tale in themselves. Each of his three companies did something epic.  Apple is the greatest come back story in history. Next built the computer on which the first webserver and browser ran. Pixar was the first full length animation movie.  

There is no movie without conflict and climax.  Steve was full of conflict and climax. The stories speak for themselves; they didn't need the media to push them. Stories activate something deep inside that you can't help but want to replicate the action of the hero in the story, Neo in the matrix, Tyler Durden in Fight Club and Steve Jobs in real life.

 

Handling Insults

The best way to handle insults is to avoid getting them in the first place.  A startup is more or less a an emotional battle.  It is fought in the land of fear, mania, hope, desperation, anger and all other emotions that may naturally arise due to an uncertain venture.  The last thing you would want is extra emotions inspired by an insult.

Chess, are you telling us to run and hide?  Why yes I am.  I remember when I was going to Trinidad for the first time. I was worried about the crime rate.  Seeking to arm myself in the eventually of a possible attack, I began reading about self-defence.  The major point that came across is if underattack and you can run, run. It's the ultimate self-defense.

People who tend to attack people whether physically or verbally tend to be experts at doing so.  You hopefully are a builder, creator or innovator, and fighting verbal wars is not your strong suit.  You are saying to yourself "but what if I just took the insult; I can handle it."  Well, you can also take a physical beating, but why would you if you don't have to.  Forget the zen/stocism stuff; it will never work, especially not in a startup where emotions are magnified a 100 times.

If you try to ignore an insult, you would more than likely ruminate  over it for a significant amount of time.  In a startup, your goal should be to have one thing on your mind, delivering value to customers[insert goal here].  I'm not asking you to be a wimp; I'm asking you to stay on point.  I'm asking you to anticipate and catch potential problems mid-flight.  Yes that is it.  Anticipate who is most likely to insult your person and avoid them, nothing to be gain by a confrontation.

Thoughts on Hiring

I get the feeling that there is no advantage to be gain by giving Programming Test at a startup.  Furthermore, I think it betrays the Hacking culture, lack of innovation.  Have you ever thought about flipping a coin to choose an employee?  How about just using your intuition in employee selection?  Why every month on HN when they ask who is hiring everybody seems the same? 

I read these job posts and I think to myself these guys are no fun.  Where is the experimentation?  Some start-ups try to be fun, but they copy others in being fun.  No, I don’t want to play ping pong at work.  When I say fun, I mean like Old School the movie type fun, getting a pool of KY Jelly and have a wrestling match; the inmates run the asylum.  But, what is the advantage of being fun? 

You are asking the wrong question you are being too left brain, but nevertheless I will try to answer.  The journey to being a successful startup is long and treacherous.  In all likelihood you are going to failure [oh no, not me – oh so now you want to be right brain].  Being fun means even if our ship tanks, we would have epic stories to tell, and people will have stories to tell about us.  People pay for a good story; newspaper write about start-ups with a good story.  A good story is a competitive advantage [insert arbitary quote from Michael Porter]. 

And another thing, why are you hiring people you don’t know or haven’t been recommended by people in your network?  The consensus seems to be good hackers get hired by word of mouth.  [Blank stares. Silence. Cricket Noise.] 

</backseat driving>

 

How to learn fast

As a 12 year old trying to learn Pascal, trial and error was my bread and butter.  Given the fact that back then I rarely read anything other than technical materials, my vocabulary was a bit low, so guessing was probably my only learning tool.  I  would see code in the dietel and dietel book or on the web and try it out.  If it didn't work, I would move things around until it did.  In my little mind, I had created a list of possible solutions to make it work and would go through each systematically until something works.  When I solved it, my mental model of how programming works was improved.  After going through this process a number of times the mental model was complete.

I think when learning, everyone goes through this trial and error phrase where they try to understand what a given author is trying to say.  The length of time spent learning is directly proportional to the possible solution space of the material being learnt.  The goal of learning fast is to cut down this solution space of possible things the author could mean.   This can be done by providing suitable examples and questions to test your mental model.

Thus, the road to learning fast begins by the selection of the correct materials from which to learn. The more examples, the easier it is to narrow the possible things an author could be trying to convey to you. The more the frequency of checking your mental model, the easier it would be learn material later on that rely on the current information being taught.  It is very rare that I would come across a book with  tons of examples and questions on every topic.  Generally, it requires about 2 or 3 books on the topic, one book for examples and another for questions on the topic.  I generally judge a technical book's quality by the number of examples and the number of  questions.  I instantly toss any book without either examples or questions.  

 

Discuss on Hacker News here.

To my young Thugs

Once a motherf&*ker get an understanding on the game
and what the levels and the rules of the game is

Then the world ain't no trick no more
The world is a game to be played
” –Tupac[Staring thru my rearview]

Life is fairly simple [but not easy]. I’m going to try to outline some of the levels of life and their corresponding rule.

Level 1 - Don’t go to Jail

For a lot of young black males, this is a very difficult level to pass.  Even if you decide you are going to live honestly, you might live in an environment that wants to force you into a life of crime.  My best advice for surviving this level is to avoid known criminals in your community, and if you see them ,still hail them, just don't get too close.  If you are 30 and haven’t gone to jail, congrats you have successfully pass this level.

Level 2 – No Kids until you’re 36

It was the age Obama had his first kid.  Look at jay-z he has his first one, oh wait, we are still waiting on that, and he is 41. I’m not telling you to abstain[studies say that don’t work]; I’m saying use a condom, or have her use birth control pills or if all that fails, use a morning after pill.   By delaying having kids this grants you an enormous amount of freedom as to what you can do.  You can go to university or start a business or travel the world.  No kids, you only have yourself to look after.  With only yourself to look after, you can live on the cheap.  By the time you get around to having kids, your pockets will be full of cash, and you will be able to teach the kid a thing or two about life.  This is not a hard level to pass, as a guy I’m sure you don’t feel an intrinsic need to have kids, either that or I’m very weird.

Level 3 – Keep Healthy

This involves exercising at 75% of your maximum heart rate for 30mins every day.  Consider this level passed when you do 300 days in a row, but the level is life long.

Level 4 – Select an Excellent Queen

Turn on my pattern matcher.  I find couples that are in the same career tend to fair better than other couples.  See Michelle and Barack,  Hilary and Bill, Jada and Will[I heard rumors] or Beyonce and Jay-z.  I think it makes conversations easier and also you can build things together[cool right?].  Another way of approaching this is to marry your best friend[female that is]. Oh yea, you can only have one Queen at a time.

Level 5 – Get a degree

Can I suggest a degree in computer science?  If not, do anything you feel, just once it makes money.  You should try to get this as soon as possible and finish as quick as possible.  This is like a safety net that somewhat guarantees what sort of life you will be living.  Welcome to the middle to upper middle class lifestyle. I suggest getting a degree before 25.  This stage is skippable if you have musical, athletic or artistic talent that is paying you a significant amount of money.  Still, I don’t recommend skipping it given that 60% of basketball players eventually go bankrupt and that figure more than likely rings true for other endeavours, so it is good to have something to fall back on. If somehow you do skip this stage please go right along to level 11.

Level 6 – Get a job for at least 3 years

Well you are going to need money to sustain yourself.  Three years is enough experience so that if you left that you are still valuable in your career path.

Level 7 – Save 8 months of living expenses

This is in case of emergency and somehow you lose your job.  It gives you a certain amount of leeway to get back on track before you have to access funds from friends and family.  This is absolutely not skippable.

Level 8 - Be in the know

This involves reading news at least 30mins a day and another 30mins of reading something in your field or some other material.  Being knowledgeable makes you an interesting person.  To be well read means you have a vast base from which to talk to strangers.  You can talk about HipHop or you can talk about the works of David Humes or Wittgenstein.  Additionally, it also makes humor easier since you have such a wide base from which to draw the humor.  Being in the know also involves knowing social graph of persons of interest.  This level ends when you die, but you can say you have passed it if you did it for 5 years.

Level 9 – Add at least 12 people to your rolodex a year

One of the complaints of educated people is that they aren’t being compensated fairly.  They will mention how some people climb ladders because of their connections.  Frankly, you aren’t here to change the game; you are here to play it.  If that means getting to know people, such is life.   The point here being that people make decisions concerning who to hire or who to promote. Consider the scenario, someone introducing you to a CEO and mentions “This guy is a Boss, a Beast at xxx” compared this to you handing in your resume with a distinction.  First of all, people don’t seem to trust schools; either that or they think theoretical people don’t perform well in the real world.  There will be static if you went the resume route, it is like recommendations on Amazon, sometimes they can be good other times phony; you don't know what you are getting. Going the personal recommendation route is like a friend recommending a book, you will put more trust in that recommendation. This is another level that terminates on death, but you can say you have passed it if you did it for 5 years.

Level 10 – Generate Value outside of your normal working hours

This is for you to decide but create some form of business.  The objective here is to go full time on this venture and earn enough money to sustain yourself indefinitely without having to go to work.   Right now, this is about the $4 million dollar mark.  It would be wise at level 8 to study finance, in particular bonds.

Level 11 - Welcome to the new Black Elite

To confirm that you have attained this level, you must have the following:

  1. You must be in good health.
  2. You can survive indefinitely based on your investments without working
  3. You have a soulmate

 If you can confirm this, expect your Black Elite club card in the mail.

Level 12 - Multiply

This stage involves giving back and creating others with the same mind state as you. Personally, if I make it to this stage I would be giving black kids two grand for every year they stayed out of jail and a grand for every year they don’t have kids until they are 36. I would even pay university tuition.  Obviously, I can’t do it for everyone but I think every bit counts.

 

I might have left some levels out, but this is mainly the game.  If you fall off, get back on track quickly.  There is only one actual level, level 11.  Every other level makes level 11 easier  

 

How I write code

So, I decided to jot down my coding process. I might learn something from doing so or someone else might.

1. I start by writing an overview of the solution in english.  This should fit one page.  If it can't then break the project down further until it does.   This serves as a solution and  a memory aid to where you are in the development processt.  The solution should identify any function you are suppose to write.

2. Next, I look at the solution in english and choose a function to write, anyone.

3. [This is not in my process now, but I should write comments before I write the function.]

4. I normally write this function recklessly fast and anywhere. The way how I write code is that I can always cut and paste it to where I would like it to be.  I write recklessly fast because I'm going to test it.

5. I write my functions such that all the data it needs is supplied to the function.  For Instance,  if the function needs a database connection, a database object is being past to the function instead of using a class variable or global variable.  What I'm trying to do is make the function such that I can easily cut and paste it into some other context and it works if the necessary data is passed to it.  Also, designing the function like this makes the function easy to test.

6. I try not to make my functions exceed ten lines, easier to process and understand.  If they do I try to spawn something out as a new function. 

7. To test the function, I write code that calls this function with the appropriate parameters.  The main thing I try to do is to ensure each line runs once and works.  Additionally, I look at the function and see how I could break it; this normally involve identifying values of the input parameters where the function might break.

8. Place functions in its appropriate spot.

9. Rinse and Repeat steps 2 - 8 until all the functions have been implemented.