Exceptions


What are your best practices when it comes to exceptions?

Do you always log them?

In the past, I have stuck with the advice of Joshua Bloch.  Exceptions are for exceptional situations.  It is Item 39 in his great work Effective Java: Programming Language Guide. If it’s not exceptional and you expect the condition to happen sometimes; use an if.. else block.

Also, stick to the out-of-the-box exceptions as much as possible and create your own exceptions only when you need to.

Exceptions are a great way to communicate the contract of a method if you’re writing an API or client library.  But if you’re writing a code in a small team, does it really help to throw exceptions all over the place?

I think it does in certain situations.  For example, if your team is writing a layered architecture app; then each layer would benefit from throwing exceptions to the layer above it that depends on it.  Within the layer I don’t think it buys you much.  But from the data layer to the business logic layer and then to the presentation layer; a lot of meaning can be translated through exceptions.  Plus, these layers are usually written by different people and in parallel.  Exceptions help the other developers know what to expect from the methods they call in these lower layers.

Please comment with your exception best practices!

Software Education in the 21st century


It is unfortunate that today’s software practitioners are put at such a disadvantage by spending four years of their lives studying things that are totally irrelevant to creating software (i.e. a BS in Computer Science).  I have yet to use any calculus in my career.  Discrete Mathematics was also a total waste of time.  P = NP is nifty, but not really relevant to my profession.

That is why there is such a brazen turn against the term software engineering.  This is where things such as the Agile Manifesto come from.  It is the pent-up frustration of software developers finally saying “ENOUGH”!  I want to get things done, I don’t feel like studying so much theory that I forget why I started Computer Science in the first place.

This era in time is analoguous to the late 1800’s in which established universities such as Harvard, et. al. were still teaching Latin and other useless subjects.  What came out of this was MIT, all the A & M schools, Virginia Tech, Texas Tech, etc.  Universities that actually prepared there graduates for the real world.

The big universities are so large that they cannot be turned quickly and today’s software profession changes every month.  A new model of education needs to be developed lest these big university programs are replaced.  There is a vacuum right now for certifying and educating software developers.  Either universities need to change, and change quickly, or the industry will find another way.   But time is running out….

What is Software Engineering’s Greatest Achievement?


As I was trying to define engineering tonight; I was struck by this part in the Wikipedia article on the subject:

The Pharos of Alexandria, the pyramids in Egypt, the Hanging Gardens of Babylon, the Acropolis and the Parthenon in Greece, the Roman aqueducts, Via Appia and the Colosseum, Teotihuacán and the cities and pyramids of the Mayan, Inca and Aztec Empires, the Great Wall of China, the Buddhist Stupa and Yoda Canal in Sri Lanka, among many others, stand as a testament to the ingenuity and skill of the ancient civil and military engineers.

What is software engineering’s great achievement that will be looked upon 500-1000 years from now with awe?  At first I thought the Internet, but that is really not all software engineering.  It’s mostly electrical and network engineering.  But, the World Wide Web is software!  And it runs on the Internet.  A little research brought up the initial proposal for the World Wide Web written by Sir Tim Berners-Lee and R. Cailliau.  It almost gives me goose bumps to read it.  He does a requirements analysis of the WWW for crying out loud.  His description of the architecture takes about five sentences!  But the best part, at least in terms of showing that the WWW is a result of software engineering, is that he asks for 4 software engineers and a programmer in his proposal!!!  Take a look at history in the making….

A great example of a Software Project Management Plan


In the Fall of 2006, I took “Software Project Management” at George Mason University and produced this plan with a group of three great software engineers (Matt Henry, Lina Ciarleglio, and Tuyen Dam).  This is definitely not agile and kind of the “old school” way of doing things, but I’m still very proud of our accomplishment.

The Automated Weapons Accountability and Tracking System (AWATS) Software Project Management Plan

Note: At 241 pages, it is rather large… in fact the longest document I have produced to date (of course I didn’t do it alone 🙂