The issue with D...

Jordan Wilson wilsonjord at gmail.com
Thu Feb 7 21:27:47 UTC 2019


On Thursday, 7 February 2019 at 20:49:31 UTC, Ecstatic Coder 
wrote:
> 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:
>>> [...]
>>
>> 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.

Is it pure cosmetics? I thought the whole point of the dub 
comment was so that you could just run "dub server.d" and it 
would just work?

In your super simple example, it won't just work, you need to do 
to the whole dub fetch/build thing. Not saying it's a bad thing, 
but we are talking about first impressions, and I can see 
pros/cons to both approaches.

Jordan





More information about the Digitalmars-d mailing list