Maybe possible to write code with some work, but it will feel awful due to the high latency of cloud speech recognition and weird behavior of using a natural language model.
You should use Talon or Dragonfly if you want to edit code. Both have fast offline recognition available.