Lecture9_2up - O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 481 Documenting Conventions Lecture 9 O b j e c t O r i e n t e d

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 481 Documenting Conventions Lecture 9 January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 501 Javadoc /** * Class description goes here. * * @version 1.82 18 Mar 1999 * @author Firstname Lastname */ public class Blah extends SomeClass { /* A class implementation comment can go here. */ /** classVar1 documentation comment */ public static int classVar1; /** * classVar2 documentation comment that happens to be * more than one line long */ private static Object classVar2; January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 502 Javadoc /** instanceVar1 documentation comment */ public Object instanceVar1; /** instanceVar2 documentation comment */ protected int instanceVar2; /** instanceVar3 documentation comment */ private Object instanceVar3; /** * ...constructor Blah documentation comment... */ public Blah() { // ...implementation goes here... } January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 503 Javadoc /** * ...method doSomething documentation comment... */ public void doSomething() { // ...implementation goes here... } /** * ...method doSomethingElse documentation comment... * @param someParam description */ public void doSomethingElse(Object someParam) { // ...implementation goes here... } } January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 504 How To Write Unmaintainable Code Last updated Saturday, 12-Feb-2000 11:06:30 PDT Roedy Green ©1997-2000 Canadian Mind Products. January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 505 How To Write Unmaintainable Code General Principles To foil the maintenance programmer, you have to understand how he thinks. He has your giant program. He has no time to read it all, much less understand it. He wants to rapidly find the place to make his change, make it and get out and have no unexpected side effects from the change. He views your code through a tube taken from the center of a roll of toilet paper. He can only see a tiny piece of your program at a time. You want to make sure he can never get the big picture from doing that. You want to make it as hard as possible for him to find the code he is looking for. But even more important, you want to make it as awkward as possible for him to safely ignore anything. You might get the idea that every language feature makes code unmaintainable -- not so, only if properly misused. January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 506 How To Write Unmaintainable Code Specific Techniques 1. Lie in the comments. You don't have to actively lie, just fail to keep comments as up to date with the code....
View Full Document

This note was uploaded on 02/23/2012 for the course CS 307 taught by Professor Staff during the Summer '08 term at Purdue University-West Lafayette.

Page1 / 19

Lecture9_2up - O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 481 Documenting Conventions Lecture 9 O b j e c t O r i e n t e d

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online