// you’re reading...

Programming

Programming is like LEGO

I’ve noticed some students asking a rather silly question:

what commands will i need?

bag of lego blocks

What makes this question silly is that it is asked in “what is the minimum set of a programming language keywords required to complete a task?” type of sense. It usually has to do with some game project, and the student is looking for some “fix it all” type of answers. There isn’t one.

The thing is, computer programming is like LEGO. Having a list of a bunch of different commands is like having a bag of blocks — useless on its own, but with a potential to build something. Advanced commands are like specialty pieces, they can be used to achieve a higher level of detail, but often must be used in a creative way. Though the important point here, is that similar models can often be put together, just out of the basic pieces.

detailed lego banshee model lower detail lego bunshee model

Basic variables, input/output, if statement, and a loop should be enough to do just about everything. Obviously this doesn’t guarantee efficiency, or speed of development, or maintainability. Some students don’t question this though, and blissfully type up 5000 lines of repeated code.

Alright, so a special block would have been useful, but the question is still backwards. A bag of new commands is always followed up with a “what do I do with any of this?” question, leaving the student more confused than before. One can’t just shake a bag of blocks and expect an assembled model to fall out. During the assembly, one needs to know what kind of a block needs to be attached next, and then find that block. Similarly one needs to figure out what task needs to be performed, before searching for a command that performs that task.

So the question is not “what commands will i need?”. It should be “what command performs this particular action?”. One is better off knowing what they are building, rather than shaking a bag of parts without a plan.

Read more

Uhh... nothing else appears to be relevant enough.


Discussion

  1. Posted by athul | December 27, 2007, 2:29 am

    Great!You are absolutely right.Planning plays a vital role in any art,whether it is construction of a building with blocks of raw meterials or construction of a code with blocks of commands

    Reply to comment

  2. Posted by helen | January 16, 2008, 2:58 pm

    Hey guys
    It’s all right for you programmers, all seams so easy to follow and understand.Why can’t I ?
    I’ve been to BHAM uni and study java programming and I failed. Well, part of that I didn’t get any help and then I lost interest in programming. With so many snobish and impertinents students I couldn’t get help at all. At one point one of the lecturer and personal tutor said to me that I am too stupid.

    The questions are:
    To learn programming, do you have to be clever? Is it because my 5th language stayed in way of understanding the dam programming?
    Is it because I never been exposed to computer programming?

    Thanks

    Reply to comment

  3. Posted by Tony | January 17, 2008, 12:50 am

    You don’t have to be clever to write code, it’s all quite programmatic. Though some problems are “easier” to solve with clever solutions.

    There is definitely a learning curve at the start. It could be more difficult, but not impossible to catch up from little experience. Though the entire field requires a lot of personal practice and commitment, so having interest in computer science is crucial.

    Reply to comment

Post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>