I found keyboard layout switching to be too much friction.
I am programming in English and writing in English and German. What I use now is the UK international layout with dead keys. Plus compose key bindings for less frequently used symbols like € or °. This allows me to keep the same layout everywhere, which makes my life easier - and typing faster.