Context switching is, of course bad. But the size of human working memory is quite limited so for fields where you have to operate on lots of data some context switching is inevitable.
Also consider the cost, from two perspectives.
First, it used to be that if some piece of needed data wasn’t in your memory, you had to (in the best case) get up, walk to the bookshelf, take the book, page through it to find the data, and then resume. In the worst case you had to go to the library or even send for the book or the paper you needed. That’s a pretty major context switch. Nowadays, you bring up another window on the same screen you’re sitting before, type a few words, and get your answer in a couple of seconds. That’s a considerably less disruptive context switch.
Second, memory is adaptive and works like a cache. If you find yourself constantly looking up the same things, they will stick in your memory and you won’t have to look them up any more. The context-switching issues will become less prevalent as you go along. When you try to pre-memorize everything you might need, you spend a great deal of resources (time, attention, will, etc.) to populate your memory-cache beforehand. Is this a good idea? I think it depends—sometimes yes, sometimes no. You will forget what you’re not using anyway.
To prevent context switching. Context switching in humans is bad.
(This is also why we teach people how to add, subtract, and multiply small numbers together.)
Context switching is, of course bad. But the size of human working memory is quite limited so for fields where you have to operate on lots of data some context switching is inevitable.
Also consider the cost, from two perspectives.
First, it used to be that if some piece of needed data wasn’t in your memory, you had to (in the best case) get up, walk to the bookshelf, take the book, page through it to find the data, and then resume. In the worst case you had to go to the library or even send for the book or the paper you needed. That’s a pretty major context switch. Nowadays, you bring up another window on the same screen you’re sitting before, type a few words, and get your answer in a couple of seconds. That’s a considerably less disruptive context switch.
Second, memory is adaptive and works like a cache. If you find yourself constantly looking up the same things, they will stick in your memory and you won’t have to look them up any more. The context-switching issues will become less prevalent as you go along. When you try to pre-memorize everything you might need, you spend a great deal of resources (time, attention, will, etc.) to populate your memory-cache beforehand. Is this a good idea? I think it depends—sometimes yes, sometimes no. You will forget what you’re not using anyway.