As a general rule of thumb, practicing Jews do not write the name God because of the laws delivered by Moses that are found in Deuteronomy 12:3-12:4. In this passage, the Jews are instructed to destroy anything and everything associated with their rival’s gods, and they are not to let this happen to their own God. Writing "G-d" instead of "God" is one way to prevent others from destroying the name of God.
Jews interpret the law given by Moses as a prohibition against transcribing the name of God because they feel that if the name is recorded onto a piece of paper, there is the possibility that it will be disrespected or destroyed in some way. The general concern with writing the name in its true form is that it might be erased, defaced by being crossed out or scribbled upon, torn, thrown in the trash, or ravaged in some other way. Writing "G-d" instead communicates the writer’s idea effectively, but since the word is incomplete, there is no risk of defacement. The Jews have other names for their creator, including Hashem, YHVH, Elohim, and El Shaddai, and these are also not written in their complete form.
There are, however, exceptions to the prohibition of writing "God." The Jews believe that, on occasion, it is acceptable to write "God" when there is no likelihood that the written word will be defaced. This includes the written form in the Torah, which is the Hebrew Bible, also found in the first five books of the Christian Bible. Writing the name is not prohibited when it is done carefully, with foresight and respect.
Due to the advent of technology that was not around when this law was written, the Jewish community, under careful deliberation, has decided that it is acceptable to write the name of God on a computer, as long as it is not printed to a permanent form. Rabbis have decided that deleting the name on a computer, though not encouraged, is not in violation of the commandment.