Programming Style a programs language gives you a lot of freedom how to write a program – too much? but some programming style is good goal: it must be.

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

Introduction to Java.
XHTML Basics. What is XHTML? XHTML is newer than the old HTML XHTML has stricter rules and does not allow some elements formerly used in HTML One benefit.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Coding Standard: General Rules 1.Always be consistent with existing code. 2.Adopt naming conventions consistent with selected framework. 3.Use the same.
© 2007 Lawrenceville Press Slide 1 Chapter 3 Classes and Objects.
1 Software Craftsmanship Steve Chenoweth CSSE 375, Rose-Hulman Based on Don Bagert’s 2006 Lecture Right – Making sundials. From website
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
15-Jun-15 Beginning Style. 2 Be consistent! Most times, you will enter an ongoing project, with established style rules Follow them even if you don’t.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Week 3 Recap CSE 115 – Fall Java Source Code File Made up of: Package declaration Class definition.
Algorithm Programming Coding Advices Bar-Ilan University תשס " ו by Moshe Fresko.
Developing a Basic Web Page Posting Files on UMBC
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
METHODS Introduction to Systems Programming - COMP 1005, 1405 Instructor : Behnam Hajian
Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs.
(1) Coding Standards Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu HI
Primitive Data Types and Operations Identifiers, Variables, and Constants Primitive Data Types Byte, short, int, long, float, double, char, boolean Casting.
Programming Style and Documentation Objective(s) F To become familiar with Java Style and Documentation Guidelines.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
The Java Programming Language
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
Word Processing Test Review. Purpose To create a document.
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
Java Syntax and Style JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin, Gary Litvin,
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Program style. Global area Place comment s at beginning of the program: 1.purpose 2.author 3.the date the program was written 4.the data and description.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Documentation and Programming Style Appendix A © 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Code Conventions Tonga Institute of Higher Education.
Chapter 3 Introduction To Java. OBJECTIVES Packages & Libraries Statements Comments Bytecode, compiler, interpreter Outputting print() & println() Formatting.
HTML Tags Lesson 2. What are HTML Tags?  Markup tags  Coded instructions that accompany the plain text of an HTML document  Syntax –Left wicket< –Tag.
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
Program Style Chapter 22 IB103 Week 12 (part 2). Modularity: the ability to reuse code Encapsulation: hide data access directly but may use methods (the.
Documentation and Style. Documentation and Comments  Programs should be self-documenting.  Use meaningful variable names.  Use indentation and white.
Agenda Lists Purpose Types of Lists: Unordered Ordered Definition.
CPS120: Introduction to Computer Science Introduction to C++
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging.
1 JavaScript in Context. Server-Side Programming.
CSS THE MISSING MANUAL Introduction. Benefits of CSS Style sheets offer more formatting choices than are offered in straight HTML  EXAMPLE: When you.
DESIGNING A WEB PAGE Introducing the… &TAGS.
© 2007 Lawrenceville Press Slide 1 Chapter 3 Classes and Objects 1. How is a class different from an object?
Introducing Java Chapter 3 Review. Why Program in Java? Java, is an object-oriented programming language. OOP languages evolved out of the need to better.
------TAO, MARKUS Project IT. JavaDoc ‣ JavaDoc is a standard method of commenting source code (interfaces, classes, methods, instances variables). ‣
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
FG Group -Afrilia BP -Liana F.B.I -Maulidatun Nisa -Riza Amini F.
Lesson 5. XHTML Tags, Attributes and Structure XHTML Basic Structure head and body titles Paragraph headings comments Document Presentation Manipulating.
Working with Java.
Coding, Testing and Valdating a Web Page
Using local variable without initialization is an error.
Statements, Comments & Simple Arithmetic
Programming Vocabulary.
Ruby Testing 2, 11/9/2004.
Chapter 1: Computer Systems
Documentation Comments in C#.
JavaDoc and Contracts Fall 2008.
Chap 2. Identifiers, Keywords, and Types
Chapter 2 Primitive Data Types and Operations
Presentation transcript:

Programming Style a programs language gives you a lot of freedom how to write a program – too much? but some programming style is good goal: it must be easy to understand the program there are standards – deviate from a standard only if there is a very good justification 3 legs of style: – program structure – naming of program elements – comments (documentation) you can define formatting in Eclipse

Structure indentation – nesting – blocks – Eclipse does it for us packages classes, methods – order of parameters – order of operands in an expression order of declarations line wrapping white space – spaces, no tabs

Naming name must clearly denote the element's purpose – no abbreviations, unless it's a standard – no one letter names, unless it's a standard – variables are as important as methods expressive, but terse – not aVariable (not expressive) – not undecidedStudentWithoutMajor (not terse) – not aMethodIWroteYesterday (who cares) camel notation – class names start with uppercase – methods, variables start with lowercase – all other words start with uppercase – except packages all lowercase, underscores self-documenting names

Comments, Documentation on all levels at detail – line comments // within method body – block comments /* */ main comments documenting declarations – classes, methods, parameters – Javadoc /** */ standard for declarations can be extracted into a web page – no body, formatted – separate manuals you must document – every non-obvious code line – every logical block introduced – every class, its purpose – every instance variable, its purpose – every method, its purpose, pre- and post-conditions – every parameter, its purpose, permissible values expressive, but terse

ICS 111 Standard