Java: Development Process
Software development can be looked at from two perspectives process and product. Process is how you go about writing programs. Product is about the programming structures themselves (types, statements, classes, ...). Most programming books, as well as these notes, are concerned primarily with the product, eg, how to write a loop in a specific programming language. To be successful, you need to know all the product information, but you also have to master the process of software development, which is largely self-taught.
There are basic program development techniques which make program development much easier, and which are used by professional programmers for maximum effectiveness.
"The longest journey starts with a single step" - Chairman Mao
The following is advocated by many top developers. It's really effective in producing programs not only faster, but with better quality.
- Start small - Start with a small working program. It doesn't have to do what you want, but it will get you started along the path of incremental development. See Start with a working program.
- Incremental development - Starting with a small program, make a very small change toward your goal. Compile it and test it. When it works repeat the process with another small change. Also called Iterative Programming. See Iterative/Incremental Development.
- KISS. Keep it Simple Stupid. Simplicity is a great virtue in software. There's a huge amount of writing on the virtues of simplicity. [TODO: Put some links in here.] Joel Spolsky has another take on it at Simplicity.
- YAGNI. You Ain't Gonna Need It (or You Aren't Going to Need It in standard English)
is the principle of never adding a feature unless it's really needed.
Don't add a feature because it's easy, cool, or whatever.
The reason is that there are lots of hidden costs associated with
anything you add.
- The Wikipedia article, You Ain't Gonna Need It lists this costs quite nicely.
- Some amusing little Gedanken conversations illustrate the YAGNI principle quite clearly at the XP site (originators of the phrase I believe). You Arent Gonna Need It. The introduction is followed by many well-stated opinions on YAGNI - mostly positive, but with some dissent.
More simple techniques
- Pair programming - Work with someone else.
- Use good coding practices - Be scrupulous about naming and indentation. See Java Coding Standards.
- Know your tools - Choose good tools (editor, IDE, ...) and learn them well.
Intermediate techniques
As time goes on, you will want to do some of the following.
- Save your programs -- you may be able to use them as the nucleus for another program.
- Create you own library. When you write a good general class or method, add it to this library.
- Refactor (rewrite) parts of a program if you realize there is a better way. A better written program will be less likely to have bugs and will be easier to extend for the next iteration.
- Use an IDE (Integrated Development Environment), eg, NetBeans, Eclipse, or JBuilder (see IDEs. A Java IDE requires learning, and therefore may not be a good choice for beginning programmers. However, after you are comfortable developing simple Java programs with a text editor and the JDK, the advantages of an IDE for creating user interfaces and debugging can be significant. As with all tools, learn to use it well. Check the menus for options that might be useful.
- Code Coverage. [Needs more]
- See http://homepage.mac.com/hey.you/lessons.html, Tony Obermeit on Code Coverage Lessons.
Best Practices
In any field the most effective techniques become enshrined as Best Practices. There are lots of good books (and lots that aren't good!). Here are some that I've found very good, and all of them are very readable, even enjoyable!
- Code Complete second edition by Steve McConnell, Microsoft Press, 2004. Don't be put off by this being a Microsoft book. It's full of wonderful coding and process advice that you can use after your first programming course.
- The Pragmatic Programmer by Andrew Hunt and David Thomas, Addison-Wesley, 2000. Filled with good product and process advice for the intermediate+ programmer.
- Rapid Development by Steve McConnell again, Microsoft Press, 1996. This is still great, tho it could use a little updating in view of some "agile" development methodologies like Extreme Programming. This is filled with facts that everyone who works on or manages a major software development should read.
- Here's a nice blog entry I ran across.
Here are a few things I have learned about programming computers, in no particular order. I didn't invent any of them, and I don�t always follow them. But since nobody seems to know very much about making good software, it makes sense to try to distill a little wisdom when possible.