Best Practices Philip Windridge. Links Naming Conventions  

Slides:



Advertisements
Similar presentations
Hyper Text Markup Language.  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Advertisements

WeB application development
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.
ASHIMA KALRA.  WHAT IS HTML WHAT IS HTML  HTML TAGS HTML TAGS  FORMATTING TAGS FORMATTING TAGS.
Standards and Increasing Maintainability on Web- based Systems James Eaton SE4112/16/2006.
XHTML Basics.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
1 eVenzia Technologies Learning HTML, XHTML & CSS Chapter 1.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 3: XHTML Coding © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page.
Site Development Foundations © 2004 ProsoftTraining All rights reserved.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Chapter 1 Understanding the Web Design Environment
Search Engine Optimization March 23, 2011 Google Search Engine Optimization Starter Guide.
Slide 1 Today you will: think about criteria for judging a website understand that an effective website will match the needs and interests of users use.
DAT602 Database Application Development Lecture 14 HTML.
Working with XHTML Creating a Well-Formed Valid Document.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
HTML BASICS Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
HTML Structure & syntax
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
Professor Brian R Banho.  Design, create, and publish web sites  Learn Microsoft Expression Web software  Explore Web design resources  Create a portfolio.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
Professor Brian R Banho.  Design, create, and publish web sites  Learn Microsoft Expression Web software  Explore Web design resources  Create a portfolio.
XHTML & CSS By Trevor Adams. Topics Covered XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements.
PHD. Mohamed Mikki The definition of testing Software testing : is the act of verifying that the software functions properly and ensure the quality of.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Write basic.
Objective Understand concepts used to web-based digital media. Course Weight : 5%
XHTML and CSS Session 1 Intro, (X)HTML, CSS, W3C, browsers, webpage, structure, tags, attributes, elements, web development process, basic XHTML elements.
Web software. Two types of web software Browser software – used to search for and view websites. Web development software – used to create webpages/websites.
Web Standards Web Design – Sec 2-4 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
XHTML By Trevor Adams. Topics Covered XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
Internet Fundamentals and Web Page Design Day 1. Agenda  Roll Call  Introduction  BlackBoard Overview  Syllabus Review  Classroom contract  Class.
Web Design. How do web pages work? Webpages are written in a code called HTML. Programs like Internet Explorer read the code, and then show it as a web.
Web Site Design & Management Class One Agenda Attendance Questionnaire Introductions Class Policies About the class Code your first page FTP Assignments.
HTML Basic. What is HTML HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Basic Document Structure.
The World Wide Web. What is the worldwide web? The content of the worldwide web is held on individual pages which are gathered together to form websites.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
HTML HyperText Markup Language Victoria E. Kozlek.
May 6, 2009 Browser Compatibility Testing Definition It is a non functional type of testing where web based applications are tested on various browsers(IE.
Learning Aim C.  Once the website is complete, you should test it using the test plan you created at the design stage.
Validation. What is Validation? Removing errors improves the consistency of how our pages look to a wide variety of browsers and devices. Ensuring that.
INTERNET VOCAB. WEB BROWSER An app for finding info on the web.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2003 Working Together 1 Word 2003 and Your.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Web Design Terminology Unit 2 STEM. 1. Accessibility – a web page or site that address the users limitations or disabilities 2. Active server page (ASP)
XHTML Basics. What is XHTML? XHTML is newer than, but built upon, the original HTML (Hyper Text Markup Language) platform. XHTML has stricter rules and.
Hyper Text Markup Language.  My First Heading My first paragraph. Example Explained The DOCTYPE declaration defines the document type The text between.
Introduction to HTML Hypertext Mark-up Language. HTML HTML = Hypertext Mark-up Language Is just plain simple text marked up by “tags” You can create a.
Web Page Design The Basics. The Web Page A document (file) created using the HTML scripting language. A document (file) created using the HTML scripting.
COMP 103 Exam Tips. 2 The Exam (Example) answer all questions manage your time Dumb calculators & non- electronic dictionaries are OK.
Testing and delivery Web design principles. Web development is software development.
Session IV Chapter 14 – Chapter 14 – XSLThttp://
Validation.
ET-710 Web Technology: Building and Maintaining Web Sites
Churchlands SHS Owen Goyder
Software Applications for end-users
Web Programming– UFCFB Lecture 9
Validation.
browser search engine web page
Internet Fundamentals and Web Page Design Day 1
Web Programming– UFCFB Lecture 9
Interface Design 2 Week 11.
WEB PAGES AND WEB SITES.
Internet Vocabulary Beth Felton McKelvey.
ADTEL WEBSITE
Presentation transcript:

Best Practices Philip Windridge

Links Naming Conventions   Pseudocode  _std.html _std.html A standard style for code written in PHP 

References Sommerville, I. 2007, Software engineering, 8th edn, Addison-Wesley, Harlow. Coggeshall, J. et. al 2005, PHP 5 Unleashed, SAMS

Lecture Outcomes To outline and show examples of simple, good practice when developing code.

Where are you? Find that programming is in just a source of mental anguish Find that programming fills a major void in my life I use it as much as I have to and no more I enjoy program- ming, I can clearly see that it will be useful

What are Best Practices? We are not (in the positive sense) hackers So we need to work at…  Suitability of code – planning  Clarity of code – readability Adherence to standards Keywords  Planning, consistency/style, documentation

Plan

Hangman

Hangman (partial) READ guess APPEND guess to end of stringOfGuesses FOR each letter in wordToBeGuessed IF letter is in stringOfGuesses THEN INCREMENT lettersGuessed APPEND letter to end of wordToDisplay IF letter is same as current guess THEN SET letterWasFound to TRUE END IF ELSE APPEND “_” to end of wordToDisplay ENDIF END LOOP

Style

Hangman (partial) $a = $_POST['submit']; $b.= $a; for($i = 0; $i < $c; $i++){ if(strstr($b, $d[$i])){ $e++; $f.= $d[$i]; if($a === $d[$i]){$g = true;}} else {$f.= "_ ";}}

Hangman (partial) $guess = $_POST['submit']; $guesses.= $guess; for($i = 0; $i < $wordToBeGuessed_length; $i++){ if(strstr($guesses, $wordToBeGuessed[$i])){ $lettersGuessed++; $wordToDisplay.= $wordToBeGuessed[$i]; if($guess === $wordToBeGuessed[$i]){ $letterWasFound = true;}} else{ $wordToDisplay.= "_ ";}}

Hangman (partial) $guess = $_POST['submit']; $guesses.= $guess; for ($i = 0; $i < $wordToBeGuessed_length; $i++) { if (strstr($guesses, $wordToBeGuessed[$i])) { $lettersGuessed++; $wordToDisplay.= $wordToBeGuessed[$i]; if ($guess === $wordToBeGuessed[$i]) { $letterWasFound = true; } } else { $wordToDisplay.= "_ "; }

Documentation

Hangman (partial) $guess = $_POST['submit'];//Get the letter guessed $guesses.= $guess;//Add it to the rest of the guesses //Check each letter in the word for ($i = 0; $i < $wordToBeGuessed_length; $i++) {// against all the letters guessed if (strstr($guesses, $wordToBeGuessed[$i])) {//If the letter has been guessed $lettersGuessed++; $wordToDisplay.= $wordToBeGuessed[$i]; if ($guess === $wordToBeGuessed[$i]) {//If current guess is successful $letterWasFound = true; } } else {//if letter doesn’t match any letter $wordToDisplay.= "_ ";//guessed so far }

Standards

Web Standards Responsible designers create web sites that are standards compliant  It is better for the web It is possible to design web sites that are not compliant to web standards  Why do this?  We know better already We are creating web sites that are compliant to XHTML 1.0  Supported by major browsers  Comes in Strict, Transitional and Frameset flavours

Web Standards It is not enough to say:  “It looks OK with Internet Explorer” or  “Checked it with FireFox and it looked ok” It is not enough that mark-up merely looks right in the browser Design for the Internet, design for cross platform compatibility, design for professional pride and most of all…  Make your design work in all the ways your users wish to interact with it  Do not dictate the Internet to the user – it is not our job to do so!

Being nice to yourselves!

Improving Your Code Use functions where code can be generalised Use separate files for PHP where common code will be used across multiple pages

Improving Your Code Code available within the page  User defined functions Code available across a number of web pages  include  require  include_once  require_once