News for hackers. Stuff that matters.
Re:To the brain, reading computer code is not the same as re... by analog31 on Tuesday December 15, 2020 @09:28PM (#25438298)
The one thing I think is different about reading music is sight-reading, where you're reading it at speed while playing it. I can do that with music and text, but not computer code, even in a language that I'm super familiar with.
Re:To the brain, reading computer code is not the same as re... by wvenable on Wednesday December 16, 2020 @02:11AM (#25439900)
I can read a screen-full of code at time -- sort of like speed reading -- in most of the programming languages that I know.

It took me a while to realize that I was doing this; I only figured it out from when it doesn't work. I can't do it when I'm looking at code that's dark-themed if I normally work with that code light-themed. In that case I have to read the code line by line. It's actually a strange feeling.

Some of my environments are dark themed for certain languages/environments so it's not the dark-theme itself that throws me off but something about the unexpected visual difference.

Re:To the brain, reading computer code is not the same as re... by wtallis on Tuesday December 15, 2020 @09:51PM (#25438479)
I think the programming analog of sight reading might be following along with assembly language or other low-level or simple imperative code while mentally tracking basic stuff like register/variable usage and control flow. Sight reading music doesn't involve real-time analysis of the broader abstract structure of the piece. That's not really applicable to high-level code making heavy use of nested abstractions or non-imperative paradigms.
Re:To the brain, reading computer code is not the same as re... by analog31 on Tuesday December 15, 2020 @10:06PM (#25438583)
That's right. The level of analysis during sight-reading is along the lines of: "I hope I don't screw up in the next 500 milliseconds, and who's that person who just came in the front door?"
Re:To the brain, reading computer code is not the same as re... by Bob_LaBLahh on Tuesday December 15, 2020 @09:39PM (#25438387)
Yep. My hypothesis is that this is largely because code is non-linear whereas most written music is usually read in a linear fashion. Agree/disagree?
Re:To the brain, reading computer code is not the same as re... by analog31 on Tuesday December 15, 2020 @09:49PM (#25438467)
That seems plausible. Music is written to be read in that way. Writing and sight-reading are a sort of symbiosis. There are no subroutines or abstractions. And a good reader recognizes a lot of patterns by familiarity. There's stuff that goes straight from my eyes to my fingers while I'm thinking about something else. But if you write some completely random note pattern or rhythm (or both at the same time), I might be in trouble.
Re:To the brain, reading computer code is not the same as re... by sethhochberg on Tuesday December 15, 2020 @10:53PM (#25438852)
The pattern recognition (and muscle memory that comes with it) is a huge difference between sight-reading music and programming, IMO.

I'm sure if we tried hard enough we could come up with a pretty good analogy between data structures / algorithms and scales / arpeggios / etc... but I've never felt quite the same when recognizing a familiarish algorithm in code as I would when sight-reading some music and having my fingers perform the right kind of movements out of almost unconscious muscle memory.

Re:To the brain, reading computer code is not the same as re... by rubatuga on Tuesday December 15, 2020 @10:09PM (#25438597)
There are loops which could be considered subroutines. Also if else.