The Book!?


Well, maybe one day.
(Image courtesy of oreilly maker)

... to check that something exists, before trying to use it

Every developer should know to check that something exists before trying to use it.
Following on from the previous advice about not making assumptions about a file system. Be sure and extend your assumption checking beyond just the file system. Immediately that means files and their contents. But also think about: other programs; operating system components; peripheral devices; hardware components (ports, cards, etc.)



Why is this important?

Because at some point in the future, whatever your expecting to be there won't.
When that happens, one of the following is likely:

  • It will have no impact.
  • Part of the program won't work.
  • It will cause an error message to be displayed.
  • The program will crash.
  • The program will crash and will corrupt user data.
  • An important customer will be disappointed in your software and in you/your company.
  • You (or someone else in your company) will have to spend time with the user working out what went wrong and how to work around it.
  • You (or someone else in your company) will have to spend time updating the program so that it can deal with the missing element, to prevent customers having the same problem again in the future.
As a top class developer (or one in the making) I'm sure you can guess which are the most likley items in the above list and the ones you should focus on preventing.

What do you do once you know this?

Make sure you check!
You'll save yourself some support and your users some inconvenience by dealing with problems before they can happen.

... that different platforms have different requirements

Every developer should know that different platforms have different requirements.

It is important to understand the platform that you are developing for:
  • Developing for the desktop is different from developing for the web.

  • Developing for a device with a large screen is different from developing for a device with a small screen.

  • They are both different than a device with no screen.

  • An interface that will be navigated with a mouse or keyboard is different from one which will be navigated with a peripheral device, or thumbs!
When you start developing for a platform that you have not developed before and you don't understand the differences and nuances of that platform, you should not assume that it will be the same as other platforms you have developed for previously.


Remember, assumptions usually turn into bugs or the user not getting what the really need/want.

What do you do once you know this?

Make sure that you understand the platform you are developing for, particularly if it is new to you.

Don't assume that the way you've done things on other platforms is appropriate or even possible.

What do you think?
Is this something every developer should know? Have you say in the comments.