Atma Xplorer

Xploring Games, Computing, Photography

Guide to Programming Series: Week 3

The Technical Details of Coding

Programs evolve over time. This is because coding (typing the actual code) can prove so tedious, time-consuming, and error-prone, that experienced programmers don’t even try writing their programs until they’re absolutely sure that they know what they’re doing.

Prototyping
Just as architects build small-scale replicas of their projects, programmers create prototypes (tentative designs) of their programs first. Most of the time, program prototypes use a simple user interface that is a dumbed down look of the actual program itself. Buttons, dropdown menus and dialog boxes don’t really do anything at this point but mainly serve as to give the programmer a visual perspective of which goes where. After the programmer is happy with the way the prototype looks, he can proceed, using the prototype as a guideline toward completing the final program.

Choosing a programming language
You can write any program by using any programming language but the idea here is that some languages make writing certain types of programs easier.

Don’t be slave to convention (unless the client says so). Just because everyone is doing Java doesn’t mean you have to work with it all the time. Don’t stick to a single language and use what suits you and your program.

Defining how the program should work
Programmers make use of simple instructions that describe exactly how a program works. This is known as pseudocode.

If you need a program the drives a car to it’s destination (considering proper hardware is equipped) the pseudocode may look as follows:

  1. Get the destination coordinates.
  2. Get the car’s current coordinates.
  3. Calculate the shortest path.
  4. Move to destination.

As we’ve stated numerous times, generic instructions simply won’t do so the instructions needs further refining before you can get started. You can’t just tell a computer, “Get the destination’s coordinates” because the computer wants to know, how to get them as well.

So rewriting the preceding pseudocode may look as follows:

  1. Get the destination coordinates.
    • Contact the GPS satellite system.
    • Make sure coordinates are valid.
    • Store coordinates in memory.
  2. Get the car’s current coordinates.
  3. Calculate the shortest path.
  4. Move to destination.

Looking better right?

Programmers need to define general tasks down to the most basic detail so that a program can accomplish it’s task. This is a sort of top-down design where things start at the top, working their way down. This way, the pseudocode describes every possible step that the computer must go through.

Pseudocode is a tool that you can use to outline the structure of your program so that you can see all the possible data that the computer needs to accomplish a given task. The idea is to use whatever language you understand best to describe the computer’s step-by-step actions so that you can use the pseudocode as a map for writing the actual program in whatever language that you choose.

Pages: 1 2 3

Tags:

Comments ( 2 )

Have Something To Say ?

  1. mcbillywilford McBilly December 16, 2007 Reply

    Oh wow Sylv. A whole new design. I’m still losing my way around your site. Haha. Hmmm. Honestly, I love the old design better. The new design kind of needs more effort to get around the navigation. But that’s just my 2 pesos. Hehe. 😀

    With regards to writing a program. I have to agree on what you said, it’s very much important to plan before writing out the codes. It could also mean a cleaner code and a lot of saved sleepless nights trying to read a cluttered coded program.

  2. atmaxplorer sylv3rblade December 16, 2007 Reply

    I saw too many spam sites carrying the same theme. After seeing Karlo‘s new theme, I thought it’d be best to switch now too. This new theme is still in Beta. I’m still adding a few bits to make it work but overtime I think switching to a more monotone theme is the right move.

    On coding yes. I’ve had bad experiences on “rush” projects that nearly ended up in the recycle bin because I didn’t plan for them perfectly. No more impulse programming for me.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

website stats