Header Ads

Coding Tips For Beginners

Coding is becoming increasingly popular, as both a recreational pursuit and technical skill. Being able to build your own, simple programs will often help with day to day tasks, as you are able to tailor the output of each to your specific needs rather than relying on over-complicated (and often redundant) third party software. For web development as well, coding is indispensable; you may be able to save substantial amounts by writing the website for a home business yourself. Here a few tips to help you get started.

Pick your language

There are many different types of coding language in existence, all of which must be "parsed" before they serve any use. This essentially means that the program handling the source code will read it back, and then interpret it to produce visual or textual output based on the instructions provided. As a result, there are a multitude of languages in existence, each designed for a specific role.

For now, you want to start simply. Pick a language to learn that lets you render webpages or create simple applications easily to learn the ropes; I would recommend HTML, Visual Basic or Python. All are widely used, and interpreters should be freely available.

Basic commands and syntax

You will definitely want a tutorial guide to hand on your first attempt, and it is useful to keep documentation nearby as you progress. Many websites will provide help for free; you can often find great information in programming Wikis or through hobby sites. The developers of the language themselves are the often the best people to consult, as they know the structure of the language inside and out and often produce manuals for download.

The first step is to learn how the language responds to various pre-defined commands, and what structure it requires to produce a functional program. From there, you can start creating a set of instructions to solve your task at hand.

For a simple singular task, this is usually very straightforward; the routine is designed for one purpose only, and thus requires a linear set of instructions (i.e. a maths problem such as X+1=Y, where X is defined as your input and Y is printed output.) A good example of a language orientated towards linear processing would be HTML; you provide it with a list of program relevant commands, links to graphical resources and textual information which a browser can then render for the user.

In both simple and complex languages, there is a set syntax structure. The way you position and define variables (fixed and re-definable integers and strings) determines the way in which the program runs.

What are strings and integers?

Strings are literally strings of alphanumeric information, or simply prose. Defining one allows it to be interjected, recalled or altered in most languages. Integers are fixed "real" numbers, i.e. 1, 2, 3, 5, 8 and so on, and function in the same way (albeit with a mathematical focus.) As most non-application focused basic programming is about simplifying mathematical, algorithmic or database tasks (for example, building an automatic linear equation solver) you will have to learn to incorporate both to suit the task at hand. You will get better at this with practice.

A floating point integer is also used to specifically define an "irrational" number (i.e. 3.14159.)

An example of using commands, strings and integers in a fictional programming language

precommand: run fictional language shell
set intval = int(0)
str("Pi")is print flpnt(3.14159)
if intval = int(1):
precommand: delayed end shell
if input (""):
print str("Hello World!")
and print str("Pi")
and intval=(0+1)

Why isn't my program working?

Nine times out of ten, applications fail because of a syntax error in the source code. This means that your code is improperly written, defined or positioned. Many parsers include automatic checkers; the program will usually point out where you've gone wrong. If you use subroutines (chunks of defined code re-callable on command) you will need to establish an infinite loop. Link back to your main body of code at the end of each one, or you will run the risk of encountering everything suddenly grinding to a halt.

Keep going!

The only limit to how complex you want to make your projects is the time you are willing to put in to learning the language. Although it may seem daunting, it's more than worthwhile to continue onwards past your rudimentary attempts; coding becomes far more rewarding with experience.