Why are homepage examples too complicated?

Benjiro via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 17 12:39:14 PDT 2016


On Thursday, 13 October 2016 at 19:06:26 UTC, Karabuta wrote:
> How is a new visitor supposed to know "!" is for templates and 
> not some complicated syntax?

As a dlang newbie ( only started to learn a few days ago ), the 
example on the front page is just complex for new users.

Its not a lack of knowledge ( 15+ years php, some C in high 
school,  Perl 3 years and some other languages over the years ) 
but i had no clue that "!" ( used a lot in examples ) is actually 
templates ( or macro's ). I was focused on other parts ( shared 
libraries creation & loading etc ) so never got around to some of 
the "basics". Just assumed it was a operator.

Also, first example using regex? And the overuse of one-liners. 
Lets not start with so much one liners / merged lines, it makes 
something simple look more complex. Its great for more seasoned 
programmers but its less readable for people with little or first 
time experience.

Another issue is the "Edit/Args/Input/Run". First thing a person 
does is press "Run" but then your wondering, wait? What is that 
result? Where does it come from? Lost 20 seconds figuring out 
where it was hiding.

My suggestions:

A. Remove Args, Remove Input ( reworked / make any input inline 
in the code ). Simple is better.

B. Use multiple examples. Place buttons below instead of 
Args/Input [1 2 3 .. 8 Run].

Examples:

1. Hello World
2. ...
3. Templates
4. This Regex example ( reworked for inline input )
5. C/C++ Integration example
6. ...
... Show parts of the language its advantages. Its like drugs. 
Give people a taste and get them hooked for life. >:)

Just my 2 cents on the topic.


More information about the Digitalmars-d mailing list