In that case, switching employers may be what's needed, rather than switching careers (I know, easier said than done but easier if you already have a job). But if you do switch careers or have a career break, you can still code! If you're not maintaining a big project, working on your own side-projects is more like a hobby than work for most coders I know, so it wouldn't necessarily be incompatible with a break from the industry.