Showing posts with label Creativity. Show all posts
Showing posts with label Creativity. Show all posts

21 September 2013

OpenGyan - Becoming a Better Programmer

[Alert: Longer post, targeted for students community. Comments are welcome from seasoned software engineers]

Recently we had a couple of OpenGyan's workshops and i happen to scribble my ideas to the students. I hope i will be able to dedicate more time in writing posts like this. Hope this helps the students' community. Though software engineering is a very complex area (is it really that complex?), we are going to focus on the things that are very important for software development of any sort - may it be a lab exercise or a project. The readers are suggested to reflect upon the exercises given at the end of each article for better understanding.

I was reading and reflecting on the short article written by Badhri on Programming languages. Though it was short, it gave a general overview about the programming language. Any programming language is a tool to achieve your imagination. For example, if you are writing a simple program (similar to the ones that is given to you in lab), you do not need to think much. But in reality it isn't the case. To be a programmer, knowing a programming language is secondary because knowing the syntax of the programming language won't make you a good programmer. If knowing programming language is sufficient, then compiler would do the job. Software development is much more than knowing a programming language or few.

Any software is a solution to a given problem. And programming language is just a tool to solve the problem. The solution to the problem is more important than the tool (the programming language). In order to develop a better software one needs to follow certain basic principles in a specific order. The rest of the article discusses the basic principles of software development in a much simplified way.

First, one needs to understand what needs to be done. Because you cannot go on writing program simply for everything. You need to understand that you are writing a program for someone to use it. Remember that you will not always write program to improve your knowledge. So understanding the requirements - what needs to be done plays a crucial part. Understanding the requirements is the first step and if you do not understand the requirements, remember you do not have the second step.

As a second step to writing a program, you need to know how to solve the given problem without employing much of your knowledge on programming languages. For example, if you are writing a game, you need to understand and know how the game is played, how many players are involved, what are their roles etc. In this phase, you will least bother about whether you will use linked list or array. But you will solve the problem at an abstract level. This is called high level design. After high level design, you will decompose the high level design into modules and design each modules. For example, if you are writing a program to validate Palindrome, you need to have input module, processing module and output module. This ability to decompose the problems in sub-problems and solving them with sufficient data structures and algorithms is called low level design. While you are solving the problem, you should also keep in mind about the future problems that may crop up. Your design has to be flexible enough to accommodate future problems (which is quite challenging).

The third skill that is required is to convert the design into product and this is where the programming language comes in. Without the above two steps, the third skill is not worth and in fact not needed. Once you have understood the problem and solved it at a conceptual level, then implementation becomes pretty easier. You do not need to beat around the bush. During the implementation phase, you will implement the entire software module by module and finally integrate the modules to make it bigger whole. Apart from implementing the design, the coding is also about producing maintainable code. When you develop software, you are writing the software which is expected to live more than your lifetime. The program (aka code) can be written with a lot of grace and the code that is well written will live beyond ages (example Unix). The developer needs to understand about other developers who are working with him/her and the people who will be working in future. So programming is not merely following syntax but much more than that. As this point of time, we have discussed about three important qualities of a developer.

The final thing that you need to do as developer is to test your software. The primary focus of testing is to uncover hidden defects. As a developer, you are the best person to know about your code and it makes sense for others to bank on your certificate. So, it is the developers' responsibility to test the software and fix the defects. This is called as unit testing as the developer who develops it ensures that all the code that is written works as expected.

You need to evaluate how much percentage does a programming language play here. May be 40%. But please do not get me wrong. For writing a software, you need a language however for solving problems you need skills like understanding requirements, designing and most importantly testing it. Without these skills, you will not be able to excel as developer. Now would you understand why you have "Algorithm", "Flow Chart", "Hand Calculation" and "Output" section in your lab observation.

When you follow the above software development practices right from the beginning, you become a natural programmer/developer to solve any complex problems. You may want to evaluate your current way of writing programs. First solve the problem and then start writing the program. Though the exercise is short/simple, i am sure there is a lot to learn in terms of processes.

Exercise:
Take any simple program (Palindrome, Fibonacci series) and apply all the concepts you understood from this article (Duration: 3 Hours, Complexity: Medium)
  1. Clearly understand the requirement/problem. For example, what is palindrome or Fibonacci series
  2. Solve the problem by decomposing into modules
  3. Write the software
  4. Finally test

Happy Weekend

15 November 2010

Yes, Testing is Fun and Brain Intensive

Preamble

Few days back, i wrote on the topic - "Testing is Fun and Brain Intensive - Why" giving a scenario. I was stumbled by the comments of Rajaguru and thought it had deeper/unusual meaning. Hence requested him to share his insights by expanding his comments. This post is just expanded version of his comments and hence the post will be little short (if you take this as a comment, then it is bit lengthy). Before reading this post, i would suggest you to read this and then come back here. From here on, the post contains insights shared by Rajaguru via his comments. BTW, this is the first guest post in Unstuck (a new thing). Looking forward for more guest posts with deeper insights.

@rajaguru - thank you for the new start :-)

Real Stuff & Insights by Rajaguru

When I saw @lnarasim tweeted the title ”Testing is Fun and Brain Intensive”, the immediate thought that came to my mind was "wasn't the testing boring one"? Because that's what we will discuss with other people. As a developer we think that testing is mundane and routine task. The more I thought about it, the clearer I was because I was testing (questioning) my thoughts! Leave the philosophy and let us get back to real stuff. Being a developer, designer or tester, testing is must, the more we test the more effective is our design, coding, system. Come on let’s test and find it!

In the post the problem states, test the following, assume you are testing compiler, and don’t go beyond the integer.

int a = 10, b = 255, c;
c = a + b;
Simple. Isn’t? The first test case comes to my mind is print the value of the variable "c" and check the answer is 265. Shall we consider the testing of “+” is over? Why not it produces the desired result. Let me stop and rethink, whether the testing over. Noo. (A big No... not big O J ).
I am testing the operator “+” for integer, when you say Operator, you need to test what are the possible operands it can take. Whether it takes +ve integer or –ve integer? If it’s +ve or –ve the range it takes?
The operand is over, what about the result? What it takes, when both the operand reaches the maximum value if result also same type, how it can be assigned the result? So, whether result should be stored in a data type that accepts higher range than the operands?
          
Whether now we covered all the test cases? Rethink, we are testing compiler, and operator “+”?  Now we will move one step further, how the addition can be implemented, using number of shift operations? Or move operations? Binary additions? Incase, what are the instructions it should use for implementing that? Whether, all machines support the same instruction set?
Where this value will be stored? Memory requirements to run this program? … Let me stop here. May be we can’t stop on some point saying all possible test cases are identified? Always we can add more, test more, and break the system, change the implementation and start the testing from the scratch.
We can conclude that Testing is really Fun and of course Brain Intensive too, when you want to get more understanding of the system, test the system until system is broken or you are broken :-)

About Rajaguru:
Software Engineer by profession, chatterbox to friends. He says he always searches something in Google, books, movies and life. Connect with him in Twitter, Facebook, LinkedIn. For those who want to see the "user interface" of Rajaguru to identify when you see him next time (to buy you food or movie ticket), here is his picture with a temple backdrop.


12 September 2010

Mindful Living For Simplification and Abstraction

We are sum of mistakes and we learn everything by making mistakes. When we were kids, we just couldn't hear what our parents used to say when we were about to touch a candle flame. Our reflex kicked in when the flame hurt us and we registered that event in brain permanently. We build our knowledge base by etching the neurons and their interconnections. This etching process is called experience. As we gather such experiences, our intuition also grows and our intuition reflects in the form of our actions. Our action leads to mistake and the mistake is again fed back. It is a constant learning process. We are life long students. Some of us are quite aware about that and some of us are in the process of learning that.

But now the question is how to learn fast? One option is to learn from our mistakes/actions. Another option is learning from fellow human beings. We can agree to some extent that learning from others helps us to learn fast. But no faster. The lifetime of human beings are pretty long and if we rely on learning from human beings alone, it wont be sufficient. How about learning from animals and nature? How can it be possible to learn from animals and nature? In order to do that we ought to be simple and adopt a simplistic living. A simple living is not only leading life with less things but also living with mindful thinking.

A student asked his master. You say that each event is unique. An event occurs as it is interconnected with so many other events, some of them are dependent on other events and some of them are interdependent on other events. But yet, how can the solution to the problems or interpretation of these events can be generalized (or how come Buddha simplified that the root cause of all problems is "desire"). The master answered his student that it is all about simplification and abstraction. Simplification and abstraction are quite possible only when we live a mindful life - state of complete awareness. You have to simplify things leaving out irrelevant things and consider things that are relevant (which is abstraction). It is when you simplify, you will be able to abstract.

When we have total awareness, we can learn from ourselves, others, animals and nature. All the encounters will teach us something and even the restful mind will teach us something. Mindful Living is needed to understand interconnectedness of many events and hence a must for simplification and abstraction.

What do you think?

24 October 2009

Think Twice Before Acting on Others Decision

It has been quite an experience these days. Every year, I tend to work with great minds as my teammates and this gives me immense experience. When I started my career, I was weak and numb. But over a period of time, my confidence grew by just looking others. This experience has taught me "think before you act, think twice before you act on others words".

The above sentence has two parts. The first part "think before you act" is obvious. The second part "think twice before you act on others' words" is not so normal. It is abnormal. When you are acting on others' words, you are acting in conventional way. Most of the times, the conventional way is the way that is traveled more. It does give you experience but it doesn't give you different experience. You are going to be in a box.

But when you think deeply (that think twice), you need to understand the hidden meaning and things will start to appear differently. This is like you read a classical book for the second time - the gets into the clearly. So, when you act on others' words, you need to think twice. It is an opportunity to go creative. It is the way that is less traveled and you go out of box. Do it, you will be happier :-)

This is highly important because in this world we are always conditioned and it requires a strong will and mindset to think deeply. The entire world will conspire against you to condition you.

29 January 2009

Technological Innovation - How simple is it?

This is the time, when so many companies are sharply cutting back, the creative thinkers and innovation managers talk about continuous investment in innovation. They argue that the companies should look for opportunity to cut back on operations but not on innovation. Their concern seems to be valid. While many companies are giving a bleak outlook, there are very few companies growing even in the tough times. Are those companies well managed or do they happen to delight the investors just by mere coincidence? Whatever it is. The innovation is going to be a key differentiating factor. Many companies say that they are "most innovative company". But the real fact is that they aren't. No one other than the company says that they are innovative. They speak "Greek and Latin". Without understand what is innovation and simple way to move forward, most of the companies are going to be in no man's land. Is there are simple way to identify where the market is going? It is simple to say "Stay Abreast".

Innovation is doing things in a way that no one has done before. Innovation has clear business results both for the producer and consumer. For example, consider the case of Edison. He had so many inventions and he marketed all the inventions.  He produced so many products and sold them (obviously for a profit) and the inventions changed the quality of life of the consumers. Business results are key to innovation. All innovations must have Win-Win proposition.

Innovation can be classified into two types - blue ocean and red ocean. In the case of red ocean, you primarily focus on improving or redefining existing things and few of your competitors are doing the same. Blue Ocean is all about creating new markets. In the current climate, it is difficult to create new markets in realistic terms. However, you can be the first to swim in a red ocean.  

Innovation is catching up with the trend and moving along with trend. The nature spawns so many species but only very few species survive. The same is the case for innovation. When there are so many technologies, the fittest one survives. However, for someone who is innovating, the probability of identifying the right one is very low and hence there has to be a portfolio in innovation. One should try so many things and only then he/she can innovate few things (Darwinian law). But one can increase the probability of innovation just by observing the developments consistently. Who believed that "Web 2.0" would be a big success. But the companies who had Web 2.0 in their portfolio where successful.

How to spot on the developments? Simple. Just subscribe to lot of newsletter services and do a data mining at a simple level every month. At the end of few months, you can see where the world is going. Once you see the trend in a specific direction, maximize your energy and focus on high traction area. When you do this, the probability of uncovering something new and solid (with tangible business results) is more. Innovation needs a lot of hard work and never comes that easy.

Are you asking me, did you try it? My honest answer is "No". However, I wanted to try this approach towards innovation and get my idea reviewed by you :).

21 December 2008

Law of creativity evolution

I have been in an illusion that all geniuses in the world such as Einstein, Edison, Leonardo da Vince, Michelangelo and Darwin are only creative thinkers. Their hard work in producing the masterpiece is huge and their masterpiece is so massive and elegant that the quality of invention is sufficient to over weigh the hard word. Recently, I got an opportunity to start knowing about creativity reading a book of Michael Michalko where he talks about the how ideas can be generated, what are steps and takes through them progressively.

One of the thought that impressed me and I quite agree because of my similar thought in my subconscious was "Law of Darwinian Evolution applies to creativity". The nature ensures that it creates millions of species and combining many genes and it leave those species there. It is up to the species to survive against the time. The nature provides level playing ground and the concept of "Survival of the Fittest" is quite a powerful idea and the truth. The nature never deviates from the truth even by a negligible margin.

In similar way, the creative thinkers were able to play the role of nature by just creating so innumerable ideas. And finally, let the ideas to float and pick the right ones. To be precise, the right ideas manifest to their eyes. This is how most of the inventions are made.

Based on the above statements, I would like draw some inferences that will be useful to me and keep me focused. Creative Thinking is not feasible without hard work. Hard work is the basis and common attributes of all creative thinkers. If someone is able to generate creative idea, it just happens once as a mere coincidence. If you want to be consistent in producing creative idea, get the basic right which is work hard. This is evident from the fact that there were 3500 note books scribbled by Edison during his lifetime. So, work hard.

18 December 2008

Creativity - Yet another journey

A couple of months back, I bought a book "Cracking Creativity" and forgot about the book. Recently, when I was searching for some other book, I found this book and thought I should give it a read. It happens consistently that I never complete a book (except Freedom by OSHO) and I do not have any sort of complex of not reading the books completely.

I read first few paragraphs and found that I should read the book. My intention is not become creative but to know who creative people like Einstein, Edison, Michelangelo, Leonardo da Vinci and so many others saw the problem differently. There was absolute comparison between creativity and human evolution. The author conveys that the many speicies exist today due to "trial and error" approach of the nature. The nature creates many species and only very few survive many years. This applies very much to creativity. One generates different perspective and many solutions solving the problem. Then the "trial and rule" comes into play. The nature or system picks up one solution over a period of time and that becomes widely accepted solution (probably a best solution). So this ability to see a problem in different dimensions will by itself bring a variety of solutions to the table.

I strongly recommend this book to someone who wants to see the world differently and think differently. By the way, I just read few pages of book. Wait for sometime for chapterwise review.