return
// Start by generating all dates for the given year
datesInYear(year)
// Group them by month
.byMonth()
// Group the months into horizontal rows
.chunks(monthsPerRow)
// Format each row
.map!(r =>
// By formatting each month
r.formatMonths()
// Storing each month's formatting in a row buffer
.array()
// Horizontally pasting each respective month's lines together
.pasteBlocks(colSpacing)
.join("\n"))
// Insert a blank line between each row
.join("\n\n");
Much more readable than something like "(~R∊R∘.×R)/R←1↓ιR".
Is it more readable? I'm even less familiar with D than APL, and that D code only looks more readable to me right now because it's mostly comments.
Wouldn't adding 8 lines of comments help newcomers to APL, too? This seems like a rather unfair contest.
Familiarity counts for a lot. 25 years ago when my primary language was 6502 assembly, I would have said 20 pages of assembly code look more readable than either of these.
In the long run, though, in every field I've worked in, being able to turn 20 lines of code into 20 characters has turned out to be a huge benefit. Once you familiarize yourself with the vocabulary, you can operate at a higher level. Nobody fears concise names and symbols when it's in a context they understand. I think even the most APL-phobic would admit that "a←b+c" is more readable than "assign(a,sum(b,c))".
Everything you know how to read, and peppered with comments you know how to read is more readable than everything you don't, without such helper devices.
Also related is range-based programming. https://wiki.dlang.org/Component_programming_with_ranges
Much more readable than something like "(~R∊R∘.×R)/R←1↓ιR".