From: Jeff Garland (jeff_at_[hidden])
Date: 2007-04-08 21:09:24
Mathias Gaunard wrote:
> Jeff Garland wrote:
>> Everyone that thinks C++ isn't good for CGI or Web programming more generally,
>> needs only to go to google.com to see C++ in action. BTW, they recently open
>> sourced their c++ templating engine
>> (http://code.google.com/p/google-ctemplate/) used to create various sites.
> Note, before reading my critics, that I only went to the link you gave
> and had a quick look.
> The template language is not especially impressive, it's very basic stuff.
> I think better languages can be designed.
I don't want to make a big defense of their code, but you should probably look
at it a little longer. While it is a spare and minimal template language, to
be sure, it provides a fair amount of capability (like repetition and
optionality) without alot of primitive notations -- like some other more
bloated template languages I've seen.
Anyway, my main point was that "the perception" that C++ isn't used for web
programming is just wrong.
> And the API is not only unimpressive, it also seems pretty bad.
> To begin with, the code isn't even valid C++ as it uses ' for strings
> instead of ".
I have no idea what you're referring too -- I've compiled and run tests on my
machine, so I assure you it's valid c++.
> It also includes a standard C header instead of the C++ compatible one,
> uses a bad way to distribute randomness, uses different functions
> instead of overloading, uses pointers and even worse, the address-of
> operator instead of things that probably should be references or
> eventually shared_ptr to share the template throughout the program,
> writes the output to an std::string (which is taken by pointer instead
> of returned...)
Again, I wasn't holding it out as the way I'd design such code, only that one
very notable exception has found C++ useful for web development.
>> Scripting languages have gotten most of the attention in web programming
>> because there easier for small applications
> That's not only "for small applications".
> I think you can't expect developers working in web programming to simply
> be as competent as developers working on say, more advanced matters.
Well, ahem, I've spent plenty of time working on more 'advanced matters' in
C++, but I've written my fair share of scripts too. I don't think your
generalizations hold up.
> This is because the web is trendy and easy to access, lots of
> inexperienced people are working on it, and there are even quick study
> courses in some universities nowadays specific for web development.
> As a result, that kind of developers can't design software as well. And
> for that, automagic management of resources is what helps.
Automagic management of resources helps expert designers and developers as
well because it lets them focus on the problem at hand instead of resource
>> and they have a fully complete
>> 'software stack' for development of web-apps in an easy bundle.
> Certainly, what defines those new scripting languages seems to be at
> least as much their standard library as themselves.
> But those languages usually have a reference implementation, backed up
> by an active group or company that invests lots of money/time in its
> That is quite different with C++.
Well all your responses to my email, I think, distract from the main point of
my email -- which is, that I'd like to see such a library in Boost. Darren,
and maybe others, seem to reflect the "known wisdom" that C++ "isn't good" for
web programming, so why bother? My point was that the "known wisdom" is wrong
-- many c++ projects could benefit from better tools for web development in
general. Other than the lack of good libraries, there's no reason I should
write 98% of a project in C++ and then have to jump to 'scripting languagues'
just because I need to serve a web page.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk