Shortcut for chapter specific information

Showing posts with label ZAMM. Show all posts
Showing posts with label ZAMM. Show all posts

Monday, September 5, 2011

I have changed......

In the past, if I knew the homework set has changed, I would be so unhappy.  I would curse the instructor why he/she couldn't just stick to the old syllabus.

I have changed.   Now I see programming as a life time career.   Although I tried to avoid doing programming at work (because it's a waste of time), I do hope that I can use programming to do a lot of fascinating thing that enriched everybody's life (me included).

With that line of thinking, who cares about the 20 hours were used?  It is a good use of time because this 20 hours will mean a lot for me as a programmer.  How would I know more Java before this 20 hours? How would I know backtracking before this 20 hours.

In ZAMM, Prisig discussed education systems.  And how come a motorcycle technicians will eventually be interested in deeper knowledge such as Mathematics and Mechanics.    The answer is he no longer feel satisfied by the shallow knowledge shown to him by cheap manuals and folklorish wisdom.   He become something actively accept and reflect on how he can do better.

This is everything bit as philosophical as one goes to reflect on problems such as why life exists, why do we live or whether there is another being exists in the world.  In fact, this active absorption of knowledge may by itself, make us humans as we are.

Thursday, June 2, 2011

Zen and the Art of Motorcycle Maintenance (Part 8, Final)

I have finished the first read of ZAMM.   The last part is actually a bit anti-climatic because it is mainly a description of how Phraedus went insane.

Though I have long been speculating that many mental disease actually relates to one not being able to find a life goal.   This happens to a lot of people today.  Though not many of us admit that.  Not to say the cause of these diseases.  Say large corporation and government are not keenly aware of the possibility of such problems.

This book should be reread and probably study.  I will read the sequel to understand the philosophical ramification of the metaphysics of quality.

33_P

Tuesday, May 31, 2011

Long Weekend

Three things happened during the weekend.
  • I was sick.  With headache and temperature,
  • Finished ZAMM,
  • Watched the first lecture of MIT "Introduction to Algorithm".
Got to get back to studying.   But getting sick is one gumption trap.  My current strategy?  Try to finish simple stuffs and get through the darkest time when you don't feel you want to learn more.   I will first write up my experience on these 3 small issues.  Then move on again.

Saturday, May 28, 2011

Zen and the Art of Motorcycle Maintenance (Part 7)

Finished another 40 pages of the book.  When Prisig discuss the idea of gumption trap, I cannot feel this is more closer than I have been thinking in my work in research and programming.

Prisig discuss several traps of not being able to attain quality.   Unlike most authors, his discussion is filled with deep insight in psychology and philosophy.   For example, his analysis on why human got distracted from attaining quality spot on on why I have not been doing well in my work.

There are many traps in succeeding in resolving deep technical and skill problems.    The first important thing is the failure of caring.  This is caused by ego, anxiety and boredom.  And those are the true feelings of programmers and skillful workers in the world.    We appear to be the wizards of technology.   But deep down, we feel like all human beings.  We are scared of the nature which can give us a problem that we cannot resolve.

Let me try to give an example, in my reading of CLRS, I find traps to many programmers and make them not able to finish the whole book.   Here is the reason why many of them cannot finish the whole book or gumption traps as discussed by Prisig. That includes the following.  (Mostly self-criticism btw.)

  • Having fuzzy belief that CLRS is "reference book" but not an "introductory book".   (How do you define "introductory" and "reference"?  If you don't specify the background knowlege of a person, how do you know?")
  • It's too long a book.  (War and Peace in Signet Classic has 1400 pages.  A typical Dickens is 500 pages.  Believe it or not, people read these books and they are not necessarily literature major. )
  • Having fuzzy belief that CLRS is "too mathematical" so it is "useless in real life situation" (In real life, what operation was actually not control by some kind of logical or mathematical structure?)
  • They are not "smart enough" and only have a fuzzy understanding of what "smartness" means.  (In fact, have you ever try to define what smartness is?  Do some research, you will see how fuzzy a concept it is.)
  • Caught up by one single exercise in the book.  (Record the attempts of solving a problem.  No one is so perfect that they can resolve all mathematical problems.   Or else the twin prime problems is resolved by someone already.   If you think giving up is a shame, remember that there are many people who look at the Twin Prime problem, the Goldbach conjecture, the Fermat's Last Theorem and then decide to give up and sleep.  So no shame, this is just how human works. )
  • Not trying to learn an algorithm as one should learn it.  (Algorithm is not meant to be "read", it's meant to be "implemented".  This explains why an early chapter such as Chapter 2 take some time for people to "read" it through.  Because the truth is one needs to at least implement an algorithm once to get a rough understanding of its operation.)
  • "I don't need to know all the algorithms from CLRS. For example, why do I read Chapter 5? I will never write a random generator in my whole life."  (The reason why you want to learn algorithm is not because a particular algorithm would be used but because you want to learn the pattern on how to solve a problem.  For example, binary search as a method can be used to resolve more than just searching.  In general, it is a method you can operate on a range of numbers.  Consider the binary insertion sort, it takes a fine understanding of binary search.   For another example, random generation algorithm will make you start to wonder what probability really is.  Again, it is the thinking which matters, not the proper nouns and sound byte. )
  • "I tried to read the book, but the later content lost me." (That's because you haven't learnt the material in the previous chapters well enough.  Try to build connection on concepts, read further reference and repeat the process.)
  • It just takes too much time.  (When I scrutinize my use of time, I can always find some wasteful moment I can dedicate them to study algorithms.  If you did the same and have none, I have nothing to say.)
These are the gumption traps for reading an algorithm book.  In fact, I start to see why I sometimes I fail in the other attempts in my other ventures.  

But I am confident now, my biggest weakness, algorithm, will one day become one of my biggest strength.   Just like many other things such as video gaming, language learning, poker, lock picking etc.

Friday, May 27, 2011

Zen and the Art of Motorcycle Maintenance (Part 6)

Read another 10 pages. Now starting Chapter 26.  This is indeed a difficult book to read.

Prisig suggested that one should unify both the subject and the object sides of quality together in a fundamental level.   I don't know how this could be done but I know when this feeling appears to me.

Have you written a merge sort in the past?   In the traditional top-down merge sort.  There are usually three pieces of code: the merge function, the merge_sort function and the driver of the program.

When I look at individual piece, they look fairly ugly before you understand what they do as a whole.

After I finally got it running (,search merge_sort in this blog for my attempts), the feelings are entirely different.   What a marvelous idea!  In fact there is even an easy proof of its performance.

Then I went back to each of the program.  Another feeling kicks in, wow, the program is indeed very smart.   For a typical C implementation, you just need to pass in a piece of working memory.  But the code does the magic.  Unsorted array becomes sorted.   How wonderful.

It is feeling like this keep us programmers working.  Not money, not reputation, not fame.   It is this beautiful feeling to get new things working make us keep on.

I guess we all have this feeling daily.  It just a matter of recognizing it consciously.

Thursday, May 26, 2011

Zen and the Art of Motorcycle Maintenance (Part 5)

I waked up early this morning at 5 and ended up finish a lot of housework.  Everyone needs one of these days which you can be alerted and work out something which is important long term.

Then I continued to read ZAMM and finished another 40 pages.  Once again, I feel this is one of the most important book I read intellectually since I came to the U.S..  In the world of knowledge, there are generally two types of knowledge, one is based on logic, arguments, or what Prisig calls "the classical knowledge".  There is also another knowledge which expressed only in artistic manner and aesthetic.  Or what Prisig calls "the romantic knowledge".  In real-life, one will constantly face situation where one needs to apply both so called classical knowledge and the romantic knowledge.   This is especially true if you are serious about something.

In my case, I found that I need to exercise my mind intensively on several activities.  That includes (sort of in the descending order of importance) Learning, Thinking, Reading, Writing, Science, Mathematics, Programming, Philosophy, Psychology.   To a lesser extent, all the Games I like to play.  I found that in all these cases, both types of knowledge are need.  You will also see that people who are bad in doing them are the ones who always think this subject as only one sided.

I frankly got to admit that I was stuck in several of these subjects.  For example, in Science, I always found that I am a lesser scientist than people around me.  I know people who can solve a problem faster than me.   In writing, there are always people come by and tell me how my writing is bad.  Same happens in programming.

I always feel lost about these issues.  To an extent, the issue really boils down to what "good" is for these subjects.   If you really think about it, and just like what Prisig realized, it is extremely hard to define what "good" is in writing and programming. Or in Science and Math, it's tough to ask what a good research is.

But the strange thing is we all know what "good" is when we look at the writing, or the program, or the research papers.  This has always been baffled me.  I believe Prisig has given me a very good idea.  I would not say I agree or disagree with his thought.  But at least I feel great that someone think deeply in those issues.

If you like to think and read this message, I strongly suggest you to read ZAMM.  I believe it resolves many issues for smart people.

Sunday, May 22, 2011

Zen and the Art of Motorcycle Maintenance (Part 4)

Finished another 40 pages of the book.   This is one of the most thought-provoking book I have ever read because it touches so many philosophical issues which a programmer/scientist should think deeply.   I start to follow the core of the argument.  i.e. what quality is.   I cannot overstate the importance of this topic to programmers.    Because all of us know we sometimes just encounter code which is good beyond description.  The extent of this problem is multi-level, it could be as small as whether

if(a>0) printf("%d\n",a);
else printf("%d\n",b);

is "better" than
if(a>0)
    printf("%d\n",a);
else
    printf("%d\n",b);

Or how should we add a new feature in big program written by object oriented programming.  (Think again if you think that there is only one way.)

Or why would we think that in a certain situation, nl is better than perl -lane '{print "$.  $_\n"}' or why are they are not as good as writing a separate perl script in others?  (Again, if you think only the command is better or if you think writing a perl script is better, you better think again.)

Or is it more correct to write a correct program with fewest number of lines? fewest number of characters? or it should be written with full commentary? or should we also give test cases?

Of course, this is just a very narrow aspect of "quality" which is discussed by Prisig.   His discussion of quality, though started from rhetorics are highly relevant to all skill-related works.   One can ask with similar rigor,  what is quality of cooking? what is quality of writing? what is quality of proofing?  what is quality of painting?  what is the quality of acting?  Those are among the most difficult questions which for the most time there is no satisfactory answers.

Saturday, May 21, 2011

Zen and the Art of Motorcycle Maintenance (Part 3)

Finished another 20 pages.  I cannot agree more.  The lines are for a mechanic but we can all see why we all fit in.  That's also why we want to self study.

"His creative intelligence, stifled by too much theory and too many grades in college, would now become awakened by the boredom of the shop.  Thousands of hours of frustrating mechanical problem would have him more interested in mechanical design.  He would like to design machinery himself. He'd think he could do a better job. He would try modifying few engines, meet with success, look for more success, but feel blocked because he didn't have the theoretical information.  He would discover that when before he felt stupid because of his lack of interest in theoretical information, he'd now find a brand of theoretical information which he'd have a lot of respect for, namely, mechanical engineering."

"So he would come back to our degreeless and gradeless school, but with a difference.  He'd no longer be a grade-motivated person.  He'd be a knowledge-motivated person.  He would need no external pushing to learn.  His push would come from inside.  He'd be a free man. He wouldn't need a lot of discipline to shape him up......."

Word.

Tiger moms,  read this.  You are darn wrong.  This is how human, and most importantly children should learn. 

Zen and the Art of Motorcycle Maintenance (Part 2)

I finished another 30 pages.   The book is so deep.  It's obvious to me it is written by someone with great wisdom.  Many issues such as the purpose of education system, the university system and our technologies were explained.  This book opens my mind.

The feeling of not knowing something and obsessively want to understand run so deep to many technical people.   Some of them never realize that in their whole lives.   We just let time by to allow ourselves, for good and bad, not understand something.   That's why I feel anxious.   That's why I feel life is meaningless.   That's why I feel all the sudden deep thought doesn't come to me.  It is deep-seeded.

It is also when a person stopped to be in the flow.  When does the flow stop?

Perhaps it starts when a person think that remembering a formula is equivalent to understanding.  Or it could be the moment when we hear the phrase, hasta la vista, we can only think of Arnie.  Or when we heard of Asian, we think solely of one race, one country.   Or when we use a push in perl.  Or the funny syntax in perl 5.0 which a one-liner can do both replacement and assign without understanding. (i.e.  ($a = $b) =~ s/abc/xyz/g).  Or feeling confused about obfuscated code.  Or feeling frustrated when people named a new idea.  Or feeling obliged to pay mortgage without knowing why we have mortgage.  Frustrated by the economy without knowing what money is.   Write the C-code, don't know  what the compiler will do.  Or write the Assembly code, but doesn't know how the machine takes it.  Or know how the machine takes it, but doesn't know what it was designed this way.

We are immersed in systematically designed increasingly deepened abstraction.   They are always shallow by definition.   Only when you learn how it was created without applying the rules suggested by the others.   Then you start to understand the nature.

That's why I am so frustrated because I don't understand all of these.  More importantly, I or perhaps you misthought that not understanding them can solve any problems.  It never does my friend.  We are meant to know, to understand and finally come up with sublimed thought that conclude what we are thought and understood in our lives.   Be it an idea, a paper, a research, a program, a company, something or anything.

Sunday, May 8, 2011

Zen and the Art of Motorcycle Maintenance (Part 1)

I tried to understand what makes me so anxious when I have to deal with a huge program even with source code.

I strangely believe that ZAMM seems to be giving me some enlightenment.  How?

Programming could be every bit of a now issue or it could be every bit bit logical and rational.  To grok something in programming.  Just like in Mathematics, the most effective way is not just to understand a certain glaring bright spot in the topic.  Rather you want to understand a tiny tidbit to an extreme depth.  Understand the connection of each of these bits. 

You don't normally get huge speed improvement for individual tasks (your speed in problem solving, not speed of the program, though the two of them are interrelated. ) But improvement will come even if you put your consciousness to improve even a small part of your understanding.  In my case, my recent improvement in typing and basic algorithm skill seems to already give me more confidence. 

Programmers seem to operate on bits and texts or in a higher-level may be data structure, design.  But the truth, programmers are operators of concepts. 

The concept of a huge program seems to be trivial.  But at the end it could be as blurred as a dark shade.  What is a "sorting routine"?  Let's do a "search".  What are these words mean? at all?  Without going into the eternal, the understand is just romantic.  A sign of strength will be shown if the routine is fast or quicker than other routine.   That's the cool side.  But the underlying form also matters.  

What understanding means must be a balance of both sides.  Both the internals and the externals, both the logical and the aesthetic part of it.   Completion or Perfection of a skill would not be attained when one's understanding was biased to one side.

That is sadly what happen to a large program which are built by mere humans.  and How difficult to factor this in?  The human dynamics of work and collaboration in a creative work like programming?

That's why programming and maintenance perplex me and tired me.  Like using your pinky to type words like period or programming or perplex.  If you are not familiar with your pinky.  You found it difficult and tiring.

So what can solve the issues?  To attempt to understand every thing in the program! Try to describe it as hard as you can.  Not only a matter of the details.  Not only a matter of its functions.  But BOTH. It is possible.  It is possible for human to understand and learn an issue once you know the issue.   Look at the source code for comprehension, for criticism, for learning.   

That is the only way to remove one's anxiety in programming.