| |||||||||||
| |||||||||||
Learning and understanding scripting programming techniques
Can you have a book about programming that's not about a specific programming language? A course that covers useful techniques across the board? That applies right across languages, with tips and techniques and things to bear in mind? Now there's a challenge, and I think the answer would be "yes." And the book/course could cover so many valuable topics ...
There are techniques that every programmer needs to know, over and above and beyond the basics of any one language. And they're rarely taught on any programming course, but would make such a huge difference, I know, to so many of our delegates. I'll give you some subject headlines - not sorted into any particular order. Constants and config files and options Programming with fixed values, and values that are changed at installation Equality, looks like, min and max Does 7 equal 7.0? Does SN12 7NY look like a postcode? Comparing - old, older, oldest Getting a value, comparing data, comparing collections of data Cardinal Values Numbers that are used as markers, and some cautions about their use Letting it finish Terminating processes and file handling neatly, avoiding garbage Intermediate reports How can I ask "how is my program doing" while it's running? User inputs Taking care of nasty values. Validation. Efficiency Technique "a" may take 3 days - and technique "b" 3 minutes. Usability Providing a consistent and understandable user interface Merging data Taking multiple data sets and combining them Reusability and support Writing code that can be reused, and easily supported Test and Debug Techniques for checking your code before it gets to the users Singular v plural "is" and "are". "child" or "children". It makes sense to report in good English reporting zero answers Should you just leave a blank, or say "no match?" Interactive inputs? You need to prompt the user if you're interactive, yet prompting when reading data from a file will make for a messy output display Error Handling How to provide good, consistent, useful error messages Injection attack. What about malicious users running your script. Strings - upper and lower, rude words Users who SHOUT, or who don't know how to capitalise! Dynamic v static When are variables created and lost? How are they shared between blocks of code? Declare v initialise v Assume What are the advantages / disadvantages of declaring variables, initialising them, v assuming an initial value Overriding code Conditionally loading code, and replacing code already loaded Scope and Name spaces variables which are local to a piece of code, which are shared between a number of pieces of code, and are shared throughout an application OO approaches Is it a good idea to use objects for xxxx job? Hashes / Dictionaries Data that is keyed by a unique value. But what if that value is not unique? Sorting How sorting works and used defined sorting. Sorting (or not!) hashes Caching Avoiding repetition by caching, and how to ensure that your caches are up to date. Graphics and graphing techniques World and screen co-ordinates, choosing your axes, watermarking pictures and more. Specifying an API that can be extended Providing an interface to your functions that works well and is easily supported now,and can be extended compatibly when new requirements are added Web and Database Accessing your scripts via a web front end, and saving the data in a database Threaded Programming Running process in parallel Queues and Recursion Making notes of places you need to come back to, and saving where you are when you need to go off to more code. Security issues Capture, Passwords. Can it all be done without reference to language then? No - I don't think it can; examples will be needed and there are nuances in each of the languages. And with my knowledge / use of Perl, PHP, Python, Tcl/Tk/Expect, C/C++, Ruby, Bash/Ksh, and Java, I'm well placed to show how the techniques can be implemented in each of them. If you're interested in having a day or two of "techniques" training - please let me know. And, yes, I would illustrate and have you practice in whichever of the language(s) from my list that's appropriate to you! Email - graham@wellho.net - and refer to this item! (written 2008-04-08 07:39:02)
Some other Articles
Chew Valley LakesUnderlining in Perl and Python - the x and * operator in use Learning to program in Perl Sheep Shearers, Marathon Runners and Ocean Sailors Learning and understanding scripting programming techniques M25 / South Mimms Service Area Do not SHOUT and do not whisper Automating processes through Expect Replacing the last comma with an and Cambidge - Tcl, Expect and Perl courses 1696 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 at 50 posts per pageThis 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). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||