Thursday, July 13, 2006

General Software Development guidelines …
  • The "why didn't that work" mindset will uncover numerous design bugs.
  • Avoid coding for speculation.
  • Use "Get it to work and the get to work fast" principle.
  • Learn design patterns.
  • Buggy is better than delayed code.
  • Use Risk Factor Analysis mechanism to come up with estimates.
  • Use Functional diagrams, data flow diagrams.
  • Work towards rapid quality work.
  • Solve risky elements first.
  • GAIN EXPERTISE OVER JAVA DEBUGGER.
  • All developers must master art of unit testing.
  • Learn and gain expertise over Execution Profilers.
  • Learn about the kind of mistakes that you tend to commit.
  • Learn completely about your program.
  • Coding should be 20% max of your overall development process.
  • Unit Testing should be 30% of your overall development process.
  • Your comments = 200% of actual source code.
  • Use JavaDocs to communicate information.
  • Learn one text editor and use it for everything.
  • Use version tracking software for all projects small or big.
  • Instead of excuses, provide options … Refactoring needed? Prototyping needed? Write easy to test code? Automation needed? Ask for help?
  • Don't live with "Broken Window" (bad design, wrong decisions, or poor code)
Code Writing Guidelines …
  • Use code generators as much as possible. They increase productivity & reduce bugs.
  • Overparenthesize for clarity.
  • Always use <= or >= instead of ==.
  • Is your code easy to read. It will become important when you are debugging.
  • Strive for perfection in your code.
  • Use sorry/please in your error messages.
Code Implementation Guidelines …
  • Maintainable should be preferred over lean code.
  • If you have switch statement in your code, consider using polymorphism.
  • When you start having long parameter list, replace it with objects whole methods give the parameters data.
  • Emit good error messages.
  • Instrument cockpit instruments in your code.
  • Write code in First, Last, Middle sequence.
  • Comment first, code later.
  • Focus & gain expertise on the core Java classes(Collections, String)
  • Stick to known subset.
  • Use ArrayList versus Vectors. Why? Because Vectors are synchronized. And many a times if don't need synchronization, you are better off using ArrayList.
  • Use best algorithm.
  • Use simple, clear algorithms.
  • Optimize slowests methods 1st.
Object Oriented Design Heuristics ...
  • All data in a class should be hidden.
  • Classes should not be dependent on its users.
  • Minimize number of methods in your class.
  • Keep class hierarchy as horizontal as possible.
  • Do not have god classes/objects.
  • Watchout for classes with too many accessor methods(how much is too many? 10, 20?). TW this can also indicate that objects are not collected together.
  • Model real world as much as possible. (This helps the person who is going to maintain your code to understand it.)
  • Eliminate irrelevant classes.
  • Do not convert operations into classes (e.g. IOReader etc)
  • Containment/inheritance should be limited to 6 classes(number of classes items a person an store in his short term memory).
  • If two or more classes share common data but no methods then the common data should be encapsulated in some new class which can be contained by these classes.
  • When registrations are all over the places, try to get them together by using some utility/helper classes.
  • Encapsulate data.
  • Keep the methods to minimum.
Bad Smells In The Code ...
  • Too much of duplicated code.
  • Long methods.
  • Unformatted code.
Debugging guidelines ...
  • Probe & integrate facts.
  • Maintain cheatsheet to investigate bugs.
  • A bug isolated is a bug squashed.
  • Find & eradicate bugs early in development cycle.
  • Consider finding bug as a good event.
  • Reward folks for finding bugs in your code.
  • Set better traps for bugs that hatch.
  • You can learn a lot by debugging by examining Jtest rules and how it implements them.
  • 1st -isolate it. Box it. Constrain it into smaller and smaller boxes until you can see it.
  • Use binary searches for isolating bugs. Put breakpoints at beginning/middle and end. Repeat.
Miscellaneous guidelines …
  • Remember output grows at rate of square root of team size.
  • Remember that if 5 can build a house in 1 month does not mean that 150 can build in one day.
  • Practise generating bugs by messing up the code.
  • Undertstand call stacks, for the 1st bug seen.
  • Incase of Exception handling, remember "subs before super" = "Subclasses before Superclasses"
  • Learn to love JavaDoc.
  • IDE's help reduce bugs.
  • "vi" can be fast bcos you don't have to move your hand for mouse.
  • Use QQQ to add bookmark to your code.
  • Read book "DeBugging Java", "Death March", "Code 2" and more ...
  • No set of metrics can rival informed human intuition.

Labels: , , ,

0 Comments:

Post a Comment

<< Home