July 2015

tmi

Too much information. Too much information at once, to be more precise. It can happen sometimes when you are learning, especially with someone more advanced than you are at that moment. You hear so much, but after a while, it just becomes a sound, indefinite and unclear. And then you are back to the “I don’t know anything and never will” phase.

It happened to me many times; I was both the receiver of the information and the provider and because of that I believe I have a somewhat insightful grasp on the mechanics behind it:

1. The receiver is learning, he/she can be frightened and less absorbent to new information,

2. The provider often doesn’t realise how much does he/she know and is very comfortable talking about the topic at hand. The provider gives too much information because he/she does not know it is too much.

To illustrate a bit, I remember the first time it happened to me while learning to code. I met with this guy Mario, who was an experienced coder, and he wanted to show me PHP/web development basics in a few hours. The idea was not for me to be able to build a new Facebook after that session, but to understand the general principles involved, from setting up a server to writing some actual code.

At this point I’d like to stress that I was not a fan of setting up servers. At all. For some reason, it scared me more than writing code. After we set up LAMP (linux, apache, mysql and php) on my machine, which already took most of my concentration, he started explaining basic stuff like GET and POST. At that time, I was just beginning my second year of studying computer science so I was still a rookie and didn’t get to HTTP methods yet.

This was all happening very fast. He was talking and talking and talking. I was listening, but when we got to the end, I barely remembered anything he said. “I know this is a lot to take in” he said, “but it will settle down in time.” Despite what he said, I was feeling lousy. Back then I still believed that there are people who just know stuff, it’s in their nature – and I wasn’t one of them.

Last week the situation was opposite. I have a few friends who recently started learning to code. They use codecademy and they are learning the basics. I got into a quick conversation about coding with one of them; we both had our laptops with us. The day before, I discovered the Meteor framework and started using it for a personal project. It was simple to begin with and I was very excited. I wanted to show him how soon will he be able to do some actual work. His face went sour pretty fast. “What was that you clicked?” he asked. “I don’t understand any of it.”

He’s a smart guy, but I was the problem. I got so cozy with what I know I didn’t even realise others don’t know it as well. “If I understand it now, everyone will understand it” I thought. That is a very wrong opinion. And it can be dangerous, too, if you are in some sort of a leadership/management position. People need their own time to absorb information one at a time. Ideally, they need to sleep on it, let it settle.

Next time you reach information overdose, take it easy on yourself. It really will settle. If it doesn’t, go through the information one more time. And then one more time if needed, until you feel comfortable with it. Do not compare yourself to people who know more – you will be there eventually. It is important to compare yourself today with who you were yesterday. That is all.

Read more

theclick

Today I would like to write about the ‘click’. Not a mouse click or a remote control click, but the click that inevitably happens inside a programmers head when he/she starts viewing problems in a new, different way, due to practice and perseverance. A better way, or, as many like to say, ‘the programming way’. Here is a short story about my first ‘click’.

1001st prime number

During my second year as a computer science student I attended a very interesting class called Programming methods and abstractions. Today I teach practical exercises for that course, but that is a different story altogether.

During one of the first lectures, which were essentially the introduction to real programming (I dare say ‘real’, although we had Introduction to programming during our first year which was very trivial), the teacher asked us to think about an algorithm that would calculate the 1001st prime number. ‘That’s it for me’, I said to myself, ‘time to go home and admit this isn’t for me. This is for smarter people.’ But, when I overcame indulging in self-pity and defeatist attitude, I sat down and started thinking, opening a new C project on my laptop.

‘What are prime numbers, anyway?’, I googled because math was never my strong suite. Okay… Now, how do we calculate it? That part I didn’t want to google. I wanted to see for myself will I be able to break it. I had ups and downs, I wrote unneeded code, bad code, erased it, tried again… It took me three days of playing around and thinking about it to solve it. I was so very proud when I came up with this little piece of code (today I would probably write it differently, but this is the original):

#include <stdio.h>
#include <math.h>

int main() {

    int i, j, ok, c = 5;

    for (i=12; ;++i) {
        ok = 1;
        for (j = 2; j <= sqrt(i); ++j) {
            if (i % j == 0) {
                ok = 0;
                break;
            }
        }
        if (ok) {
            ++c;
            if (c == 1001) break;
        }
    }
    printf("The 1001th prime number is: %d\n", i);
    return 0;
}

I couldn’t wait for the next class to tell the teacher I’ve done it.  ‘Respect’ was his comment when I told him I did it and that’s pretty much the best praise one could get from that guy. ‘Maybe I do have a chance in this field’, a glimmer of hope appeared shyly.

The most important thing I learned was not how to calculate the 1001st prime number, but rather how to approach problems. It was the ‘click’ for me and it is hard to say more than that or explain it properly. It is an alchemical process, to be poetic. You change without realising.

After that, I took another task and tried to solve it. It didn’t take me three days anymore: it took two. The next one took one day etc. until they took a few minutes to solve. That was probably the first time in my life I believed in the power of practice. You should, too.

Read more