I don't write it there. I utilize 'ambient thought'.
What I rather do is look at difficult code before the commute. My brain will subconsciously work it out. However in this period, you can't think about other things - no looking at your phone or checking out people on the train.