> When you say "I abstract it in a function" that's surely what a mathematician is doing
In principle, yes.
In practice, I can right-click on any such function and get to see its source (edit: instantly, automatically) whenever I need it. That doesn't work at all with math papers.
EDIT: Furthermore, when writing about something where bubble sort is used, for the general audience, I would simply link to an explanation of what it is, visualization of how it works and an example code, so that anyone who doesn't know it can quickly get up to speed with it, then I'd explain how exactly that sorting method fits with the rest of topic.
In maths, papers are devoid of any links, the teaching materials are up to 50 years old and never updated to take advantage of new presentation techniques, authors frequently name-drop some algorithm and then forget to say what parameters they used or how exactly it connects with preceding and following paragraphs. It's really bad from UX point of view. That's why sites like BetterExplained are so important.
EDIT2: so, in short, I'd do everything I could - without spending huge amounts of time on it - to make the article as accessible and easy to follow as possible and to make it useful even if someone is not able to understand it whole. I'd really like to see mathematicians to at least try doing the same.