June 19, 2018
On Tuesday, 19 June 2018 at 14:42:20 UTC, Russel Winder wrote:
> 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.

Thanks, maybe I'll try and write something as constructive as possible.

>
> 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.

Using C++ sometimes can be a bad idea. Using C++ for web is always a bad idea. Can't agree more, D is a great language by itself and there are smart people working on it. The only thing missing is somewhat good marketing for all of that.

>> 
>> 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 scc@accu.org

I will try and do so. I can't see a reason to not give it a try. I'd like more people to participate. Maybe then we'll see more D in the Code Critique.

July 18, 2018
On Tue, 2018-06-19 at 19:22 +0000, Anton Fediushin via Digitalmars-d wrote:
> On Tuesday, 19 June 2018 at 14:42:20 UTC, Russel Winder wrote:
> > 
[…]
> > This is clearly getting well stuck in to the task. Can I suggest finishing this off and sending it to scc@accu.org
> 
> I will try and do so. I can't see a reason to not give it a try. I'd like more people to participate. Maybe then we'll see more D in the Code Critique.

I am just putting together a piece in answer to the original question, it would be great if you were able to submit something as well. 2018- 08-01 submission deadline.

-- 
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


1 2
Next ›   Last »