Why are homepage examples too complicated?

Benjiro via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 18 03:04:35 PDT 2016


On Tuesday, 18 October 2016 at 09:26:56 UTC, Chris wrote:
> I think the point of the examples is to show D at its most 
> expressive/concise. The thing is that if you presented "Hello, 
> world!" a lot of people who come from other languages would 
> complain about how D doesn't seem to have chaining, mapping, 
> templates etc. and that the examples are too easy, blah blah. 
> We've had loads of discussions about this.
>
> Also, it's good to show people how D code should look like 
> right from the start. Whenever I (have to) learn a new 
> language, I look immediately at the best practices trying to 
> avoid awkward code.

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...

Notice something missing? Yes... i knew about D but totally 
skipped it for two reasons. Its the same reasons as to why Rust 
got skipped. I did not like the syntax example's. And in case of 
D, the whole community issue with D1 vs D2 in several reddit 
topics that still gets propagated.

* Started with Go. Hated it.
* Tried Nim. Not bad but lacking in community, only one real core 
developer.
* Crystal. Not bad again but too much Ruby style focused. Still 
very young project.
* Haxe. Lots of options for multi platform ( GUI/Gaming/etc ) but 
very bad support for what i needed specifically ( not without 
going with Cppia or neko = massive performance hit compared to 
pure C/C++ ).

* D ... Frankly, D for me was: "why the hell not give it a try, i 
am running out of languages".

And withing 10 minutes i found the solution for what i needed. 
And been playing around with that. And spend hours playing all 
the DCon2016 youtube video's ( so much material to see ) etc...

The example on the front page, simple scared me away at first, 
because its so much "Perl all over again". One liner hell, with 
unknown "operators".

The moment you start working with D, its more: Hey, this is 
actually C/C++ style but with enhancements. But the example on 
the front page ( and several more on the net, focus on more 
advanced solutions and looked too much specialized ).

I can not stress this enough but as a new user that has been 
shopping around, D really scared me away at first because of the 
two mentioned points.

Maybe its just me OCD as a web developer but if you can not 
convince me in a few seconds after opening your website, i simply 
look at other websites first. Think of developers as consumers. 
If you can not convince them to stay and look deeper within 
seconds, you lose out on "converts".

Simple examples:

http://nim-lang.org/
-> Withing a few slides you go from simple to more advanced 
examples. But you already get a good feel about the language.

https://crystal-lang.org/
-> Ooo, nice ... only a few lines to get a http server started. 
Nice ...

https://haxe.org/
-> Again ... a simple example that shows the language. Not the 
advanced features.

That is also the reason why i mentioned: Start with a simple ( 
does not need to be "Hello world" ) example but allow more 
examples to show the real power. But do not start with more power 
examples with one-liners and templates ( what nobody knows ) as 
the first impression because people make up there mind within 
seconds.

Its the only real big criticism on the whole D website. For the 
rest its actually very good. The Learn is good but please remove 
the EYE button on the right side next to "run", it changes the 
layout / removes the code, its confusing. Simple is better.


More information about the Digitalmars-d mailing list