There is a machlokes between the Mechaber and the Gr”a as to what level of learning one is allowed to do before saying Bircas Hatorah:
The Mechaber says that Thinking is not like Speaking (Hirhur Lav Kidibur dami) therefore as long as one does not speak in Torah he does not have to say Bircas HaTorah. The Gr”a however says, even thinking is not allowed.
There is a story that is told about the Gr"a. (The Gr"a once went against his own psak and thought in Torah before saying Bircas Hatorah, because of this he forgot everything he ever learned ...)
Nevertheless we see that the Mechaber says in a few Sifim later that writing down Torah is not allowed! Earlier the Mechaber said that as long as one does not speak in Torah he does not have to recite Bircas HaTorah. We see now however that the Mechaber is contradicting himself by saying that if one writes Torah he is Chayiv in Bircas HaTorah, how can this be?
The answer is that these 2 comments by the Mechaber are not soter each other at all. According to his reasoning the reason for why a person would be chayiv in Bircas Hatorah once it has been spoken or written is because now it is available to the world. When Torah is being thought about however, the only one who it is available to is the thinker.
R' Gedalia Anemer Shlit"a talked about this (within the context of Shomea Kioneh) last Pesach in his Shabbos HaGadol Drasha. Often times we neglect the laws and rules of Shmiras HaLashon. When things are written we rationalize that because they never officially left our lips all is well and more. The truth is however, that when something is written it may be more available to the world then it could have been had it left your mouth.