{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture9_2up - Object Oriented Software Engineering...

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
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... }
Image of page 11

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

View Full Document Right Arrow Icon
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.
Image of page 12
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. 2. Pepper the code with comments like /* add 1 to i */ however, never document wooly stuff like the overall purpose of the package or method. 3. Make sure that every method does a little bit more (or less) than its name suggests.
Image of page 13

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

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern