For those ready to take the challenge

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 10 07:13:27 PST 2015


On Saturday, 10 January 2015 at 12:34:42 UTC, Tobias Pankrath 
wrote:
> Since it is a comparison of languages it's okay to match the 
> original behaviour.

I don't think this is really a great comparison of languages 
either though because it is gluing together a couple library 
tasks. Only a few bits about the actual language are showing 
through.


In the given regex solutions, C++ has an advantage over C wherein 
the regex structure can be freed automatically in a destructor 
and a raw string literal in here, but that's about all from the 
language itself. The original one is kinda long because he didn't 
use a http get library, not because the language couldn't do one.

There are bits where the language can make those libraries nicer 
too: dom.d uses operator overloading and opDispatch to support 
things like .attribute and also .attr.X and .style.foo and 
element["selector"].addClass("foo") and so on implemented in very 
very little code - I didn't have to manually list methods for the 
collection or properties for the attributes - ...but a library 
*could* do it that way and get similar results for the end user; 
the given posts wouldn't show that.


More information about the Digitalmars-d-learn mailing list