3 ms·
> The comparison isn't between straight-C vs. straight C++. It's between C with a good glue language (say, Python or Lua) vs. straight C++. You can use several
by rubashov 16y ago
> The comparison isn't between straight-C vs. straight C++. It's between C with a good glue language (say, Python or Lua) vs. straight C++.
You can use several glue languages with C++ rather more easily and powerfully than C. See chaiscriptor QTScript. Also luabind and perl and python C++ bindings. Introducing scripting glue languages into the equation only further strengthens C++'s advantages.
> The equivalent C++ is:
The new initializer syntax is widely supported enough now. You can write:
std::vector<std::string> frobs {"foo", "bar", "baz"};
And even if you don't have a newer compiler you can use boost assign.
http://www.boost.org/doc/libs/1_46_0/libs/assign/doc/index.html#operator+= http://www.boost.org/doc/libs/1_46_0/libs/assign/doc/index.h...
- tptacek 16y agoEverybody here knows you can bind to C++ instead of C. What they're saying is, if you have Lua or Python, C is virtually certain to be enough; the higher-level architecture/object graph stuff is better dealt with in Python anyways.
- rubashov 16y agoThis claim sure doesn't jive to me. I got a simulation that does millions of GIS calculations involving entity tracks and regions. Moving the object graph into Perl or Python would take six hour runtimes into weeks. And writing it in C would be sheer torture.
- gregholmberg 16y agoPerhaps, but I don't think the situation would be as awful as you suggest. It is possible to write significant revenue-producing commercial software using Lua for control logic calling compiled modules, and expect it to perform every bit as fast as a similar app written 100% in a compiled language. I'm surprised no one has mentioned Lightroom yet. http://www.sauria.com/blog/2008/10/09/lua-in-lightroom/ http://www.sauria.com/blog/2008/10/09/lua-in-lightroom/ http://en.wikipedia.org/wiki/Adobe_Lightroom http://en.wikipedia.org/wiki/Adobe_Lightroom