Medium’s code block feature begs the question: Has anyone at Medium ever seen a code block?
--
I haven’t written in a while but today I felt inspired to share a tutorial about a niche and hard-to-find-info-on problem I encountered at work and share my newly found knowledge with other developers. I started writing and noticed a new feature (or so I thought) on the + menu: an option to add a new code block.
This is the first time I took notice of this option in the menu (I’m more of a CodePen person anyway) so I thought “Wow, a new feature let’s try this out”.
It’s fair to say the feature falls flat. It’s better than plain text, and it allows readers to copy and paste so its better than a screenshot — but its worse than literally ever other option available.
function myFunction() {
console.log("Hello world");
}
// Function call
myFunction();
Upon looking back at old articles, I discovered I had actually used this feature before (by using cmd + option + 6), except I thought it was just a way to offset a block of text or add emphasis — because that’s really all it does. It’s lacking even the most basic of features such as line numbers or coloured comments and key words.
Dear Medium, Here’s what we want instead:
1. Coloured keywords, variables, and function names.
Something about reading code thats all in one colour fatigues my eyes and brain so fast. It makes it difficult to quickly scan the code in the way that developers are used to doing in an editor.
2. Numbered lines.
So easy to implement too. Just make sure that the numbers are not copyable so readers can cut and paste the code snippets easily.
3. Light and dark mode.
Easy to implement and writers can customize to their preference. Maybe make the toggle available to readers as well.