On Tue, 2018-06-19 at 13:43 +0000, Anton Fediushin via Digitalmars-d wrote:
> 
[…]
> I'm not quite sure constructive critique is possible in this 
> case. It's just a bad piece of code poorly implementing something 
> that is a part of the vibe-core.

Constructive criticism is always possible. The second sentence followed by a
paragraph or two providing evidence as to why and what is better,would be
ideal.

A hidden agenda here is to get C++ people to ignore all the C++ offerings and
use D/vibe.d instead. That a crap example has been posted should be ideal
material to get stuck in to the technical marketing.

[…]
> 
> There is vibe.web.rest which covers 90% of everything one might 
> need for their back-end application. There's practically no 
> reason to bother with bodyReaders/Writers.

So the person did not properly RTFM. Not surprising, the person did say they
were a beginner.

> > 
[…]
> 
> 1. It has something to do with lynx, curl works flawlessly
> 2. Writing HTTP manually is somewhat painful. Request should look 
> something like this:
> 
> $ echo -ne "POST / HTTP/1.1\r\nHost: 
> localhost:8080\r\nContent-Length: 3\r\n\r\nHey" | nc localhost 
> 8080
> 
> 3. There's `pipe` function in `vibe.core.stream` which does 
> exactly that. I haven't looked at its code but I'm pretty sure 
> it's far more efficient than byte-by-byte approach:
> 
> ```
> import vibe.d;
> 
> void main() {
>       auto settings = new HTTPServerSettings;
>       settings.port = 8080;
>       listenHTTP(settings, (req, res) {
>               req.bodyReader.pipe(res.bodyWriter);
>       });
>       runApplication();
> }
> ```
> 

This is clearly getting well stuck in to the task. Can I suggest finishing
this off and sending it to [email protected]

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to