VCE IT Theory Slideshows By Mark Kelly Vceit.com Naming Conventions for solution elements.

Slides:



Advertisements
Similar presentations
Names and Bindings.
Advertisements

VCE IT Theory Slideshows - ITA By Mark Kelly Vceit.com Entity Relationship Diagrams (ERD)
IT Applications Theory Slideshows By Mark Kelly Vceit.com Design Elements.
(1) ICS 313: Programming Language Theory Chapter 10: Implementing Subprograms.
VCE IT Theory Slideshows By Mark Kelly McKinnon Secondary College Vceit.com Power Websites CMS and CSS.
Advanced Package Concepts. 2 home back first prev next last What Will I Learn? Write packages that use the overloading feature Write packages that use.
IT Applications Theory Slideshows By Mark Kelly Vceit.com Legislation: © OPYRIGHT.
String Escape Sequences
IT Applications Theory Slideshows By Mark Kelly vceit.com Database Design Tools Version 2.
VCE IT Theory Slideshows
110-D1 Variables, Constants and Calculations(1) Chapter 3: we are familiar with VB IDE (building a form…) to make our applications more powerful, we need.
IT Applications Theory Slideshows By Mark Kelly Vceit.com WEBSITE DESIGN TOOLS.
IT Applications Theory Slideshows By Mark Kelly Vceit.com Types and contents of On-screen user documentation.
Programming Languages
VCE IT Theory Slideshows By Mark Kelly Vceit.com Websites & Data.
VCE IT Theory Slideshows
Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs.
Variables and Data Types
VCE IT Theory Slideshows By Mark Kelly Vceit.com Characteristics of efficient and effective solutions.
Using Visual Basic for Applications (VBA) – Project 8.
VCE IT Theory Slideshows By Mark Kelly vceit.com Data Types 1 a.
CPS120: Introduction to Computer Science Variables and Constants Lecture 8 - B.
CPS120: Introduction to Computer Science
VCE IT Theory Slideshows By Mark Kelly Vceit.com Testing Network Security.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
IT Applications Theory Slideshows By Mark Kelly Vceit.com Last modified : 6 Dec 2013 Databases II: Structure, naming, data types, data formats.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
VCE IT Theory Slideshows By Mark Kelly Vceit.com Problem Solving Methodology 3 Development.
Items in Visual Basic programs
IT Applications Theory Slideshows Databases II: Structure, Naming, data types, data formats.
VCE IT Theory Slideshows By Mark Kelly Vceit.com Arrays.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
VCE IT Theory Slideshows By Mark Kelly Vceit.com Problem Solving Methodology 1 Analysis.
VCE IT Theory Slideshows By Mark Kelly Vceit.com Websites & Data.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
C NOTATION Some very short story of C notation – 'convention' used in writing C codes © 1/4.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – August 23, 2001.
CPS120: Introduction to Computer Science Variables and Constants.
Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
VCE IT Theory Slideshows By Mark Kelly vceit.com Version 2 – updated for 2016 Data Types 1 a.
PHP Reusing Code and Writing Functions 1. Function = a self-contained module of code that: Declares a calling interface – prototype! Performs some task.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin © Scott Adams.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
CIS 338: VB Variables Dr. Ralph D. Westfall April, 2011.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
VCE IT Theory Slideshows
Computer Language
VCE IT Theory Slideshows
VCE IT Theory Slideshows
VCE IT Theory Slideshows – ITI Updated for 2016
VCE IT Theory Slideshows
IT Applications Theory Slideshows
Microsoft Access Illustrated
VCE IT Theory Slideshows by Mark Kelly study design
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 2 Applications and Data.
VCE IT Theory Slideshows by Mark Kelly study design
Microsoft Visual Basic 2005 BASICS
VCE IT Theory Slideshows by Mark Kelly study design Test Data
VCE IT Theory Slideshows
VCE IT Theory Slideshows Updated for 2016
VCE IT Theory Slideshows
Chapter 8 Advanced SQL.
VCE IT Theory Slideshows
VCE IT Theory Slideshows
VCE IT Theory Slideshows
The C Language: Intro.
Pseudocode For Program Design.
Data Dictionaries Begin.
Presentation transcript:

VCE IT Theory Slideshows By Mark Kelly Vceit.com Naming Conventions for solution elements

What’s in a name? Names of elements (variables, subprograms, functions, tables, fields, queries, reports etc) must be Easily understood Not confused with other elements Not too long – wastes time, invites typos Not meaninglessly short (e.g. N) Self-descriptive

Consistency E.g. if ALLCAPS are used for names of constants or module names, use them in the same way for the entire program. All programmers on a team must know and use the same conventions.

For example, compare these a = b * c; weekly_pay = hours_worked * pay_rate;

What’s in a name? Avoid special punctuation (which may choke some databases or compilers) Avoid spaces, which often indicate the end of a name. Remember, your source code may be used in more than one database or compiler with different behaviour!

Hungarian Notation Invented by Charles Simonyi He worked at Xerox PARC (which developed the mouse, GUI and Ethernet etc) Later became Chief Architect at Microsoft. Flew on a space shuttle. Now worth $1 billion From Hungary, where - like in Japan - people's surnames precede their given name. He would have been called Simonyi Charles at home.

Hungarian Notation From the SD exam 2007 Hungarian notation is a naming convention for program elements such as variables and objects. The convention is that the first two or three letters of the element's name indicate the type of element. The rest of the name indicates its purpose, and starts with a capital letter; for example a text box containing a first name could be called txtFname. State three benefits of this method of naming. 3 marks.

What it offers Information about the element being named, e.g. its data type in a program – txtSurname (text variable) – global_txt_Head_Count (global text variable) e.g. its object type in a database – rpt_Invoice (report) – qry_FindPensioners (query)

Answer The variable type can be seen from its name It reminds the programmer of the type of each variable or object so it is not treated improperly. (e.g. trying to address the.text property of a label in Visual Basic) They are independent of a language's inbuilt sigils. e.g. in BASIC, name$ names a string but in Perl, $name refers to a scalar value. Using a standard prefix like str, is less confusing if working with different languages.

Answer It leads to more consistent variable names Deciding on a variable name can be a mechanical and quick, process Inappropriate type casting and operations using incompatible types can be detected easily while reading code In a weakly-typed language such as Basic, it's easy to create logical errors by mismatching variable types.

SD 2008 exam Question 3 List the main features of a naming convention for variables and procedures that you have used in your programming this year. State two advantages of this convention. 3 marks

Answer Advantage 1 The prefix clearly identifies the type of the object so mismatched objects cannot be accidentally combined. e.g. if bNumber is a a byte variable (which can hold up to 255) and pPoint is a 32 bit pointer, the programmer would quickly realise that bNumber = pPoint + 1 would lead to an error because any 'p' variable could never fit into a 'b' variable.

Answer Advantage 2 It promotes consistency throughout a program, and throughout a team. It reduces the chances that an individual or team mate will mistreat variables because they did not realise their type.

Answer It's also more efficient for program maintenance, since returning to work on a program after a long absence will be easier because the programmer will not need to relearn that particular program's naming scheme.

Camelcase… also known as Medial capitals Pascal case BumpyCaps BumpyCase camelBack CamelCaps CamelHump

Camelcase… also known as CapitalizedWords CapWords ClCl (Capital-lower Capital-lower) compoundNames Embedded Caps HumpBack InterCaps or intercapping

Camelcase… also known as InternalCapitalization LeadingCaps mixedCase nerdCaps WikiWord or WikiCase

…is The practice of writing multiple words as one string without spaces using Capital Letters to mark the beginnings of individual words.

For example TaxRate EndOfFile ReadNextRecord() PhoneNumber DateOfBirth txtSurname

Underscore Alternative More readable? Tax_Rate End_Of_File Read_Next_Record() Phone_Number Date_Of_Birth txt_Surname

Style Guides Naming conventions vary from programmer to programmer, and from organisation to organisation Often naming schemes are passionately held and defended! Organisations often dictate local naming conventions which must be obeyed.

By Mark Kelly vceit.com These slideshows may be freely used, modified or distributed by teachers and students anywhere on the planet (but not elsewhere). They may NOT be sold. They must NOT be redistributed if you modify them. VCE IT THEORY SLIDESHOWS