1. A nanotube switch, comprising: a first and second electrodes; a switching element having a predetermined pattern comprising a porous network of nanotubes wherein at least a first nanotube is in electrical communication with the first electrode and at least a second nanotube is in electrical communication with the second electrode; and a protective barrier to protect the switching element.