The issue with D...

Ecstatic Coder ecstatic.coder at gmail.com
Thu Feb 7 20:49:31 UTC 2019


On Thursday, 7 February 2019 at 20:22:17 UTC, Seb wrote:
> On Thursday, 7 February 2019 at 18:18:16 UTC, Ecstatic Coder 
> wrote:
>>
>> Simple, easy and concise code.
>>
>> I'm VERY happy there is a web server example on D's landing 
>> page. I mean it.
>>
>> But removing this sort of "garbage" comment, as useful as it 
>> is, would probably make the example more pleasant to read for 
>> people evaluating the interest of using D for their next 
>> personal/professionnal project...
>
> Do you mind if I ask how the current example is dark magic for 
> you?
> How would you/we make it better?

Stupid simple :

void main()
{
     import vibe.d;
     listenHTTP(":8080", (req, res) {
         res.writeBody("Hello, World: " ~ req.path);
     });
     runApplication();
}

Not stupid simple :

#!/usr/bin/env dub
/+ dub.sdl:
name "hello_vibed"
dependency "vibe-d" version="~>0.8.0"
+/
void main()
{
     import vibe.d;
     listenHTTP(":8080", (req, res) {
         res.writeBody("Hello, World: " ~ req.path);
     });
     runApplication();
}

It's just pure cosmetics. But as with everything, "how it looks" 
is something that matter.

If I arrive at a professional IT appointment with my customer 
with a three day beard and my jogging clothes, he won't judge me 
the same as if I'm shaved and with my suit and tie.

When you are evaluating a programming language, the first lines 
of code you see give you a good or bad impression about it. And 
in all matters it's always better to give a good impression from 
the start.

I guess some people are very fond of cryptic languages with 
esoteric syntaxes, etc. But honestly I'm not sure it's the norm, 
and that most people dislike simple, crystal clear code.



More information about the Digitalmars-d mailing list