On Tuesday, 18 October 2016 at 10:04:35 UTC, Benjiro wrote:
The issue is, that in order to understand the example, you are
already required to have a knowledge of the language.
I can only use myself as a example. Only started to really use
D a few days ago because i have a specific project. I instantly
look for the methods that interest me, totally bypassing half
the manual. The ! looked like a operator and not a template.
To show you how much a nice example flow matters: a month or 3
ago ( because of this future project ) i started to look at
several languages: Go, Nim, Haxe, etc...
The example on the start page even says what it's doing and
other languages, will more or less understand it:
// Replace anything that looks like a real
// number with the rounded equivalent.
.map!(l => l.replaceAll!(c => c.hit.round)
People are increasingly looking for this type of thing. I for my
also has `map` and `filter`, which was a good addition to the
If you want basic code and step by step examples, go to "Learn",
which is what I do when I look at other languages. "Getting
started", "Learn", "Tutorial", whatever.
Although the first impression counts, I don't wholly subscribe to
the "2 seconds" attention span thing. If you're seriously
interested in finding a good tool (i.e. a programming language)
for your purposes, then you have to invest more than a few
minutes anyway, regardless. As to Nim and Haxe, you have to spend
some time on the respective pages to get to useful stuff (like
language features etc.) - as on any other homepage, so I don't
see your point there.
Also, as I've already said, people might look for stuff like
`stdin.byLine...` and if they don't find it may think "Just
another C-clone, boring". I bet you a pint that people would post
here complaining that we didn't show them stuff like `map!(a =>
).filter...` on the start page.
tl;dr: You have to invest time in learning how to use a new tool
anyway. The example on the start page should not be the main
argument for or against a language.