cyborgzombieninjapirate


The first rule of Abstraction.

Posted on 31.01.2010 07:49 pm

Someone asked for a blog post on a more basic programming concept.

Abstraction is the bolt that holds the sanity of programmers together, and lack of it is the loose brick that will in the end make your whole project come tumbling down onto your head.

What is abstraction?

It's the transistors within a NAND gate.
It's the NAND gates within a flip-flop.
It's the flip-flops within an SRAM.

The makers of the SRAM chip were not deeply involved with the creation of the flip-flops, the makers of the flip-flops were not deeply involved with the creation of the NAND gates and so on.

They had the tools and made of it something great. Did they care how it worked exactly? No, they only cared about the output.

That is why Abstraction is so great, specially within the programming world. We create a complex machine to be used later by someone that does not care about it's inner workings.

While programming, we do not care about the amazing process that is taking place within our computers. We should be stunned at the fact that a movement of a mouse on the desk corresponds to a movement of an imaginary item on a screen. But we rarely do.

When creating a piece of software, abstraction allows you to build a single serving function. A collection of single serving functions allows for simple debugging, fast programming and unlimited reuse.

We move the problem into an isolated room and deal with it there. After it is dealt with, we do not talk about it again.

It's not like the code behind the movement of a mouse on a screen comes to mind every time we program. It's abstracted away from us, so we can evolve.

4 9    Like it or hate it?  -  Comment (3)


I hope you fail!

Posted on 14.01.2010 12:29 am

I hope you have a personal project that you design wrong. I hope you get a runtime error that takes a long time to fix. I hope you get a nasty segfault that almost makes you lose all will.

I wish you numerous syntax errors and annoying memory leaks. I hope for tricky race conditions and terrible compatibility problems. I hope you need to rewrite a large portion of your code.

Why?

These are the building blocks of good programmers. We get the nasty errors and we learn from them. These errors get imprinted into our brain and we promise ourselves that we will never do them again, never to live through that horror.

After those errors, we can spot them a mile away, sometimes even before any code is written, and the more often we encounter these textual demons, the better programmers we become.

You can't learn programming by staying on the safe side of the fence, you need to jump over it, whip out your sword and start swinging. You don't know what to expect and you will get beaten down once in a while. But what separates a good programmer from a mediocre one, is that the good one stands up again, dusts off and remembers to duck next time.

So I wish you all the worst, and hopefully, you will live to tell the tale.

8 43    Like it or hate it?  -  Comment (8)


Memory allocated for your request: 179.02 Kb
Process time: 0.009807 seconds