The issue with D...

Ecstatic Coder ecstatic.coder at gmail.com
Fri Feb 8 12:09:20 UTC 2019


On Thursday, 7 February 2019 at 21:27:47 UTC, Jordan Wilson wrote:
> 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

I agree. I've already had this discussion about that same http 
stuff being installed by default in Go and Crystal, but not in D, 
despite D already has support by default for json, sqlite, etc.

And very honestly, preinstalling dlangui to allow people to 
immediately start developing connected applications (like in 
Python and Red) after the DMD installation could also help D 
become by far the best alternative to both Go and Python.

But I know this won't happen, because D's leadership, instead of 
focusing on D's strengths, tries for a decade to compete with 
C/C++ (low level no-GC languages), and clearly not Go, Python, 
etc (high-level languages for web/gui/scripting).

Just my two cents...



More information about the Digitalmars-d mailing list