Guidelines Quick Reference

Similar documents
IT Web and Software Developer Software Development Standards

PHP-FIG Home Blog PSRs Personnel Bylaws FAQs Get Involved PSR-2: Coding Style Guide

CSE 142/143 Unofficial Style Guide

Introduction to Python

CSE 11 Style Guidelines

C # Coding Standards for.net By Lance Hunt. Document Version 1.13a August Copyright Lance Hunt 2004 All Rights Reserved

C # Coding Standards for.net By Lance Hunt. Document Version 1.13 August Copyright Lance Hunt 2004 All Rights Reserved

C Coding Style Guide Version 0.4

CSC Web Technologies, Spring Web Data Exchange Formats

CS 351 Design of Large Programs Coding Standards

Objectives. Coding Standards. Why coding standards? Elements of Java Style. Understand motivation for coding standards

Log4Delphi Coding Standards

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?

LECTURE 02 INTRODUCTION TO C++

EE 382 Style Guide. March 2, 2018

! A literal represents a constant value used in a. ! Numbers: 0, 34, , -1.8e12, etc. ! Characters: 'A', 'z', '!', '5', etc.

SOFT 161. Class Meeting 1.6

Makefiles Makefiles should begin with a comment section of the following form and with the following information filled in:

Coding Style Handout #15 February 1, CS106A Winter

CS 251 Intermediate Programming Coding Standards

Coding Guidelines. Introduction. General Points. Avoid redundant initialization/assignment

Programming Syntax and Style. David Greenstein Monta Vista High School

! A program is a set of instructions that the. ! It must be translated. ! Variable: portion of memory that stores a value. char

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData

Working with JavaScript

Introduction to C++ General Rules, Conventions and Styles CS 16: Solving Problems with Computers I Lecture #2

OO and Ahh! An Introduction to Object Oriented Programming With PHP. Division 1 Systems. John Valance. Copyright John Valance Division 1 Systems

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Introduction to XML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

The original of this document was developed by the Microsoft special interest group. We made some addons.

Coding Standards for Java

ESSnet on SDMX. WP3 Functional and Technical Specifications. WP: 3 SDMX Data Express

Introduction to Java & Fundamental Data Types

Using C++, design an Abstract Data Type class named MyGrades. The class must have the following private members :

IT 374 C# and Applications/ IT695 C# Data Structures

So, if you receive data from a server, in JSON format, you can use it like any other JavaScript object.

Expanded Guidelines on Programming Style and Documentation

Objectives. In this chapter, you will:

Programmazione. Prof. Marco Bertini

Code Editor. The Code Editor is made up of the following areas: Toolbar. Editable Area Output Panel Status Bar Outline. Toolbar

Lecture Notes on Programming Languages

VARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals

Assignment Marking Criteria

Appendix G C/C++ Notes. C/C++ Coding Style Guidelines Ray Mitchell 475

Rule 1-3: Use white space to break a function into paragraphs. Rule 1-5: Avoid very long statements. Use multiple shorter statements instead.

Chapter 2: Basic Elements of C++

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

CSCI 1060U Programming Workshop

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11

Chapter 2 Basic Elements of C++

Google Java Style. 1 Introduction. Last changed: March 21, Introduction 1.1 Terminology notes 1.2 Guide notes

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

CS 1044 Program 6 Summer I dimension ??????

Course Coding Standards

Retrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved.

Skill Area 336 Explain Essential Programming Concept. Programming Language 2 (PL2)

Microsoft Access: Table Properites, Complex Forms. Start with a new, blank Access database,

Database Programming Style Guidelines

Bit (0, 1) Byte (8 bits: 0-255) Numeral systems. Binary (bin) 0,1 Decimal (dec) 0, 1, 2, 3, Hexadecimal (hex) 0, 1, 2, 3, 1/13/2011

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

Java Style Guide. 1.0 General. 2.0 Visual Layout. Dr Caffeine

Conventions, Style & Best Practices

CSI33 Data Structures

Programming Style Guide v1.1

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5.

Javascript Arrays, Object & Functions

C Formatting Guidelines

Variables and Functions. ROBOTC Software

The C++ Language. Arizona State University 1

Pythonic Coding Style. C-START Python PD Workshop

Visual Programming. Lecture 3: Loops, Arrays. Mahmoud El-Gayyar

PROGRAMMING STYLE. Fundamentals of Computer Science I

XML JavaScript Object Notation JSON Cookies Miscellaneous What Javascript can t do. OOP Concepts of JS

Hotmail Documentation Style Guide

CGS 3066: Spring 2015 JavaScript Reference

XML 2 APPLICATION. Chapter SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

Introduction to JSON. Roger Lacroix MQ Technical Conference v

Lecture 4. Defining Functions

SOAPScript For squeaky-clean code, use SOAPScript Language Summary Bob Nisco Version 0.5 β

Microsoft Visual Basic 2005: Reloaded

CSCE 120: Learning To Code

Supplement D: Expanded Guidelines on Programming Style and Documentation

Chapter 5. Variables. Topics. Imperative Paradigm. Von Neumann Architecture

/ Introduction to XML

Coding Convention for ECON 41701

UEE1302 (1102) F10: Introduction to Computers and Programming

Using the Code Review Module

We are following the agile (SCRUM) methodology for all the development process. (We can search for any free tool for agile)

CSCI 2101 Java Style Guide

DaMPL. Language Reference Manual. Henrique Grando

Full file at

JME Language Reference Manual

Eclipse Plugin Tool for Learning Programming Style of Java

CIS 3260 Intro to Programming with C#

CMSC 201 Fall 2018 Python Coding Standards

Chapter 17. Fundamental Concepts Expressed in JavaScript

Program Fundamentals

Data Structure and Programming Languages

Transcription:

Guidelines Quick Reference.NET Guidelines General Casing Identifier Case Example Class Pascal MyClass Property Pascal BackColor Private fields (class) _Camel _fieldname Private fields (function) Camel fieldname Method Pascal ToString Parameter Camel firstname Read only static field Pascal RedValue Interface Pascal IDisposable Namespace Pascal System.Drawing Enumeration type Pascal ErrorLevel Enumeration values Pascal FatalError Event Pascal ValueChanged Exception class Pascal WebException Naming Do choose easily readable identifier names. Do favor readability over brevity. Do not use underscores, hyphens, or any other nonalphanumeric characters. Do not use Hungarian notation. Acronyms Do not use abbreviations or contractions as parts of identifier names. Exception: Id(id) and Ok(ok) are allowed and should be camel cased. Do not use any acronyms that are not widely accepted.

Do capitalize both characters of two character acronyms, except the first word of a camel cased identifier. Ex. DBConnection, dbconnection. Do capitalize only the first character of acronyms with three or more characters, except the first word of a camel cased identifier. Ex. Xml, Sql, xml, sql. Properties Do create read only properties if the caller should not be able to change the value of the property. Do not provide set only properties. Do provide sensible default values for all properties. Do allow properties to be set in any order. Fields Do not provide instance fields that are public or protected. Do use constant fields for constants that will never change. Style Always place curly braces on a new line getter/setter are an exception Indents are always tabs (default = 4 spaces) Use Regions to group code blocks Do use constants for repeated values Always use curly braces for if, while, foreach, do, etc 1 space around operators Do use code formatter Do not format code AND make changes at the same time Do use utility classes for helper functions Best Practices Do make business logic classes that contain the database calls and business logic. Do create Data Access Layer classes for excessive database calls. Do not comment obvious code i.e. /*send It*/ email.send(); Do comment above line of code Do add block comments for all classes Do add block comments for complex functions no need to comment the function SendEmail() Use comments to explain WHY choices were made when its not obvious Use comments to explain assumptions that are not obvious. No empty exception catches Do not comment out code delete it! Do not check in unused code

Do use shelves for long running work Do use.cs files for code behind (aspx.cs, ascx.cs) Do name the solution and project files something appropriate. e.g. not web.sln or project.sln. SQL Server Do not prefix table names, procedure names, view names with tbl_, sp_, view_ Do not suffix table names, procedure names, view names with _tbl, _sp, _view Do use singular table names (i.e. Customer vs Customers)

General Javascript Casing Identifier Case Example Class Pascal MyClass Property Camel backcolor Function Camel tostring Parameter Camel firstname Constant UpperCase_ SERVER_NAME Namespace Pascal SilverTech.Utility General Javascript Rules Always indent code with 4 spaces. No whitespace at the end of line or on blank lines. No filler spaces in empty constructs (e.g., {}, [], fn() ) New line at the end of each file. Strings always use double quotes (single quotes in string) Naming Do choose easily readable identifier names. Do favor readability over brevity. Do not use underscores, hyphens, or any other non alphanumeric characters. Do not use Hungarian notation. Curly Braces Curly Braces start on same line, end on new line. if/else/for/while/try always have braces and always go on multiple lines. Examples: function tocelsius(fahrenheit) { return (5 / 9) * (fahrenheit 32); } for (i = 0; i < 5; i++) { x += i; }

Chained Method Calls When a chain of method calls is too long to fit on one line, there must be one call per line, with the first call on a separate line from the object the methods are called on. If the method changes the context, an extra level of indentation must be used. $(.foo ).addclass( "bar" ).children().html( "Heya" ) Objects: Declared on one line, new line for each property setter. ending brace always on new line. var person = { firstname: "John", lastname: "Doe", age: 50, eyecolor: "blue" };

General HTML\CSS Casing Identifier Case Example Class hyphens silvertech button active Id hyphens body container Function Camel tojson Parameter Camel firstname Constant UpperCase_ SERVER_NAME Namespace Pascal SilverTech.Utility Html Rules: Always declare the document type as the first line in your document Always use lowercase element names Always use lowercase attribute names Always close elements Always quote attribute values Do not make class = blue (eric will stab you)