The Evils of Copy and Paste Presented by Daniel Daugherty

Slides:



Advertisements
Similar presentations
Layouts Using Tables Web Design – Section 4-5 Part or all of this lesson was adapted from the University of Washingtons Web Design & Development I Course.
Advertisements

1 Web Site Design Overview of the Internet Cookie Setton.
Intro To Cascading Style Sheets By Mario Yannakakis.
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Today CSS HTML A project.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
HTML / CSS – Basics Why the heck are we doing this?
CNIT 133 Interactive Web Pags – JavaScript and AJAX Review CSS.
Cascading Style Sheets Understanding styles. The term cascading describe the capability of a local style to override a general style. CSS applies style.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Dreamweaver MX ? Create professional web pages Visual editing functions –No need to write HTML Includes complete FTP client software Recognises.
DT228/3 Web Development JSP: Directives and Scripting elements.
Maintainability Sp.772 April 29th Important Criteria Easy to understand –New web masters –Old web masters –The user Easy to update –Bug fixes –New.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Copyright 2001 Michael Slinn JBrowCaps Open Source Browser Independent Page Rendering for Java Servlets Mike Slinn
 What I hate about you things people often do that hurt their Web site’s chances with search engines.
JMD2144 – Lesson 5 Web Design & New Media. ‘Div’ide and conquer One of the most versatile structure tags available is the.. tag Short for ision, it allows.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
Multimedia & The World Wide Web winny HCI 201 Multimedia and the www.
WorkPlace Pro Utilities.
DIY Web Development Hand Code Your Own Page (For Free!) by Bryan Brown, Indiana University Bloomington SLIS.
The Characteristics of CSS
CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.
INTERNAL CSS Casey Ames Different types of CSS There are three different types of CSS: ◦ External CSS ◦ Internal CSS ◦ Inline CSS In this presentation.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
Visual Web Design Dreamweaver Level 2. Hospitality Restrooms Food and Drink Turn cell phones off or set to vibrate Smoking Comfort Breaks Class Hours.
XHTML/CSS Week 3. This Week  Quiz to revise last week (XHTML and DW)  CSS - Part 2  Using HTML Tables.
Form Tag How to use Form Tag Something NEW ? PARAMETER Attribute NAME Specifies the name for a form To specify which form to submit with JavaScript, this.
 cascade Style Sheets (CSS) is a mark-up language that was first proposed in 1994 by Håkon Wium Lie. CSS works in conjunction with HTML to greatly increase.
Internet Web Publishing III. Intro to Cascading Style Sheets Patricia Roberts.
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Introduction to Cascading Style-sheets (CSS) Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 1.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
Word 2013 Certification Skills Measured. 1. Create and Manage Documents  Create a Document  Navigate through a Document  Format a Document  Customize.
CLASSES REVIEW: HREF, CONTEXT, FILE STRUCTURE. BIG CAVEAT Never cut and paste from a Powerpoint slide Punctuation is not the same Note that the “ is curly.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Saving Form Data You can save form data in Google Spreadsheets using the following steps. 1.Create a Google Spreadsheet in your documents 2.Use Tools to.
Where does PHP code get executed?. Where does JavaScript get executed?
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
Web Development 101 Presented by John Valance
INTRODUCTION TO CSS. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features of CSS Features of CSS  Creating Style Sheet Creating Style Sheet.
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Cascading Style Sheets
Review of HTML and CSS A (very) brief review of some key fundamentals to be aware of in IT-238.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
1 Minification JavaScript & CSS. 2 Minification Removing 0 Whitespace 0 Line Breaks 0 Comments 0 Shrink Variables 0 Optimize Code.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
HTML LAYOUTS. CONTENTS Layouts Example Layout Using Element Example Using Table Example Output Summary Exercise.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Web Basics: HTML/CSS/JavaScript What are they?
Dreamweaver MX Lesson 14: Using Find and Replace.
>> Introduction to CSS
Key concepts of Computing
Word Processing.
Objects First with Java
CS134 Web Design & Development
Building ASP.NET Applications 2
Web Design & Development
Presentation transcript:

The Evils of Copy and Paste Presented by Daniel Daugherty

Why is Copy and Paste Evil? Wait a second I use copy and paste all the time what is wrong with it?????? You mean I have to retype everything every time??

Why is Copy and Paste Evil? Copy and Paste != Code Reuse Copy and Paste is code duplication But more is good right?

What should I do instead? Cut and Paste is your friend. Cut the code and place where it can be referenced in two or more places (actual code reuse). This may require some refactoring of the code into a more reusable segment of code.

Advantages Of Cut and Paste No duplication of code No duplication of bug(s) within duplicated code. Improved Readability Improved Maintainability Improved Testability

Code Reuse options in ColdFusion variables include module custom tags import CFC Functions Web Services AJAX

Does it matter how much I copy and paste? Copying as little as one word could be a reason to extract that into a reusable segment. Even simple text labels. Examples Externalize a field label or column header If length(x) and isdate(x) If length(y) and isdate(y) becomes If validDate(x) If validDate(y)

Copy Paste Change? But I just need to copy paste this 3 lines and make two small changes. Small changes can be very error prone. Large changes tend to be tested better than small. Possible options for reuse of this code. CFModule/Custom Tag CFC/Function

What about other languages? JavaScript, ActionScript - methods, variables, external files, prototypes. CSS - named classes, multiple selectors for one set of attribute(s). Breaking style up into smaller re-useable blocks: Layout, Text, Color … Java - classes, methods, variables, JSP tags, EJB, web services, …

What about other applications? Are both applications for same customer/company/client? Use web services to make the logic available to both applications. If both live on the same servers use mappings/custom tag paths to allow both apps to reference the same code.

Code Example/Walkthrough

Wrap Up Try keeping track of how many times you copy and paste code for one day. You might be surprised at how often you do it. Then think each time you do how can I move this to a reusable format. Some copy paste is OK. Questions?