Powered By Blogger

<< Patricians VS Arriviste >> Not the very obvious in Computer science.

Saturday, October 20, 2007

Simplicity !! in Software Engineering.

I have always learnt more than what is taught at academic institutes. This is mostly due to the fact I analyse whats being taught in extreme detail. This excruciating analysis usually means that I do not complete the entire syllabus, but that's the way it is. My analysis usually stops when I have understood the very simple fact on which the academic conclusion/lesson was based. As an example I took a sentence from a software engineering class which states
"Software should be simple"
Is it end of the lesson? Has everything been learnt ? No I don't think so!!!
The key questions left to be answered are
1. Whats the definition of simple ?
2. How do you measure simplicity ?
3. What are the parameters to the measuring function ?
3. How do you apply the concept in real life ?
4. Are there any patterns associated with the application of the concept ? (Patterns, patterns, pattern how much do I love to identify them)
Hmm, now if I pose these questions to people who claim to understand "simplicity" I will get 100s and 100s of variations in answers. Which one is correct ?. Thus I tend to conclude that real knowledge is tested when there are no correct answers and right answers are based on circumstances in which the concepts are applied.
OK, enough of the ramble and scramble. Here is what I learnt today at Carnegie Mellon that is worth sharing. Its a very sweet and simple definition of "Simplicity" itself
Simplicity: Its the art of maximizing the amount of work not to be done to do the "thing right".
Now can we answer the questions about simplicity ? I am quite sure that the above definition puts the practice of keeping thing simple in the right perspective ;). The questions posed about simplicity are now well answered, and this is what is truly learnt because, this will eventually helps us in application of the concept.
Cheers,
Faraz.
P.S: I'm dumb at times. I risk stating the very obvious for the smart people. But, hey this surely helps other dumb people like me. Me being dumb helps me constantly evolve into a smarter being.
Food for thought (Courtesy Wikipedia:Simplicity):
"Simplicity means the achievement of maximum effect with minimum means." — Koichi Kawana, architect of botanical gardens
"Things should be made as simple as possible, but not simpler." — Albert Einstein (1879–1955) "Simple things should be simple. Complex things should be possible." — Alan Kay
"You can always recognize truth by its beauty and simplicity." — Richard Feynman (1918–1988) "
Our lives are frittered away by detail; simplify, simplify." — Henry David Thoreau (1817–1862) "Simplicity is the ultimate sophistication." — Leonardo da Vinci (1452–1519)
"If you can't describe it simply, you can't use it simply." — Anon
"Simplicity of character is the natural result of profound thought." — William Hazlitt

Wednesday, May 16, 2007

StrStr as an Interview question.

StrStr happens to be the favorite question for some interviewers. I have a senior colleague who is especially fond of this question. He had a hard time getting people from X country answer that correctly. So he decided, to gauge the difficulty of the strstr question by using my answer as a benchmark (Don’t know how wise this decision was?).

He started out by explaining the question to me. And then i started thinking about this. I knew about this question but never had the patience to find an answer. So i decided to think :), n2 algorithms are BAD so I did not even discuss the search the needle in the haystack solution.

Eventually after he putting almost all the words into my mouth I/we got the variant of the KMP strstr algorithm. And then to test if I really understood the solution (this is imp now because I did not design it :)) he just asked me to build another failure table as used in the KMP algorithm which takes the number of matches before a character failure and gives the skip count. And then I got that while waiting for my bus.

Conclusions are.

1. "Efficient" StrStr is not a simple algo to design.

2. There is much to think about it.

3. Once you get it, it easy. BUT... it can always be further optimized.

4. Its not a good interview question for a telephonic interviews. The reason being on the extremely smarts can do w/o hints, i think the person being interviewed should be given hints. Hints are not conveyed effectively over the phone. :)

5. It will fairly gauge the thinking abilities of the person being interviewed.

Tips for the "being interviewed".

1. If you know the answer be honest say that u already know the answer.

2. Don’t get overwhelmed, the direction to start working is not that intuitive. The starting is important.

3. As for all thinking questions you have to convey to the interviewer the fact that u r actually thinking. So think aloud getting the answer doesn't matter as long as you are able to think.

Monday, May 14, 2007

Followers