r/computerscience • • Oct 23 '26

What if brain surgery affected your ability to code?

Imagine we need brain surgery to remove a tumor. The surgery goes well, but afterward, you struggle to write or understand code. Scary, right?

We know that neurosurgeons try to preserve important abilities like speaking and moving during brain surgery. But what about programming?

A new study in Human Brain Mapping explores exactly this!

The researchers developed a new protocol during awake brain surgery to help identify and preserve brain areas involved in programming.

The idea is simple: if coding is an important part of someone's life, shouldn't we try to preserve that ability too?

Here's the paper: https://doi.org/10.1002/hbm.70634

46 Upvotes

20 comments sorted by

64

u/Gman325 Oct 23 '26 • Bravo

"You're never the same once air touches the brain."

There is simply no getting around that.

22

u/apnorton Devops Engineer | Post-quantum crypto grad student Oct 23 '26

Heh. I was one of the test subjects in one of the fMRI studies you've cited!

4

u/[deleted] Oct 23 '26

[removed] — view removed comment

8

u/apnorton Devops Engineer | Post-quantum crypto grad student Oct 23 '26

So they scanned your brain and now you still know how to code?

To be totally clear, the study I was in was just scanning individual's brains to try to map coding-related tasks to brain regions; there was no surgery or anything that would have created a possibility of me losing my ability to code

What was it like doing coding tasks inside the scanner, did you have to solve problems with just your eyes or something?

The scanner I was in had a little screen in it that was visible from where I was. (In hindsight, I'm really curious about the tech involved to display an image inside such a strong magnetic field, lol.) They were aiming to compare what centers lit up when doing prose-review tasks as opposed to code-review tasks; it's been many years so I forget exactly the nature of the tests, but it was something like "here are two pieces of code; which one does [english description]?"

I had something like an iClicker with buttons on it to enable responding to the multiple choice questions without having to speak or move anything near my head.

All in all, pretty cool experience. It's not often you get to say "I had an fMRI for free and there was never any concern that something could be wrong with me." :)

1

u/IgnotiusPartong Oct 23 '26

I assume the display was either a mirror or optic fiber tubes. I cant imagine any electronics working there at all.

1

u/Thelmholtz Oct 23 '26

The bare minimum electronics to operate the machine work within that field, I guess they are just located outside where it's strongest. AFAIK LCDs are mostly safe around magnets (I remember cathode ray TV's would get pretty fucked up by those, guessing it affected the coating)

1

u/Yoghurt42 Oct 24 '26

No, it affected the electron ray. CRTs use magnetic fields to direct it, after all. Remember: cathode ray = electron beam

1

u/Thelmholtz Oct 24 '26

But then what I don't understand is how was the damage permanent? One would expect the beams to get back to their original trajectory once you removed the external magnetic field, but this was definitely not the case as my parents so kindly reminded me.

2

u/Yoghurt42 Oct 24 '26 edited Oct 24 '26

The shadow mask (and metal frame) inside the CRT got magnetized themselves.

Focusing the electron beam is so delicate that just rotating the CRT normally would cause distortion due to earth's magnetic field magnetizing the metal inside a bit. That's why CRTs had a demagnetizing coil that triggers when you turn it on.

If the outer magnetic field was too strong, the shadow mask could become too magnetized for the demagnetizing coil to handle.

2

u/Thelmholtz Oct 24 '26

Thanks, TIL

1

u/johny_james Oct 25 '26

I'm always curious how are these machines designed, are they specific with some monitor inside?

8

u/rebelhead Oct 23 '26

One could always go into tech sales. Kidding/not kidding.

5

u/SUP_CHUMP Oct 24 '26

I had brain surgery and coding is definitely harder after but so are most things. Harder for me to read and think critically. I also tend to try to work fast to make up for this which causes me stress which doesn’t help at all lol.

4

u/N3wAfrikanN0body Oct 23 '26 edited Oct 23 '26

Depends on the continuous care after the procedure. 

Fortunately, there are teams consisting of physical, occupational and speech therapists; nurses, pharmacists and GPs who will take that into consideration for your life. 

3

u/lolercoptercrash Oct 23 '26

So this is the only thing you post about ?

3

u/vplatt Oct 23 '26 edited Oct 24 '26

We already have this problem. The surgery was called "LLMs", and now there's a general issue with understanding code. 😅

Edit: Downvotes? I guess the truth hurts.

It's OK, y'all. I got you. I can take it. There, there. ..

1

u/vnagpal81 Oct 24 '26

I had a stroke in 2019 and after that I always have problems with conditions and boolean expressions in if statements

1

u/pohart Oct 25 '26

Well I was considering going into managing anyway...

1

u/odedbadt Oct 28 '26

Story of my life. Coder. Course of 13 yrs: three tumor resections, every time, coding ability degrades. Little by little...

-1

u/ivancea Oct 23 '26

I guess it depends on what you and your brain define by "coding". Nowadays specially, with agents taking care of most of it, it depends on what you lose. Do you lose your ability to understand code? To understand logic? To understand how to solve a problem? Architectural knowledge?

Every case has a different solution, and some don't really need fixing nowadays. It's obviously bad, as bad as losing any knowledge you previously had, but may not be a professional issue