Lecture 9 Professional Practices


Published on

Professional Practices for Web Development

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Lecture 9 Professional Practices

  1. 1. Lecture 9: Professional Practices SFDV2001 Web Development
  2. 2. 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.
  3. 3. Web browsers will display any old rubbish.
  4. 4. <ul><li>No doctype </li></ul><ul><li>No <html> tag </li></ul><ul><li>No <head> , <title> or <body> tags </li></ul><ul><li>No structural tags </li></ul><ul><li>Multi-word face value not quoted </li></ul><ul><li>Incorrect values for size </li></ul><ul><li>No closing tags </li></ul><ul><li>No alt etc. for image. </li></ul>
  5. 5. Code There are many things that indicate quality code: Comments Developers 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.
  6. 6. <ul><li>Use your comments to document what isn't obvious: </li></ul><ul><ul><li>When code is used for something other than its standard purpose. </li></ul></ul><ul><li><form method=&quot;get&quot; action=&quot;/bin/search&quot;> </li></ul><ul><li><!-- Table controls layout of search form --> </li></ul><ul><li><table border=&quot;0&quot;> </li></ul><ul><li><tr> … </li></ul><ul><ul><li>To explain where new content should be added: </li></ul></ul><ul><li><h1>Notices</h1> </li></ul><ul><li><!-- Model new notice code: </li></ul><ul><li><h2>Date</h2> </li></ul><ul><li><p>Notice</p> </li></ul><ul><li>place new notice code here --> </li></ul><ul><li><h2>13 March 2007</h2> … </li></ul>
  7. 7. <ul><li>To explain any code that may look a bit odd (though think very carefully about your code in these instances). </li></ul><ul><li>To make identifying the key elements of your page structure easier: </li></ul><ul><li><!--Table controlling page layout --> </li></ul><ul><li><!-- Main navigation bar --> </li></ul><ul><li><!-- Text only navigation strip --> </li></ul><ul><li><!-- Page footer --> </li></ul>Layout Layout 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.
  8. 8. Use tabs to indent the different levels of your code: Top level start Second level start Third level start … Third level finish Second level finish Top level finish <table> <tr> <td> <p>Content</p> </td> </tr> </table>
  9. 9. <ul><li>Efficiency </li></ul><ul><li>Ask yourself - Is there a simpler, more elegant way of doing this? </li></ul><ul><li>Tables: </li></ul><ul><ul><li>use rowspan and colspan instead of <br> or &nbsp; in cells. </li></ul></ul><ul><ul><li>keep your tables as simple as possible - why use two when one will do? </li></ul></ul><ul><ul><li>Is your table code really necessary? A single row, single cell table? </li></ul></ul><ul><li>Frames: </li></ul><ul><ul><li>- Take advantage of <base> where appropriate. </li></ul></ul>
  10. 10. <ul><li>Alignment: </li></ul><ul><ul><li>Use align for single line centering and <center> for blocks of central alignment. </li></ul></ul><ul><li><center><h1>Ice Cream</h1></center> </li></ul><ul><li>Vs </li></ul><ul><li><h1 align=&quot;center&quot;>Ice Cream</h1> </li></ul>Fonts If you specify a specific font face, you should always provide a suitable generic font family name too: <font face=&quot;arial, sans-serif &quot;> font-family: courier, monospace
  11. 11. Images Use 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=&quot;Percy the cat.&quot; alt=&quot;Giraffe in hiking gear.&quot;
  12. 12. Image size and the web Dialup (56k modem) = 56 kilo bits per second, not kilobytes! 56 kilobits = 7 kilobytes per second. So, a single 32KB image will take at least 4.5 seconds. &quot;Broadband&quot; starts at 256 kilobits (32KB per second) maximum. 1 megabit (1024 kilobits) broadband = 128KB per second max.
  13. 13. <ul><li>Image Compression </li></ul><ul><li>The 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. </li></ul><ul><li>There is a third format, PNG (Portable Network Graphic) browser support used to be limited but is now (with the exception of IE) good. </li></ul><ul><li>GIF </li></ul><ul><li>Allows single pixel transparency. </li></ul><ul><li>Suitable for flat colour images. </li></ul><ul><li>Can be used for animations. </li></ul>
  14. 14. <ul><li>JPEG (JPG) </li></ul><ul><li>24 bit RGB information. </li></ul><ul><li>Suitable for material such as photographs and other continuous tone images. </li></ul><ul><li>Not suitable for graphics with large areas of flat colour, as these will become blotchy. </li></ul><ul><li>PNG </li></ul><ul><li>PNG offers multiple transparency options. </li></ul><ul><ul><li>Single pixel transparency (like GIF). </li></ul></ul><ul><ul><li>Alpha channel transparency (levels of opacity). </li></ul></ul><ul><li>Although most modern browsers support all PNG features, Internet Explorer doesn't support alpha-channel transparency in versions up to and including 6. </li></ul>
  15. 15. Comparison - photos jpg 2.8KB gif 2.3KB png 5.1KB
  16. 16. Comparison - drawn images jpg 1.7KB gif 3.3KB png 3.1KB
  17. 17. Standards <ul><li>Any professional worth their salt has a good understanding of the standards of their trade. Web developers are no different. </li></ul><ul><li>HTML standards: </li></ul><ul><ul><li>- HTML 4.01 Transitional/Frameset/Strict </li></ul></ul><ul><ul><li>XHTML 1.0 Transitional/Frameset/Strict </li></ul></ul><ul><ul><li>XHTML 1.1 </li></ul></ul><ul><li>Use the right doctype for your code. </li></ul><ul><li><!Doctype HTML Public “-//W3C//DTD HTML 4.01 Transitional//EN”> </li></ul><ul><li><!Doctype HTML Public “-//W3C//DTD HTML 4.01//EN”> </li></ul>
  18. 18. <ul><li>Validation </li></ul><ul><li>Use a validation tool like the W3C's HTML validator </li></ul><ul><li>Be aware that they can't check everything. You need to manually verify your code too. Validation tools won't check: </li></ul><ul><ul><li>Some values inside quotation marks. E.g.: </li></ul></ul><ul><ul><li><img src=&quot;test.jpg&quot; alt=&quot;&quot; width=&quot;banana&quot; height=&quot;rabbit&quot;> </li></ul></ul><ul><ul><li>will pass in online validators. </li></ul></ul><ul><ul><li>How sensible and/or efficient your code is. </li></ul></ul>
  19. 19. Spelling and grammar Nothing suggests a sloppy attitude quite like failing to take the time to proof read the content of your pages.
  20. 20. Don’t forget the text in your <title> , alt , etc. Use a spell checker to help, but don’t rely on it alone.
  21. 21. Testing Check 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.
  22. 22. Involvement Keep 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/ )
  23. 23. 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 Robinson Contributing Writer and Former Editor In Chief of Digital Web Magazine.
  24. 24. Plagiarism The 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.
  25. 25. <ul><li>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. </li></ul><ul><li>http://en.wikipedia.org/wiki/Plagiarism </li></ul><ul><li>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). </li></ul><ul><li>http://en.wikipedia.org/wiki/Wikipedia:Copyrights </li></ul>
  26. 26. 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.”
  27. 27. Copyright Infringement The unauthorised use of copyrighted material. It is illegal to use copyright material without the owners permission. Assume copyright until informed otherwise.
  28. 29. Copyright and education The 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
  29. 30. Additional recommended site: The Web Standards Project: http://www.webstandards.org/