Lecture 9 Professional Practices

31
Comp112 Lecture 7, Semester , Year Lecture 9: Professional Practices SFDV2001 Web Development

Transcript of Lecture 9 Professional Practices

Page 1: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Lecture 9:Professional Practices

SFDV2001Web Development

Page 2: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

What are professional practices?

Making a web page isn't hard - anybody can get something on the web. Making quality web pages requires skill, requires a professional.

Some professional practices are things that by law you should conform to. Others are the things that distinguish your work from that of an amateur.

We expect professionals to possess significant skills, that they produce work of a quality not obtainable by an amateur and that their knowledge is significant.

Page 3: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Web browsers will display any old rubbish.

Page 4: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

• No doctype

• No <html> tag

• No <head>, <title> or <body> tags

• No structural tags

• Multi-word face value not quoted

• Incorrect values for size

• No closing tags

• No alt etc. for image.

Page 5: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

CodeThere are many things that indicate quality code:

CommentsDevelopers who take the time to properly document their work make their lives, and the lives of others, much easier.

Avoid stating the obvious:<!-- Table starts here -->

<table>

<tr> …

Assume that any person reading your code understands basic HTML.

Page 6: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Use your comments to document what isn't obvious:

When code is used for something other than its standard purpose.

<form method="get" action="/bin/search"><!-- Table controls layout of search form -->

<table border="0"><tr> …

To explain where new content should be added:

<h1>Notices</h1><!-- Model new notice code:

<h2>Date</h2><p>Notice</p>

place new notice code here --><h2>13 March 2007</h2> …

Page 7: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

To explain any code that may look a bit odd (though think very carefully about your code in these instances). To make identifying the key elements of your page structure easier:

<!--Table controlling page layout --><!-- Main navigation bar --><!-- Text only navigation strip --><!-- Page footer -->

LayoutLayout your code in a way that makes it easy to read.In the lab Taco will do this for you (with various degrees of success). You can, of course, alter Taco's attempt or forgo the automatic option altogether and do it manually.

Page 8: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Use tabs to indent the different levels of your code:

Top level startSecond level start

Third level start…

Third level finish Second level finish

Top level finish

<table><tr>

<td><p>Content</p>

</td></tr>

</table>

Page 9: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

EfficiencyAsk yourself - Is there a simpler, more elegant way of doing this?

Tables:- use rowspan and colspan instead of <br> or &nbsp; in cells.

- keep your tables as simple as possible - why use two when one will do?

- Is your table code really necessary? A single row, single cell table?

Frames:- Take advantage of <base> where appropriate.

Page 10: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Alignment:- Use align for single line centering and <center> for blocks of central alignment.

<center><h1>Ice Cream</h1></center>Vs<h1 align="center">Ice Cream</h1>

FontsIf you specify a specific font face, you should always provide a suitable generic font family name too:

<font face="arial, sans-serif">

font-family: courier, monospace

Page 11: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

ImagesUse correct width and height specifications. This enables the browser to layout the page correctly before the image has downloaded.

Resize your images with graphic editing software not with your HTML code.

Use good alt values - descriptive sentences.

alt="Percy the cat." alt="Giraffe in hiking gear."

Page 12: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Image size and the web

Dialup (56k modem) = 56 kilobits per second, not kilobytes!

56 kilobits = 7 kilobytes per second.

So, a single 32KB image will take at least 4.5 seconds.

"Broadband" starts at 256 kilobits (32KB per second) maximum.

1 megabit (1024 kilobits) broadband = 128KB per second max.

Page 13: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Image CompressionThe two most common graphics formats, GIF (Graphic Interchange Format) and JPEG (Joint Photographic Experts Group). Both represent image files in a compressed form rather than on a pixel by pixel basis.

There is a third format, PNG (Portable Network Graphic) browser support used to be limited but is now (with the exception of IE) good.

GIF• Allows single pixel transparency.• Suitable for flat colour images. • Can be used for animations.

Page 14: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

JPEG (JPG)• 24 bit RGB information.• Suitable for material such as photographs and other continuous tone images.• Not suitable for graphics with large areas of flat colour, as these will become blotchy.

PNG• PNG offers multiple transparency options.

- Single pixel transparency (like GIF).- Alpha channel transparency (levels of opacity).

• Although most modern browsers support all PNG features, Internet Explorer doesn't support alpha-channel transparency in versions up to and including 6.

Page 15: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Comparison - photos

jpg 2.8KB

gif 2.3KB

png 5.1KB

Page 16: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Comparison - drawn images

jpg 1.7KB

gif 3.3KB

png 3.1KB

Page 17: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

StandardsAny professional worth their salt has a good understanding of the standards of their trade. Web developers are no different.

HTML standards:

- HTML 4.01 Transitional/Frameset/Strict

- XHTML 1.0 Transitional/Frameset/Strict

- XHTML 1.1

Use the right doctype for your code.

<!Doctype HTML Public “-//W3C//DTD HTML 4.01 Transitional//EN”>

<!Doctype HTML Public “-//W3C//DTD HTML 4.01//EN”>

Page 18: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

ValidationUse a validation tool like the W3C's HTML validator

Be aware that they can't check everything. You need to manually verify your code too. Validation tools won't check:

- Some values inside quotation marks. E.g.:

<img src="test.jpg" alt="" width="banana" height="rabbit">

will pass in online validators.

- How sensible and/or efficient your code is.

Page 19: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Spelling and grammarNothing suggests a sloppy attitude quite like failing to take the time to proof read the content of your pages.

Page 20: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Don’t forget the text in your <title>, alt, etc.

Use a spell checker to help, but don’t rely on it alone.

Page 21: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

TestingCheck and double-check that all your links work. Before and after you upload to your web server.

Test on every browser and operating system you can get your hands on.

Test with different connection speeds.

Test on different screen resolutions.

Test on different monitor types.

Usability testing.

Page 22: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

InvolvementKeep up with what’s new in the field. There is always something to learn.

For web development, one of the best way to stay current is to participate in and read the many quality web-based publications in the profession.

A List Apart (http://alistapart.com/)

Digital Web Magazine (http://www.digital-web.com/)

Style Gala (http://www.stylegala.com/)

Mailing Lists: W3C (http://www.w3.org/Mail/)

Page 23: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

It’s very important to note that, no matter how much you know, there is always more to learn. I don’t think there is any Web professional out there that will tell you they 100% “get” the Web, regardless of how long they’ve been at it. Things change too quickly and there is just too much to learn and know.If you take responsibility for the completeness of your education and make a commitment to life-long learning you’ll do just fine, regardless of what path you choose.- D. Keith RobinsonContributing Writer and Former Editor In Chief of Digital Web Magazine.

Page 24: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

PlagiarismThe use of somebody else’s work without acknowledgement.

Can occur deliberately (with intent to deceive) and accidentally (without understanding).

Acts of plagiarism can breech the law (intellectual property rights).

It is perfectly possible to plagiarise “free” sources. In such instances the plagiarism is a moral and ethical issue but it is not illegal.

Page 25: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

it is legal for a student to copy several paragraphs (or even pages) of text from a public domain book, such as Lewis Carroll’s Alice’s Adventures in Wonderland, and then directly add this text to his or her own paper. If this text were not clearly identified as to his or her source, then the student would be guilty of plagiarism, using another writer's work as if it were his or her own.-http://en.wikipedia.org/wiki/Plagiarism

Wikipedia content can be copied, modified, and redistributed so long as the new version grants the same freedoms to others and acknowledges the authors of the Wikipedia article used (a direct link back to the article satisfies our author credit requirement). -http://en.wikipedia.org/wiki/Wikipedia:Copyrights

Page 26: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

The World Wide Web has made it very easy for us to access and copy material.

It has also made it relatively easy for us to determine the source of plagiarised material.

“A redisigned site can advance a company's eBusiness strategy, help a company keep up with new technology standards, provide access to new applications and content, integrate with overall branding and user experience standards, and reduce Web site operating costs.”

Page 27: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Copyright InfringementThe unauthorised use of copyrighted material.

It is illegal to use copyright material without the owners permission.

Assume copyright until informed otherwise.

Page 28: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Page 29: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Copyright and educationThe NZ Copyright Act 1994 allows individuals to copy portions of copyrighted material for research or study purposes.

The act allows universities to make multiple copied of a copyrighted work within certain guidelines.

New Zealand universities also have an agreement whereby they can exceed the number of copies permitted under the Copyright Act in certain circumstances.

Materials sourced from the Internet are subject to standard copyright law.

Alter to suit local law

Page 30: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year

Additional recommended site:

The Web Standards Project:http://www.webstandards.org/

Page 31: Lecture 9 Professional Practices

Comp112 Lecture 7, Semester , Year