VBScript

VBScript Beginner Tips

Here are our top 10 tips for successful VBScript coding!

  1. Get a good text editor that you are happy with. Notepad is a good, free, editor but there are better ones. UltraEdit32 (www.ultraedit.com) is probably the best. Avoid using word processors, even simple ones like Wordpad, as any formatting code in the final output will result in errors.

  2. Plan your code project before you start coding - pen and paper is low-tech, but often the best way!

  3. Comment your code well. Something that seems obvious early on might not seem so obvious later! Remember, you can always remove the comments before the code goes "live".

  4. Save different "versions" of your code as you work through it. That way, if things go wrong, you can always go back to the last working version.

  5. Use meaningful names for variables, procedures and functions. If you feel up to it, use Hungarian Notation.

  6. Write separate bits of code to deal with different aspects of your project - don't try to write one huge function or procedure to handle everything.

  7. Build a code library of useful scripts and functions - no point reinventing the wheel! Remember to document them well and give the files meaningful names.

  8. Make small incremental modifications to your code and test your code at every stage of development. The more you test the earlier you'll spot flaws and errors. Leaving all the testing until the end will mean more hassle and more time spent tracing faults and flaws.

  9. Prototype big coding projects and break down big projects into smaller code sections. This way it's easier to spot coding bugs early on.

  10. Once you've finished, test your whole project thoroughly and if possible get others (family, friends, co-workers, etc) to test it. If the code relies on input (keyboard and mouse), check what happens when you do something unexpected (such as inputting numbers instead of text and so on). Other people are best to test code because, unlike you, they don't know how the code should work!!!!

And lastly

  • Have fun coding!!!!!


Adrian Kingsley-Hughes
Last updated: May 4th 2004
Print This Page   |   Email me when this page changes    |  Search This Site



Crucial.com System Scanner does the work for you!



/a_global/close_links.inc"); ?>

Contact Us