Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Object Orientation and General technical topics module Q101
Programming Principles
Exercises, examples and other material relating to training module Q101. This topic is presented on public courses Learning to program in PHP, Learning to program in Python, Learning to Program in Java, Learning to program in Lua, Learning to program in Ruby, Learning to program in Tcl, Learning to Program in C, Learning to program in C++

Background
There are certain key concepts in programming in more or less any modern language - and our resources that relate to these key concepts are gathered here in this module.
Related technical and longer articles
copying an object - copy the reference

Articles and tips on this subjectupdated
3548Dark mornings, dog update, and Python and Lua courses before Christmas
It's significantly darker each morning as we take Gypsy and Billy out for a morning walk. We're out well before sunrise now, which was at 07:29 on his first morning with us, it is at 08:04 today - just a fortnight later - and will be at 08:16 by 31st December. Only from 1st January does it start getting ...
2011-12-17
 
3551Some terms used in programming (Biased towards Python)
Some of the elements of your program Command - typically a keyword followed by series of parameters - a "unit" of shell / batch / Tcl programming (You don't really have commands in Python) Statement - an atomic operational unit of a program - a "unit" of Python / Perl / PHP / Lua / C etc ...
2011-12-17
 
3542What order are operations performed in, in a Perl expression?
Mathemetical operators in Perl aren't simply performed left to right - very early on your Learning to Program in Perl course you'll learn that multiplications and divisions happen before additions and subtractions, and you'll learn that brackets (also know as terms or lists) happen even earlier. Commonly ...
2011-12-12
 
3456Stepping stones - early coding, and writing re-usable code quickly
First coding ... and people start at the top and work through to the bottom. Example: [here]. Then they find bits of code repeating, and they separate the repeating stuff out into functions. Example : [here]. In order to re-use the repeated stuff in other programs, they then save it to another file ...
2011-09-24
 
3026Coding efficiency - do not repeat yourself!
"If you find yourself repeating something ... there's probably a better way" "If you find yourself thinking "surely someone's done this before" ... they probably have, and their code is probably available to you" The things I find myself saying very frequently in courses ... for delegates who are new ...
2010-11-02
 
2964An introduction to file handling in programs - buffering, standard in and out, and file handles
Stdout and Stderr Programmers typically don't write code to output to the screen / current window, as to to so would be to provide an inflexible system - instead, they output to what's known as "standard out", also known as stdout. Usually stdout defaults to the screen / current window so there's no ...
2010-09-21
(longer)
2915Looking up a value by key - associative arrays / Hashes / Dictionaries
In any substantial programming task, you'll want to store a whole series of values in some sort of table, so that you can process / reprocess / handle each of the elements in turn - and to do that, you'll use a variable construct that's called an "array", or a "list", a "tuple" or a "vector". (The exact ...
2010-08-20
 
2878Program for reliability and efficiency - do not duplicate, but rather share and re-use
When you're writing a new piece of code - especially if you're also quite new to programming - you'll be concentrating so much on getting it to work that you may not be giving too much thought to making it easy look after your code later on (maintainance), nor to sharing a piece of code between programs. ...
2010-07-30
 
2769Easy - but for whom?
1. I wrote a graphing package once - for use on the Tektronix 4051 (so you'll see how old that was!) - and the sales team for whom I wrote it loved it in demonstrations. It asked a series of questions and then drew a graph - just what was needed to introduce customers to the piece of hardware and show ...
2010-05-18
 
2737Improving your function calls (APIs) - General and PHP
Some of the code at the Civil Service Department (CSD) where I worked on manpower planning models some 35 years ago would not have stood up to analysis against modern programming practice (but then ... that WAS 35 years ago). Indeed, some of the code "behind the curtains" didn't even stack up properly ...
2010-05-14
(longer)
2586And and Or illustrated by locks
Lisa and I came across this impressive array of locks on what we have since learned is probably the back gate to the National Grid's Lacock Switching Station, about 3 miles North of Melksham. [picture/details] Our first reaction was "wow - that must be REALLY secure - what are they doing in there?" ...
2010-01-20
 
2550Do not copy and paste code - there are much better ways
If you find yourself using copy and paste to duplicate a piece of code, take a step back and think again. You're doubling your maintenance work, with two separate sets of code to look after and keep in step from that day forwards. Are you going to give me the "but I have to change one copy a bit" excuse? ...
2010-01-06
 
2510The music of the stock market
Over this weekend, I have come to realise just how similar the music is to high finance (and that I should take a day off occasionally!). I love the range of applications that I look at ... and on Saturday, I was looking at sequences of stock values at regular intervals, whether they were going up ...
2009-11-22
 
2415Variable names like i and j - why?
Q: Why do people use variable names like "i" and "j" for loop counters? I thought that you were supposed to use longer, desciptive names! A1: Fortran (FORmula TRANslator) was one of the prevalent programming languages in the 1960s and 1970s, at a time when many programming techniques, algorithms and ...
2009-09-22
 
2327Planning!
When I travelled from home to Saudi Arabia in May, 2006, I planned ahead. Flights were booked, course manuals printed, Visa obtained, contacts established, deposit paid (to us for courses), travel insurance in place before I even left home. "Of Course" or "Prudent", I expect you'll say. And I agree ...
2009-08-08
 
2310Learning to write high quality code in Lua
What a wonderful opportunity this week - to train delegates in Lua programming (and Lua, byte for byte, is perhaps the best value language that I train in) but also to be in on the early stages of a project where it's not just a question of training on the language itself, but also in helping provoke ...
2009-07-30
 
2228Where do I start when writing a program?
Q: Where do I start when writing a program? A: Start off by thinking about what you want to achieve, and what inputs you have available to you. In other words, look at what the customer provided and what the customer wants to get (yes, you may be your own customer!). If it's too much to think through ...
2009-06-12
 
2022Pre and post increment - the ++ operator
The ++ (increment) operator in PHP (and Perl, and C, and Ruby) adds one to the value held in a variable and saves the result back in the same variable. But you'll see both $n++; and ++$n; in code. What is the difference? If you write the ++ in front of the variable name, the variable is incremented ...
2009-02-03
 
2001I have not programmed before, and need to learn
Yesterday was the second day of my Learning to Program introductory course - for delegates who are learning to program - as well as learning a particular language, and (since the target language is C), I wrote a number of new C examples. And these examples were written in front of the delegates to show ...
2009-01-21
 
Examples from our training material
afresh   Modular programming!
algo   Use of a sub to avoid repeating code
algo_cgi.pl   CGI equivalent of Station Name / anagram program
askuser.py   Sample module for sharing ...
cbv.c   Call by value and call be name
cbv2.c   Call by value and name - extended example
cd1.c   Comments and sequence of statements
comp_control   Control case / Python
compat   Sharing code between modules / Python
compat_stage1   reusing code in a module / Python
day2_1   Functional (structured) coding
design.001   Designing an application - start here
perspire   First Loop
rubfunc1   Ruby example - define and call a named block of code
sweat   First Conditional
utilz.py   Simple sample module
whatos   Implementation of a design
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
Stored programs - running from file.
Sequential operation.
Very fast, but an IQ of zero.
Variable and variable types.
Conditions and conditional code.
Loops and named blocks of code.
Collections.
Libraries.
Pointers and references.
Compilers and Interpretters.
Program and system design.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2012: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/Q101.html • PAGE BUILT: Sat Jan 28 06:41:11 2012 • BUILD SYSTEM: wizard