HTDP on Programming

Classic pieces in htdp:

Some programs are as small as essays. Others are like sets of encyclopedias. Writing good essays and books requires careful planning, and writing good programs does, too. Small or large, a good program cannot be created by tinkering around. It must be carefully designed. Each piece needs a lot of attention; composing programs into larger units must follow a well-planned strategy. Designing programs properly must be practiced from our very first day of programming.

Programming a computer requires patience and concentration. Only attention to minute details will avoid frustrating grammatical mistakes. Only rigorous planning and adherence to the plan will prevent serious logical mistakes in our designs. But when we finally master the design of programs, we will have learned skills that are useful far beyond the realm of programming.


Dearth of Talent

Redmond Developer News reports a cover story on the dearth of talent and its consequences.

One Azher laments:

..numerically it looks like India is producing about 200,000 college graduates in engineering,” Azher explains. “But only about 25 percent of them would be employable in major enterprise projects.”

For the rest of the 80 percent of the IT industry, there’s a massive dearth of talent. Eventually, we get bodies not brains. As a result, our executions run into significant problems. We suffer enormously when we don’t get talented people.

One Jeff Levinson cribs that theory and math are not sufficient:

“CS teaches hard-core mathematics and theory,” he says. “When CS graduates come out of school, 95 percent of the time they haven’t seen or heard of use cases, have never written or read a requirements document, and don’t possess any soft skills or understanding of business consequences.”

Even Stroustrup seems to be agreeing with it:

“The U.S. academic system doesn’t reward professors for spending significant time on problems with current technology. The result is students with a shallow view of software and systems. Many have no clue what their language and system does and think that invoking functions on a library someone else wrote is all there is to developing software. Not all, but too many.”

One Sailesh Chutani says that learning can be made more fun and practical:

Microsoft Research is funding a joint Institute for Personal Robots in Education (IPRE) at Georgia Tech and Bryn Mawr College, which launched in 2006.

“Students purchase a $100 to $200 personal robot along with their textbooks, which they will learn to program and play with as part of their initiation into the discipline,” explains Chutani. “We have a fairly good indication that that approach is far more compelling than what has been a fairly traditional, sort of dry approach to the subject.”

Stroustrup and Chutani on why a masters degree might be useful:

“We need a solid foundation for computer science but we also need to give students practical experience with specific application areas, such as graphics and security,” says Stroustrup. “We also need to expose students to real-world demands of correctness, maintainability, testability and performance together with the tools used for that. Unfortunately, when you complete a list of all that’s needed-even at a minimum-you come up with something a lot of undergraduates can’t handle, and couldn’t reasonably be expected to handle.”

With an undergraduate degree you’re getting very broad exposure, agrees Microsoft’s Chutani. “Once you’ve gone to the master’s level, chances are you have more depth and you’re more likely to fit right into what the industry is trying to do.”

Some universities are coming up to prepare engineers for professional software development:

As an enterprise architect at Boeing, he would have appreciated learning more about organizational structure. “It’s all about understanding how people and processes relate to each other,” he says. “Aside from that, I thought the master’s in software engineering program was a great program.”

Cal State Fullerton based its online master’s in software engineering program, launched in the fall of 2004, on the Carnegie Mellon model. Roughly 160 students are enrolled in the program from four continents, with the majority based in the United States, particularly Southern California. “Because the mission of the program is to provide students with skills that they can almost immediately apply, we’ve included a lot of process and management skills in addition to the traditional software architecture, verification and testing skills,” says Huizinga.

What India and her companies are going to do for this? Infosys and TCS, as far as I know have some extensive training programs for the people it employs.


Some Collection Of Links

On md5 hashes, salting and secure passwords:


How to Develop Mindset for Mathematics

From Slashdot comments:

Make it relevant.

But remember kids, never mix calculus and alcohol. Don’t drink and derive! ๐Ÿ™‚

I don’t have a great answer for your question. However, for me the key to learning math was to stop being intimidated by it….Start reading the simple stuff and if it’s confusing, don’t be afraid to move backwards and get even simpler. We all forget that stuff now and then.

For the basic mathematics that the original post is inquiring about, the concepts are reasonably simple and straightforward. What they require, however, is what often appears to be mind-numbing repetition. It’s work….Unless he’s the sort of person who developed phenomenal self-discipline later in life, however, the best bet is to get to a classroom…But basic mathematics requires a lot of rote work. It can be a joy to know that you’ve learned everything that was used to get mankind to the moon, a tremendous joy in fact, but it takes work.

Make sure to get applications for the math explained to you. At the level you are talking about, I think essentially everything has a real world application. Make sure this is taught to you. It can really help your understanding to get some real world examples.

First off, understand what exactly it is you are trying to do. You are trying to build abstract thought paths in your brain. This is hard to do. Many of the math problems you were presented with in high school were an attempt to get you to make the leap from specific application of concepts in lots of different ways to the abstract concept itself….Accurate quadratic thinking is much much harder than linear thinking. When you see a line, you know it’s a line, but when you see a curve, it might be quadratic, cubic, exponential, logarithmic, or any of a host of variations.

In order to learn it on your own, you want to enhance your curiousity at any chance you get. If you get the feeling that you’re forcing yourself through it, you might not continue. To maximize curiousity, i suggest you find several math books….Sometimes you’ll find something that requires previous concepts that you don’t yet have. This is fine, because now you can go look up those concepts with a sense of purpose. This will help you to your larger goal of the more interesting thing that you flipped to in the book.

If you are going to teach yourself, I highly recommend firstly finding out how you learn. Knowing that you learn better by reading, or by hearing, or by drawing, modelling or however can save you a lot of time later on.

To regain my mastery of mathematics, I decided to take a single math problem very seriously. I figured that I would try to understand the solution by grounding all ideas down to postulates.

The guy who made the last comment ended up having an elaborate blog Fermat’s Last Theorem (linked to in my mathematics section).


Time Management, Again

Some more interesting tips, this time by one Wouter:

Cut up the time you have in blocks that are your most effective time unit. App. 3-4 hours might have to be allocated per block.

One thing that I have realized from the article is that when a block is so large i.e. 3-4 hours, the division of time happens not over a day, but over a week. We plan for the week and then make our plan more detailed on a per-day basis.

Always schedule the hard work first.

Not even mail checking – as it is the easier and more entertaining task.

Each hour not spent working hard in class will cost you several hours outside class to get the equivalent work/learning done, meaning you are just throwing away time.

Alas, the word class is not in my life anymore, but it can be replaced with office.

Put as much variety in a day without cutting up blocks.

This way one does not get bored with doing the same task for a long time. Without cutting up blocks is the most important thing to note – anything less than a block will result in thrashing. It is also a good exercise for me, if I make my block size as 2-3 hours, to increase my concentration skills.

The secret to getting things done, is doing regular chunks of work on it. Letting large tasks accumulate is a surefire way of running out of time for it.

Yet another classic gem!!

For certain kinds of activities, such as programming, it is possible to get “stuck” in a certain task. Give yourself a short amount of time (up to max 30 minutes) to try to overcome the problem, but don’t allow yourself to stare blankly at a problem forever without progress. As soon as you detect that you are really stuck, switch to doing another task for the remainder of the block or day. Next time you revisit this task, you are more likely to able to tackle it. Two effects contribute here: first, when you are focussed, you can forget surrounding issues and fail to see the problem. When you go back to a task you may have a better perspective. Second, the way the mind works, even though your conscious mind is occupied with a new task, the old task still is still lingering on in the back of your mind, and things may “click” even while working on other tasks! Or simply looking at other things may work inspirational to your background thinking on a previous task. In general, by interleaving tasks and projects during a day or week, you get a lot of thinking done “for free”, in terms of time, especially when more complicated learning / designing / problem solving is involved.

Brilliant!!! (Emphasis mine) I completely agree with the author here.

Be serious about tracking all your tasks/todo’s. If you don’t do accurate tracking, your mind will spend time constantly reminding itself that it must not forget to do a certain task. If it is securely tracked, your mind will be more at ease that you are in control of what you need to do and it will be more focussed on executing the actual task.

There is no such thing as “not having time”, there are only priorities.

Time and again it always boils down to priority – which is deeply related with one’s long term goals and vision. Unless that end goal is not clear (I may be wrong), priority does not make sense to a human being.

[With a todo list] Essentially what you are doing is keeping track of what you want to be doing, and only doing the highest priority items. Think about it, if you spend all your time doing the highest priority items, you will have spent your time automatically in the best way, assuming you assign priorities well. And there will always be something interesting to do, no matter what you do. You are never bored. Once you realise this, it is a liberating thing rather than frustrating.

One thing that you have the give up is the sense of wanting to be complete

Keep track of what time certain activities cost in the week, and optimize accordingly.

Data generally has novel and useful insights.

If you can’t train yourself to do work even with a distraction at your fingertips, your mind will always find excuses to do something else, no matter how much you limit yourself.

If you leave forcing yourself to work to the ultimate deadlines in your life that determine failure or success, you will spend most of your time procrastinating, and a small amount of time working real hard and stressing out. This may get you through life, but it isn’t very satisfying. If you want to do more with your life, you can’t rely on these “deadlines” to guide you, but you have to build up more discipline out of your own motivation. Again, this is HARD. Your first motivation should probably be, that you have too much pride not to be in control of your own mind. But more importantly, you probably want to get more out of your time than you get now.

Hmm.. this guy is onto something really interesting!!! This kind of contradicts with priorities – the very act of binding something to some long term vision/goal/satisfaction. That’s why probably he says – its HARD!!


Wide vs Deep

There is an interesting post from Entirely Another Day blog that characterizes the work of a manager vs programmer with the above two words. The author says:

Managers must work shallow and wide, while programmers must work narrow and deep. People who are naturally tuned to one particular method of work will not only enjoy their jobs a lot more, but be better at them. Iโ€™m a deep guy, I should be doing deep work.

He says about managers,

Digging in isnโ€™t what managers do. If they do, theyโ€™re micro managers, or โ€œassholes.โ€

Thankfully, my manager(s) don’t do micro management. And I am better off that way. ๐Ÿ™‚

and then talks about programmers:

The programmer, though, wants to be involved deeply and profoundly in just a few projects โ€” he wants to own them, top to bottom. Maybe itโ€™s a whole program, or a single feature, or some underlying library. Whatever. He wants to live in it, neck-deep. He has to worry about all โ€” literally all โ€” of the obscure technical details that make computers go. Jumping between projects โ€” context switching โ€” is a great way to burn a programmer out, because the cost of unloading one project from his head only to load up another one is enormously high. The idea of switching between two projects in a day, much less ten, is not only exhausting, but depressing.

You surely ring a bell in me, author. ๐Ÿ™‚ I am currently going through this transition and I can sense the depression, rejection and, not sure why, some amount of obliviousness in me.

And then he talks about the culture:

Some people are naturally wide, some people are naturally deep. But the assumption is, in most business contexts, that you can โ€” and should want to โ€” jump between the two as the need or situation dictates. But this is a load of crap.

One thing that we should realize is, he says:

The point of all this is that the intersection of someoneโ€™s predisposition and personality and the duties of their job is vastly important, and far too often ignored.

As the blog title says, I [am a] geek. And I will be.


Time Management

This is a hot topic, enough to give bread and butter for a lot of people teaching the same, but a professor from CMU, Randy Pausch gives the same old nuggets with some humor and emphasis.

  • He starts out with saying that Time is money. To get a perspective on this, he asks – “would you be willing to help somebody(say arrange something) do something (by spending your time) or would you be willing to give money to somebody just like that?”. I can see that a lot of people really go for the former, but not the latter. May be, even I do that. That is a mistake. People value money more than time. Time is a primary, natural resource while money is a secondary, artificial resource. Time should be given priority.
  • He says, “Realize now that time is important, or you will realize later”.
  • He suggests two books, One Minute Manager and The Seven Habits of Highly Effective People.
  • Part of the stress that we suffer from is because of bad time management. The relationship is a bit indirect – you want to do a lot of things, you don’t manage yourself properly, you cant do a lot of things, you are unhappy, you are stressed.
  • I have heard about prioritizing the work items long before, but it never has rung a bell in me. But it did this time. To annotate, he says, “Doing things right is not important when compated to doing right things. Whenever you are about to do something, do a cost-benefit analysis.” Atleast in the algebraic sense, time is money. ๐Ÿ™‚
  • Some questions to ask when you are about to do something is:
    • Why am I doing this?
    • What is my goal?
    • Why will I succeed?
    • What happens if I choose not to do this?
  • 80-20 rule. Again, this never did ring a bell in me. But this time it did, when he said: “critical few, trivial many.” When I read it, I felt – “Oh yes, indeed!!”. There are a lot of trivial things in life which are not worth the time. Also, it is not possible toย  find in advance what is that 20%. That is why he says, “Experience matters”. But how are you going to find the critical things through experience is a topic in itself (for me, at least).
  • Big things are always scary. Mankind has conquered it by dividing a big task into smaller tasks. This is, it comes to my mind again and again, the most fundamental thing in the advancement of human civilization. We also know it in the name of abstraction.
  • He, next, asks not to keep a drop down list of to-do items. Some things are non-linear inherently, so converting them to linear form is gonna make things messy. Instead, keep things in a quadrant and cut through them in the order. Any PIM tool that does not allow one to have such a view of to-do lists is not worth it.
  • He stresses some words: “You don’t find time for doing important things, you make it.
  • Learn to say NO. Again, this is something that is told to us many times, but it is high time we realize the importance of it. As noted earlier, we can do it now, or realize later.
  • He says, “Clutter is death.” Sure there are people who can get things done even in the presence of clutter, but they can do even more if there is no clutter. The investment (in the form of time) put in, definitely reaps in benefits when organized life is just habitual. It wont, then, take up our conscious part of mind or much time. In short, more discipline brings more productivity. Clutter fears you? – remember Divide and Conquer.
  • He emphasizes that time management is not being selfish – it is about being fair. You don’t allow your time to be wasted and don’t waste others’ time.
  • Interruptions are one big suckers of time. He points to some research data and says, “The average interruption takes about 6-7 minutes and it takes about 4-5 minutes to recover from an interruption”. Such a big sucker? I can very readily see that email is one. There can be other distractions in the environment. Proper arrangements should be made to avoid interruptions. While he is at this, he explains his brilliant idea – he cuts a window in his door, puts a glass and then shields the glass. He says that the trick has worked. ๐Ÿ™‚
  • Time journal is another technology that comes to our rescue -unconsciosuly or mundanely lead your life except for logging what have you been doing once in 15 minutes. Let a couple of days pass and then look into the time journal to see what has been done in the past couple of days. It is a powerful feedback mechanism to see how are we going through a typical day.
  • While we are at the journal thingy, he suggests that we ask some important questions:
    • What is unnecessary?
    • What could be delegated?
    • What can be made more efficient?
    • What is wasting others’ time?
  • He says that delegating can be made more humble by challenging the person, telling them what to do instead of how to do, and giving the relative importance of the task. This is a neater way of doing things than commanding.
  • And for people who delegate tasks to you – “ignorance is your friend”, says Randy. ๐Ÿ™‚
  • Finally he gives some last general advice like:
    • Turn money into time – you need not do all the mundane things
    • Kill television. Watching something repeatedly is like whiling away your time, without the other person whiling away his/her time.
    • Finally eat, sleep and exercise. What happens if you don’t do that – you will get hungry, tired and sick. ๐Ÿ™‚