Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python, Lua, Tcl, C and C++ training - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, Ruby, MySQL and Linux / Tomcat systems
 
Learning 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 thoughts with regards to the best way to make use of the language in the application. I was happy - no, let's say "delighted" to step into one of the siderooms at the end of the class and find the team leaders discussing programming standards and techniques, to the extent that they're planning a further course on the subject. Good for them - I'm sure that such a course will repay its cost many times over! They asked me if I was interested in presenting - yes, interested, but I don't have the materials, the knowledge in some of the areas, and they would do far better with a more local tutor who could come back in for a morning every couple of months to review progress with individuals.

Good CodeI have, as is my normal practise, been writing code examples 'on the fly' during the course ... and on one of those I wrote today, I asked for a critical review from my delegates. In the culture, where everyone is so polite, I had to trigger the discussion - "I can see at least three things that I haven't done, which I should have done to make this into a high quality piece of code". And then they started to pick up my faults - (most of which were deliberate!)

• My code was uncommented throughout its body, meaning that it would be very hard to follow later, even by the original author.

• Variables within functions (at least I HAD structured my code into functions!) were not all declared as local - like Perl, Lua's variable are default global. And that means the a reuse of the function later could lead to some odd and hard-to-find bugs due to name conflicts

• The indentation of my code was erratic, again making it hard to read

• My functions, which would have been useful in other applications of the same data, were in the same file as my main program, meaning that without re-engineering my code could not be shared.

• Variable naming wasn't standard or consistent ... and we had already seen during the course how inconsistent variable naming slows down maintenance coding as the maintainer has to keep looking back to find out what variables were called, and what spellings and capitalisation were used.

• The output from my program was just a set of results - it didn't label the results in any way. So that means that a copy of the output given as a report to a manager would have needed extra work to document it to make it of any practical use

• There was no header block stating what the field was, which version, who maintained it, what it required. Once again, that makes it very hard to maintain.

• No user documentation ...


Our next Lua Programming course starts on 10th August 2009 in Melksham, UK. If you have missed that date, the course description page will give further dates - usually scheduled 9 to 18 months ahead. And if you're looking for a course for a group of delegates, we can arrange a private course at our centre or a on site course at your offices for you. And as you'll see from the blogs I am writing this week, that can be in the UK, or further afield ... look back and you'll read of courses in the USA, Saudi Arabia, Germany, Ireland, the Netherlands, Slovenia, Finland ... and this week Mexico.

I believe in teaching NOT ONLY the mechanisms of a programming language, BUT ALSO how that language should be well written - both in terms of the specifics for the language and in general computing terms!. If asked to teach "just the mechanisms of the language" on a private course, I would probably refuse, insisting on adding at least a few words to encourage good practise.
(written 2009-07-30)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Q101 - Object Orientation and General technical topics - Programming Principles
  [4645] What are callbacks? Why use them? An example in Python - (2016-02-11)
  [4632] Remember to ask the question before you listen for the answer - (2016-01-26)
  [4611] Hungarian, Camel, Snake and Kebab - variable naming conventions - (2016-01-03)
  [4325] Learning to program - what are algorithms and design patterns? - (2014-11-22)
  [4206] Writing the perfect program in Tcl? - (2013-11-13)
  [4153] Rooms available tonight - how to code an algorithm from first principles - (2013-08-19)
  [4118] We not only teach PHP and Python - we teach good PHP and Python Practice! - (2013-06-18)
  [4090] Test Driven Development in Python - Customer Comes First - (2013-05-16)
  [4061] Seamless, integrated IT - we have a long way to go! - (2013-04-11)
  [4003] Web and console - same principle, same code - Ruby example - (2013-02-14)
  [3954] Lesson 1 in programing - write clean, reuseable and maintainable tidy code - (2012-12-16)
  [3928] Storing your intermediate data - what format should you you choose? - (2012-11-20)
  [3878] From Structured to Object Oriented Programming. - (2012-10-02)
  [3673] Object oriented or structured - a comparison in Python. Also writing clean regular expressions - (2012-03-26)
  [3551] Some terms used in programming (Biased towards Python) - (2011-12-12)
  [3548] Dark mornings, dog update, and Python and Lua courses before Christmas - (2011-12-10)
  [3542] What order are operations performed in, in a Perl expression? - (2011-12-07)
  [3456] Stepping stones - early coding, and writing re-usable code quickly - (2011-09-24)
  [3026] Coding efficiency - do not repeat yourself! - (2010-11-02)
  [2964] An introduction to file handling in programs - buffering, standard in and out, and file handles - (2010-09-21)
  [2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
  [2878] Program for reliability and efficiency - do not duplicate, but rather share and re-use - (2010-07-19)
  [2769] Easy - but for whom? - (2010-05-18)
  [2737] Improving your function calls (APIs) - General and PHP - (2010-04-24)
  [2586] And and Or illustrated by locks - (2010-01-17)
  [2550] Do not copy and paste code - there are much better ways - (2009-12-26)
  [2510] The music of the stock market - (2009-11-22)
  [2415] Variable names like i and j - why? - (2009-09-22)
  [2327] Planning! - (2009-08-08)
  [2228] Where do I start when writing a program? - (2009-06-11)
  [2022] Pre and post increment - the ++ operator - (2009-02-03)
  [2001] I have not programmed before, and need to learn - (2009-01-19)

U101 - Introduction to Lua.
  [4324] Learning to program - variables and constants - (2014-11-22)
  [4271] Line, block and nested comments - Lua compared to other languages - (2014-05-04)
  [3724] Learning to Program in Lua - public / open training course / class - (2012-05-09)
  [1842] Lua Course, and the Wiltshire Countryside too - (2008-10-16)
  [1737] Rules, suggestions, considerations for Lua variable names - (2008-08-05)
  [1699] If you are learning Lua, here are some more examples - (2008-07-06)
  [1695] Lua Course - here is the index - (2008-07-03)
  [1111] Training in Lua - (2007-03-16)


Back to
Lua training class in Spanish
Previous and next
or
Horse's mouth home
Forward to
Floor to ceiling
Some other Articles
Passing parameters to a coroutine in Lua
Seeing Guadalajara - a first glimpse downtown
What are closures in Lua?
Floor to ceiling
Learning to write high quality code in Lua
Lua training class in Spanish
A new place in pictures
Breakfast in Mexico
Melksham to Mexico for the week
Hot Tap at West Wilts Show
4755 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2017: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/2310_Lea ... n-Lua.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat