Thursday, September 13, 2007

Compiler Vs Interpreter

Compiler:
The name “compiler” is primarily used for programs that translate source code from a high-level programming language to a lower level language. A compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis, code generation, and code optimization.

Interpreter:
Interpreter is a computer program that executes, or performs, instructions written in a computer programming language. The term interpreter may refer to a program that executes source code that has already been translated to some intermediate form, or it may refer to the program that performs both the translation and execution

Compiled Languages Vs Interpreted Languages
The programming languages are generally classified as Compiled Languages (e.g. C, Pascal, CPP) and interpreted Languages (Python, Perl, Shell script). There is nothing specific about a language, which restricts it to being a “Compiled Language” or an “Interpreted Language”. For example both “Compilers” and “Interpreters” are available for PERL. Generally the classification is made based on most popular implementations.

Hybrid Languages:
There are some languages which are both Compiled and Interpreted. The source code is compiled to generate an intermediate code, which can be later run on different platforms using Interpreters. Java is an example of such intermediate language. Java source code is first compiled to give “Java Byte Code”. The JAVA byte code can be run on any platform using “Java Virtual Machines” (interpreter for JAVA).

Performance:
(a) Interpreter translates (does inline compilation) the code before executing it. Hence executing a source by interpreter (which includes both translation and execution) is slower than executing a compiler generated binary code (compiler actually generates object files which are later used by linker to generate binary executables). Interpreter does fresh compilation of the code, each time the code is executed.
(b) Run time memory requirements for a code being executed by interpreter is more as compared to memory requirements for executing a binary code. This is because, “interpreter program” is also running at the same time, which will have its own memory requirements.
(c) Interpreted languages are platform independent. The program can be run on any platform without any changes (provided that there is interpreter support on the platform). This is the greatest advantage of “Interpreted Languages”. Java, has gained immense popularity on mobile platforms, because the same code (Byte code) can be run on any machine (with JVM support available). Compiled languages require a new compilation (which generates machine specific code) for each platform.

Saturday, August 11, 2007

IT industry & Employee Attrition

Employee Attrition is one of the most critical (along with the weakening US Dollar) problem which Indian IT industry faces today.

Time to time, employee surveys are done to figure out what makes employees to love or hate their employer. Based on these surveys, IT companies (if not all - then at least those who want to retain their employees) take appropriate steps with hope of reducing the attrition. This is an interesting fact that some companies are inherently immune to attrition, whereas some companies fail to control attrition despite desperate efforts. In this post I have tried to analyze the factors which might cause employees to leave an organization.

Recent Surveys
—————————-

Recent employees surveys suggest that most common factor which caused employee attrition during last couple of years has been a disliking for “Immediate Supervisor”. This trend is strikingly different from previous trends, where monetary compensation and challenging work was considered to be the main attrition factor. Before we blindly accept the results of these surveys, we need to ask some questions to ourselves:
(1) Do engineers no more consider “Money” as the primary factor? (atleast I do not accept that this could be true for any profession in any part of the world)
(2) Does “Quality of Work” work no more matter to the engineers ?
(3) What difference does your “Immediate Supervisor” bring to your job?
Basic Instincts
————————-
We all (IT engineers) are human beings. And if we have managed to remain human beings (despite endless slogging at office), we must be bound by natural human instincts. In this post I have tried to analyze, if employee attrition in IT industry has any thing to do with IT engineer’s quest to rise the “Maslow’s Pyramid of human needs”. To start with I will re-visit the Maslow’s “Heirarchy of human needs”

(1) Physiological Needs: Breathing, food, water, sex, sleep, homeostasis, excretion
(2) Safety: Security of body, of employment, of resources, of morality, of the family, of health, of property
(3) Love/Belonging: Friendship, family, sexual intimacy
(4) Esteem: respect of others, respect by others
(5) Self-actualization: Morality, Creativity, Spontaneity, problem solving, lack of prejudice, acceptance of facts.

How we rise (the Pyramid)
—————————————–
Most of us take up our first jobs to meet the bare minimum “Physiological Needs”. I am sure that most of human beings will be happier writing poems than writing softwares. Yet, they deny easier Arts courses (and study engineering), and a fun-filled employment of being editor in a publication company (and slog in front of computers). They choose a less-interesting career with a hope that this career will better satisfy their “basic needs”. This is the reason that the very first factor we consider to choose our first job is just “Money”.
(There may be few people who find programming more interesting than poetry. This is in fact “science of evolution”. A more rewarding work over a period of time can also become more like-able. Few would have found writing poems fun-filled in early days of poetry (and would have got scared by its complexity). But as kings started enjoying poetry, and poets were heavily paid, it became an enjoyable and respectable profession - since I belong to relatively old generation, I still find poetry more satisfying than coding - I hope my kids will not)

We find our jobs very challening and interesting for first few years (or first few months - based on how fast we adapt to the new environment). Then we start feeling comfortable with our work. We no more worry if the code we write will work or not. We no longer worry if our client will fire at us or not (for those silly mistakes and for skipped deadlines). We no longer worry if our manager is satisfied with us or not (and slip out of office to watch a movie on Friday night). I know there are few unfortunate ones for whom these worries never end - and they are the most stable people in an organization (they exist forever, unless the organization itself decides to fire them). This is the sign of craving for attaining next slot in the (Maslow’s) pyramid (of needs). From this point onwards we look for security. “Quality of Work” is an important factor in creating “sense of security”. Those people who are working on cutting edge tecnologies and who are doing more skillful work are more likely to retain their employment (than those who are working on simple tasks) in long term. One wave of slowdown - and testers will be the first people to get fired. Once company gets rid fo unnecessary testers, only then the fire will come to Developers. And probably designers will be the last one to go.

Ofcourse there could be exceptions to the above rule. Some companies might find that testers are more important for them (Are there any such well managed companies who keep optimum staffing of testers) and they may want to fire Developers instead. But such chances are very rare. Since IT industry is very competitive, companies need to keep on developing newer products (even if old products are not selling too well), to stay in the business. So companies need to retain developers (unless they have taken the final decision to shut down). Even if companies fire developers, the percentage of fired developers will be much less than percentage of fired testers. In tight project budgets, developers can even take up the additional burden of testing (most stuff) themselves (rather than testers being asked to do the development).

Those of us who attain enough sense of security in their jobs, still feel some itch. They want a feeling of belongingness and love at their work place (next stage in Maslow’s hierarchy of needs). They want to feel closely attached to their organizations, teams and to the people whom they work with. They want to be appreciated for the work which they do. They want to hear how their contribution is important to the company and is helping the company to grow. They want to bond with their colleagues. They want to participate in Cafertaria discussions. Want to smoke at the office terrace with big bosses. This gives them a feeling of close knit family at work where love flows from all direction. “Immediate Supervisor” plays a big role here. It is his wish to appreciate your work or to scream at you. He might encourage you to mingle with the colleagues and let you hold long cafeteria sessions. Or he might realize that you have not been focussing enough on your work and take challenge of giving you sleepless nights. He might make you fall in love with you work space. Or he might turn the work place in to biggest nightmare for you. So, “Immediate Supervisor” (as pointed out by recent surveys) is an indirect reason (direct reason is lack of love and belonging) for attrition.

Having discovered love and belonging at work place, what we look next is Self Esteem. We enjoy the respect which we get from others at work place. And we feel a natural inclination to praise others. To appreciate their efforts, to praise their skills. And we expect the same in return.

The highest stage what an IT engineer can aim to achieve in his careers is that of self-actualization. I have met a few people who have realized their true Selves. They will be always willing to help you, on or off the record, no matter how simple or how complex your problem is. You can feel free to ask them the silliest of question, and they will respond. You can fire impossible questions at them and they will not shy away. They will help you at design, development and debugging with similar enthusiasm. They will be willing to spend long hours with you, when you are debugging a tricky issue in the lab. When it gets too late for you, they will tell you that it is the time to go home and come back tomorrow with a fresh mind. And they will probably have a fix for you, before you start your work tomorrow. They might surprise you by sending a code-base which they developed yesterday night, while making the design document. They are the greatest and most altruistic people in any orgainzation.

Answering the (Un)knowns
—————————————–

Let us come back to the questions, which I raised at begining of this post:
(1) Do engineers no more consider “Money” as the primary motivational factor?
(2) Does “Quality of Work” work no more matter to engineers ?
(3) What difference does your “Immediate Supervisor” bring to your job?

If you observe carefully, “Money ” and “Quality of work” still remains to be the primary need of employees. However there are some organizations where employees enjoy the these privilleges by default. In such environments, people look for love, belonging and respect (self-esteem). Immediate-supervisors have a big control over their sub-ordinates. In case your supervisor is Ass-Holy, he can make your life miserable and deprive you of the needs which you are looking for (though it would not have costed him anything). A decade back, IT industry in India was still nascent. Most engineers were still looking out to make a good amount of “Money”. Big pay cheques was what engineers used to look for. The “Dot Com Burst” of 2000, was a big lesson for engineers in India. They realized the fact that they can not take their jobs forgranted. They might loose it any day. Firing was a new concept in India at that time. People had always enjoyed a life-time job-security till then: either in form of a government job or in form of a private job (shielded by trade unions). After 2000 down turn and firings, engineers in India started to look for job security (which comes by default from Qaulity-work). There are still many companies in India, who sell job-security to their employees (and manage to attract them at lower salary levels). There are organizations, where “money” and “job-security” comes by default. These organizations still face attrition, if they fail to provide a sense of love and belonging to their employees. Those organizations where these two factors does not come by default, still face attrition because of same basic reasons.

Compensation Hierarchy
————————————–
Based on my analysis above I can construct a Compensation Pyramid (in accordance with maslow’s need heirarchy) for IT engineers. IT engineers start their careers at bottom of this pyramid, and aim to grow upwards (some might feel stagnated at an intermediate point)

(1) Money
(2) Sense of Security (Most engineers get stagnated here)
(3) Love of co-workers
(4) Belongingness to the organization
(5) Respect of co-workers (supervisor and subordinates)
(6) Freedom to Philosophize (Very few attain this slot)

What can employers do
—————————————–
(1) Employers (to be specific - Middle Management and HR) need to identify the current position of each employee w.r.t this pyramid. They should evaluate emloyee’s desperation (desperation should be measured based on efforts) to reach the next slot, and make sure that the employees rise at a speed which is directly proportional to their desperation.
(2) Employers clearly need to understand that different human beings have different intensity of desires. And some human beings get saturated after a few desires have been satisfied.
(3) It needs to be made sure that employees with in-human attitude (attitude developed on basis of gender/cast/regional biases, or frustrations, or incapablities) do not handle and leadership responsibilities.
(4) Identify the people who have reached state of self-actualization and give them authorities. These are the people who can inspire and transform the attitude of employees in a organization.

Additional notes
—————————–
Quality of Work: Quality of work is a myth. Quality of work does not depend on what work you do, but it rather depends on how you do. Most people in IT industry tend to associate “code development” with good quality work, and associate “testing” with bad quality work. However each of them could be performed in a good or bad way (with good or bad quality). This myth has originated because of the more job security which developers enjoy (over testers).
Appreciation: Appreciation is a very powerful tool in hands of manager. It does not only help engineers to feel loved, respected and being useful to organization (3rd, 4th 5th stages of compensation pyramid), but it can also create a (false or true) sense of security (because it helps to build confidence) amongst employees (2nd stage of compensation pyramid).
Love: I have seen many people leave the organization when the people with whom they interact most (inside and outside the office) leave the organization. This again vindicates the importance of 3rd stage of the suggested compensation pyramid.

Thursday, August 2, 2007

Programming Trends: What Next?

Are you a software programmer wondering about what is going to be the next trend in field of software programming? If yes, this post might help you to answer some of your questions.

In last few decades we have seen transition of software development process from low level (binary) programming to High level languages (via assembly language programming). The main driving factors which called for change in programming model were increasing complexity of applications. We also realized that just “High Level Language” is not effective for modern applications. A high mismatch between the amount of software which needs to be written and the availability of software programmers( the later is less) calls for highly efficient software development methodologies. This inspired a lot of research on Software Processes and Design Techniques to improve the individual and team efficiencies, which has now matured to a great extent. Now the focus is on “Automatic Code Generation Tools“. Though there are a number of such tools available (for different languages), but it will need a lot more research to make these tools reliable and user friendly.

Coming back to the question of next trend in field of programming. Let us again have a look at what in past inspired changes in programming methodologies. The major driving factor was increasingly complex applications. What enabled the transition from simpler to complex applications? It was availability of complex hardware. We have transitioned a big way from days of 8085. The modern processor might have over a billion of transistors operating on GHz frequencies. So, in order to answer our main question, we first need to figure out, what is the current trend in processor design (this in turn will drive the next trend in programming)

The processing power of a processor depends on two major factors
(a) transistor count - which is a fair indication of processor’s actual power
(b) clocking speed- which tells how many times per second, processor can utilise its raw power. Doubling the clock speed will mean that you can utilize the actual power twice in a second.

VLSI design has reached such a stage where increasing the processor speed further is not possible (as per the current technology). Hence the processor designers are currently focussing solely on increasing the transistor count to increase the processor power. The modern processors contain multiple CPUs - which is the easiest way of multipying the transistor count. Intel’s Dual Core Processor is one of such examples, where a single CPU core is replicated twice on the chip. In next few years we might see multiple of such cores on a single processor chip.

Using a multiple core processor for multi-threaded applications is quite easy. The easiest way will be to run each thread on a given CPU core. But it becomes really difficult for a single threaded application, to utilize the multi-core architectures. Though a lot of domain specific work has been done (in Multimedia and Communications) to disect the commonly used tasks in to parallel independent tasks (which can be run on parallel cores), there is very less scope of parallel algorithm design in traditional PC based applications (e.g. a document editor, mail-box, browser).

Since the applications really can not be easily dissected in parallel, the main focus will be on designing intelligent compilers to utilize the multiple core CPUs efficiently. Compilers will understand the inter-dependency of given instructions and allocate them to different CPUs (as efficiently as possible). But this job can hardly be done with the current programming languages. Compilers will need some constructs in the programs, to understand the integrity of applications and instructions. This could work in two ways - design a completely new language, OR add some construct to the existing languages. Current focus is mainly on the later. There is lot of research being done on this “Parallel Languages” - most of these languages will evolve from C and C++. So, the programming construct in combination with intelligent compilers may drive the efficiency in coming years. Though MS is still suspicious about parallel programming (as it always is with competitors), Intel is heavily funding a number of research projects on parallel programming.

Let us wait and watch.

Saturday, July 28, 2007

Software Development & Humanity

I am a Software Engineer. I earn “just less than enough” money for a comfortable life. I want to increase my earnings, and I strive for it. But because of high inflation, the prices of essential commodities increase steeper than the increase in my income. I have a good feedback mechanism from my brain to body. The feedback from my brain, makes my body work much harder. As a result, I tend to spend more time in office. I tend to cut my sleep and spend more time to enhance my technical skills. I am always struggling and I am always hopeful. And, I am quite sure that it is the right way to live (or right way to fight for existence).

Recently I happened to read a book on “Extreme Programming”. The book discusses about various basic principles which must be followed to become a successful software developer (on individual level as well as an organization). First and foremost principle being talked about is Humanity. It discusses about basic human needs (of any human being) which must be fulfilled in order to make one excel. This is quite shocking to me. It raises serious doubts in my mind regarding my life style and I am now becoming suspicious if I have been living my life on the right track all along. Let us have a look at the basic needs which this book talks about.

————–
HUMAN NEEDS
————–

* Basic Safety
* Accomplishment
* Belonging
* Growth
* Intimacy
Some other Needs which must be satisified, but out of work place.
* Rest
* Exercise
* Socialization

———–
HERE I AM
———–

(1) Basic Safety: Fredom from Hunger, physical harm and threat to loved once. Fear of Job loss threatens this need.
I work for a small IT company. We are profitable and we are expanding. So, I do not fear any immediate job loss. But, deep inside (my subconcious brain) I am aware that my job may not last forever. I stay far far away from my parents. I have not much time to meet my friends and relatives. I keep sitting in front of a dumb PC all the day, which makes me vulnerable to many chronic deseases. While driving, eating, sleeping, I think only about my work.
(2) Accomplishment: The opportunity and ability to contribute to their society.
As a child I wanted to become an administrator, or a teacher or a journalist. So that I could directly contribute to the society. But I ended up becoming an Engineer. Since I wanted to contribute to my society and country, I joined a job in Public Sector. Soon after my joining, I realized that there was not much to contribute (neither to society nor to myself) at that place. The project which I was working on was late by many years and after the completion it got scrapped (after around 10 years of total struggle and 3 years of my contribution). I decided to change my job after that. Now I work for a private company which makes multi-media products. I make products which are being used by human beings. I should be more than happy that I am contributing to society by providing them these cool products. But, I personally do not believe that society really needs these products much. These products are being made, so that investors (which form a very very small section of society) can become richer and richer. As per my opinion, society needs other major attention: There are poor people who need food, who need education, who need healthy life.
(3) Belonging: the ability to identify with a group from which they receive validation and accountability and contribute to its shared goals.
I do not have much time to associate with any other group than my organization. The primary goal of my organization is to make products faster (without wanting to implement a well managed process which might improve the over-all efficieny) and at cheaper costs. The people whom I work with, are my good friends. But more than that we all are competitors to each other. So we deny any true appreciation to each other.
(4) Growth: the opportunity to expand their skills and perspective.
My company helps me to expand my skills by asking me to work on different techonologies after ever few months. This exerts a high mental stress on me. More than finding any growth of perspective, I feel that my body and mind are GROWING old faster.
(5) Intimacy: the ability to understand and be understood deeply by others.
My PC and my cell-phone have become the most intimate things in my life.

(6) Rest:
I beleive in working hard. All work and no play has become the guiding principle of my life.
(7) Exercise:
For last two years I have been planning to start regular daily exercise.
(8) Socialization:
I used to meet my friends over drinks, every other day. But these days I fail to find time for that.

—————–
New Resolutions
—————–

If you are a Software Engineer working in a small organization (in a busy town of India). It is most likely that you live a life which is quite similar to mine. I am not sure what could be done to improve the human factor of our lives, but I have decided to start on the following activities starting from tomorrow (I hope that this tomorrow comes).
(1) Regular Exercise
(2) Belonging: I am planning to do something which helps my next generations. To start with, I am going to contribute technical and non-technical knowledge to kids them via seminars and books.
(3) Socialization: I am going to meet at least two friends, every week.

——————–
MASLOW’s HIERARCHY
——————–
I realized that I have totally forgotten about “Maslow’s Hierarchy” of human needs, which I had read in my school days. Probably this topic was included in our course-work, so that we can appreciate our (and other’s) needs as a human being, and strive to achieve them. This is likely to make our lives happier. But, we (me and my course-mates) always viewed our course-work as a mean to get out of schools, and enjoy the lives outside. So it is unlikely that any one of us (me and my course-mates) remember this hierarchy. I am just revisiting this hierarchy.

Bottom

| Physiological Needs: Breathing, food, water, sex, sleep, homeostasis, excretion
| Safety: Security of body, of employment, of resources, of morality, of the family, of health, of property
| Love/Belonging: Friendship, family, sexual intimacy
| Esteem: respect of others, respect by others
V Self-actualization: Morality, Creativity, Spontaneity, problem solving, lack of prejudice, acceptance of facts.

Top

I feel that most of my Top Needs are now being fulfilled. I use my creativity at work place, I crack a lot of tough problems, and I have learned to accept the facts. But Bottom needs are mostly unsatisfied. I am not sure how lucky I should consider myself having reached the top of this pyramid.

——————–
MORE on HUMAN NEEDS
——————–
Nine basic needs as per a web-resource

(1) Security
(2) Adventure
(3) Freedom
(4) Exchange
(5) Power
(6) Expansion
(7) Acceptance
(8) Community
(9) Expression

I wish you all the success in your efforts to become a fulfilled human being.
—————————————————————————–
References:
(1) “Extreme Programming Explained” by “Kent Beck” and “Cynthia Andres”
(2) http://en.wikipedia.org/wiki/Maslow’s_hierarchy_of_needs
(3) http://www.itstime.com/jun97.htm

The Art of Interviewing

Why this post?
—————

There was a time, when the ratio of jobs to applicant was very less in any field. The interviewers were virtual GODs and interviewees had to leave themselves on the mercy of these virtual GODs. But times are changing now - specially in field of Software Development. Though, the ratio of jobs to applicants (in SW development field) may still be less than one, but the ratio of jobs to deserving candidates has become well above one - it can be 2, 3, 4 or … based on the skills you are looking for. In such changed scenarios, Interviewers are not the GODs, but interviewee is. In Bangalore, any good SW engineer looking for a job will have minimum 2 to 3 good offers in his hand, within a couple of weeks. Finally, which company this candidate decides to join, will depend on the impressions which these companies have left on him during the interview process.

Today, almost all SW companies seem to be growing. This growth, combined with high attrition rates, puts enormous hiring targets before companies. This means a large number of interviews needs to be conducted to find good and deserving candidates.
Some (very few) companies employ hiring consultants to do the initial filtering of candidates- this could involve a couple (or more) of technical interviews. A few senior people can then conduct the final rounds of interviews with the shortlisted candidates. However most companies get all the interview rounds conducted by their own regular employees. This implies that almost every body (at every level of hierarchy) in the company at some time or other is involved in the interview process. Very few companies provide a formal training on interviewing skills to their employees and rest of the companies do not even provide an informal training to the employees (before they start interviewing the candidates). Even those interviewers, who have received a formal training at some point of time, generally tend to drift from the RIGHT interview process , which could change the final decision of the candidate (about if he should join this organization or not).
There is a large amount of material available on art of giving interviews, but there is not much information on the art of taking interviews. Hence, I decided to put this post.

WHAT YOU MUST KNOW before conducting an interview
——————————————————————
Make sure that you have answers to the following questions, before interviewing a candidate:
(a) What is the job-opening for which this candidate is being interviewed?
(b) What kind of skills and abilities does one require to perform the functions needed for this job?
(c) Why (what points in the candidate’s resume) this candidate’s resume has been short-listed for the interview?
(d) What questions are you going to ask the candidate, to ascertain that he is fit for the job.

Have the right FOCUS
—————————
I have seen some interviewers who conduct interviews with the prime objective of
(a) Showing their own abilities and skills to the interviewees
(b) Proving to the management that they are the best, and no one else is worth hiring.
Interviewers should come out of this mindset and they should primary focus on understanding the candidate’s abilities and skills during the interview.

Decide on QUESTIONS in advance:
—————————————-
The questions should be designed based on candidates’ current field of work, and skills needed to perform the job under question
(a) You need to make sure that the questions which you ask are relevant to the candidate’s experience. Though all candidates are expceted to know the basics of his course, but do not expect them to know every thing about what they have not done. For example, If some one comes from a pure application background, it is pointless to ask them about Operating System Internals.
(b) Questions should be also relevant to the work-profile of the job being offered. If candidate is supposed to work on QA testing, there is no point in asking him about complicated computer algorithms.

Get your QUESTION BANK REVIEWED
—————————————————
Once you have come up with a set of question, list them under a formal document, along with the answers. Get this document reviewed by your colleagues or friends (or any one whom you feel comfortable with). This will help you to ascertain:
(a) Questions which you have formed, are indeed relevant for this interview.
(b) That the answers, which you think to be right, are indeed right.

A few DONT’s of interview process:
———————————-
(a) Do not bias yourself based on candidate’s resume, his/her looks or is communication skills. Communication skills are important, but they are not the foremost requirement for most of the jobs.

(b) Do not insult candidates if they are technically poor. Do not argue with them, if you feel that their answers are wrong.
Any candidate who goes out of interview (no matter how good or bad he was), is going to talk with a lot of people (who will take his words) about the interview and the company. If you have annoyed the candidate, it is very likely that he is going to talk negative things about your company. If you maintained a good environment during the interview, it is likely that he is going to spread a good name about your company (irrespective of whether you finally hire him or not).
(c) Do not unnecessarily stretch the interview. I have seen some people who interview candidate for hours, and then give a one line feedback, “Candidate was very poor”. You really don’t need hours of questioning, to figure out that a “candiate is very poor”. Start with the basic questions. If you feel that candidate is not good enough, close the interview. If you find the answers satisfactory, carry on with the next level of questions.

STARTING and CLOSING the Interview
————————————————
(a) Before you start firing the interviewee with questions, tell him about yourself, about the company and about the job-profile for which he is being interviewed. Then ask him about his organization, his over-all experience and the kind of role he is currently playing in his ogranization. Ask him about why he is looking for a job-change. Make sure that there is an expectation mismatch from both sides.
(b) At the end of interview, give a chance to the interviewee, to ask any question about your company, your group and the work which he might be offered.

……………..

This post is based on my personal experience and observations, if any reader has some thing to correct, or more to add, please feel free to post your comment.