cross-posted from: https://lemmy.stad.social/post/22011
“The areas of the MD network that were activated by reading code weren’t the parts called on for maths, leaving an open question as to whether programming should be taught as a maths-based skill or a language-based skill.”
They tested with Python, so this doesn’t really surprise me. I suspect strongly my own experience that testing with Python both under-estimates the language involvement vs. more linguistically expressive languages but also significantly under-estimates the maths involvement relative to more formal languages, especially function and array languages. There’s a marked separation between developers who see maths as essential to programming vs. those who see it as a language thing.
That they recruited from MIT, Tufts and immediate surroundings may well also affect their results.
Would be interesting to see a broader study.

In the case of your example we’d do
.map(&:unwrap)in Ruby (if unwrap was a method we’d actually want to call)Notably, these are not the cases
_1and_2etc are for. They are there for the cases that are not structurally “call this method on the single argument to the block” e.g..map{ _1 + _2 }or.map { x.foo(_1) }(
_1is reasonable, because iterating over an enumerable sequence makes it obvious what it is;_1and_2combined is often reasonable, because e.g. if we iterate over a key, value enumerable, such as what you get from enumerating aHash, it’s obvious what you get; if you find yourself using_3or above, you’re turning to the dark side and should rethink your entire life)