A subcutaneous cardiac device includes two electrodes and a stimulator that generates a pulse to the electrodes. The electrodes are implanted between the skin and the rib cage of the patient and are adapted to generate an electric field corresponding to the pulse, the electric field having a substantially uniform voltage gradient as it passes through the heart. The shapes, sizes, positions and structures of the electrodes are selected to optimize the voltage gradient of the electric field, and to minimize the energy dissipated by the electric field outside the heart. More specifically, the electrodes have contact surfaces that contact the patient tissues, said contact surfaces having a total contact area of less than 100 cm2. In one embodiment, one or both electrodes are physically separated from the stimulator. In another embodiment a unitary housing holds the both electrodes and the stimulator. Sensor circuitry may also includes in the stimulator for detecting intrinsic cardiac activity through the same electrodes.