Tuesday, August 25, 2015

Before fixing performance issues

We, in computing, have come across the phrase "Premature optimization is the root of all evil" one time or another. But sadly we don't seem to internalize it in our work. I'm reminded of this whenever a developer proposes a performance fix in the code.

Before fixing any performance problem, I like to reconsider it because of following two reasons.

1. Performance problems may be easy/difficult to solve depending on the situation, however all of them have one thing in common - they have a very clear goal. There's a number that we have to optimize - be it response time, FPS or memory footprint of the app. This makes the performance problem very rewarding to solve, just like a video game. There's a score to be achieved and we just have to find a way to achieve it. The developer can focus on that single number and forget everything else, in order to get a rush of endorphin. Therefore I think developers are biased towards fixing the performance problems than any other kind of issues.

2. When developers strive to achieve that magic number while fixing the performance problem, they tend to sacrifice a lot of other important things. Software design principles, coding guidelines, readability of code, documentation - all are considered secondary during the exercise. As a result, even though the software might run faster or lighter after the fixes, the maintainability of the code has been sacrificed during the process, which is a greater loss in long term.

I don't want to undermine the importance of performance issues, because the speed and memory footprint of a software are very important for it to be usable. However not all performance fixes achieve the same improvement in software usability. Therefore they should be evaluated carefully before fixing.

I take the advice of Guido Van Rossum, when it comes to evaluating performance issues:
* Are you sure it's too slow? Profile before optimizing!
* The universal speed-up is rewriting small bits of code in C. Do this only when all else fails.

Wednesday, June 17, 2015

No exams, Yes video games

The psychological studies on the subject of self esteem show that when children are criticized at an early age for their behavior, it affects their self esteem negatively for the rest of their lives. If that's the case, what effect does it have on children when they are told that their answers to the questions in the exam were wrong. This obviously leads a child to believe that he/she has done something wrong. Moreover, they find that they have done things "wrong", while others have done them "right". Although, all that has happened is they haven't understood the concept of the subject matter sufficiently. An adult can appreciate how minor this small lack of understanding is; but for a child it could represent a "social status" in their social circle of friends. It could represent their validation in the eyes of their parents. When they are told that they are wrong, it definitely registers as a negative feeling with them. The failure registers more strongly in their mind, than the reason behind that failure. This doesn't help them getting the correct understanding of the subject.

How can we then teach the children in a way that will convey to them that their understanding of the subject is not right, and yet reinforce this in a positive manner?

I look towards the video games for answer to this question.

In a video game, you cannot make progress through a level unless you have gotten the rules of the game right and have beaten the game AI. If these games of rules represent the concepts in academic subjects, then they will be the best replacement for exams. This mechanism of discovering your own mistake doesn't stress on the fact that you were wrong before, it instead highlights the fact that you eventually got it right and lets you proceed to next puzzle/level. Try to remember the excitement you felt, when you beat a game level on your own after failing at it many times. This definitely registers as a positive event in the player's mind. Also while figuring out how to beat the game, the player automatically realizes his/her own mistake thus understanding why he/she was wrong before.

It will take time to creatively translate academic material into a playful and artistic manner, and then design puzzles on top of them. But it is definitely worth doing. It's the right application of the computing technology to further the educational system of our society.

I am very hopeful looking at the games like Dragonbox Elements that in not too distant future video games will rid our educational system of that nightmarish phenomenon called 'Exam'.

Saturday, February 21, 2015