Wt, C++ Web Toolkit
webtoolkit.eu
webtoolkit.eu
[1] http://www.marshut.com/kvuyp/is-someone-interested-in-cppcms...
I personally could never stomach doing web development on C or C++. The C++ source code to the CPoll-cppsp test [1] makes me cringe in fear (no offense, xaxaxa!) But if there are those willing to give it an honest go, I'm not going to criticize them. Caution them, as you have, that it may be a frustrating exercise? Sure.
That said, I think modern Java, Go, Scala, Erlang, Haskell, and Lua are all worth considering.
[1] https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...
Still, C++ is not my particular cup of tea. That doesn't diminish my desire to see Wt and CppCMS added to our benchmark suite, though.
1) Programmer availability and economics. Ton of RoR/PHP/Java and hopefully soon Go programmers, but good C++ programmers - good luck finding and retaining one.
2) Security - However competent YOU are - it just isn't possible to write a complex web facing system that is also secure. I was part of a failed project to write an IdM system in C++. It was a huge pain when we hired a external org to do Penetration Testing. After they were done we were left with lot of damage. Part of this is language, part is a lack of lot of great framework/best practices/expertise.
3) You reinvent the wheel a lot. Want to talk to LDAP - write your own load balancing and failover aware C++ classes or maintain somebody's unsupported OSS one. Equally headachy. Or pay for RogueWave - a ton of money per platform plus annual support contracts.
4) Cross Platform Pain - Enough said. Take the myriad of compilers, linkers, versioned libraries and try to ship a product that supports plugin based extendibility. Tough job convincing the customers to use the same compiler/linker/libraries to build their plugins.
5) Performance monitoring, debugging and profiling tools. See how well those compare against Java's JMX, HPROF, Heap dumps with OQL, MAT, YourKit etc. Just no match unless you are extremely competent and can manage debugging complex production systems without these tools.
6) Lack of something like a widely used Application Server ala Weblogic, JBoss. The value these provide in terms of ready clustering, db access, thread pooling - that's just not easily doable in C++. Add the lack of various 3rd party frameworks (ORM, Rules engines etc.) and you are ready to give up on C++.
Now I am sure somebody will go clever and come up with solutions for each of the above but the point is when you pull all of them together - it's not hard to realize it won't be worth it.
But which one of my points are not applicable to this particular toolkit? Sure it seems to provide XSS protection and such but the fundamental issues with secure coding in C++ still remain. So do the points about cross platform pain, compiler/library versioning issues, reinventing the wheel, availability of debugging/performance monitoring/profiling tools.
I don't have anything material; he's spot on.
but yup, low memory/cpu/ram situations are one clear place where a c++ web app makes a heap of sense.
Also things like routers, where there is an environment that doesn't change frequently (..or often at all for years..).
There is also a bunch of use cases where the fact that installing/replacing/updating the web app is as simple as replacing a single binary is a real win.
There just are a bunch of places where it makes perfect sense to use a c++ web app, and none at all to use frameworks like RoR.
Its not a big deal, there are entire worlds of requirements and use cases that look and sound nothing like 'public facing web application', where the ability to provide an HTML interface is a win, and the ability to lower resource requirements from something like RoR is a win.
The only reason I posted is that it just makes me sad when people are so utterly oblivious to the worlds that they dont know, and - because of that - are tracked into making definitive statements about things, when they should probably preface their comments with "to my knowledge..." or "Im not aware of" or even preface it with a genuine question "why is something like this useful?, I dont understand.."
There is nothing wrong with admitting you do not understand something and asking for clarification :)
To be frank, that's not something I don't understand. It's just a resource constrained environment use case that anyone can understand. What I don't understand is how common those use cases are today given my home router runs with 32Mb RAM and can use PHP instead of C++, never mind the fact that it doesn't need a full fledged C++ Web Framework to begin with!
For some definition of the word, I believe that Facebook is effectively deploying a c++ web app as part of its solution at this point.
There are many use cases for which RoR or PHP is the better solution, but it turns out it is imply true that there are others for which a c++ web app is the better solution.
Go figure :)
I thought Facebook mostly used C++ for their PHP VM? Facebook itself is alot of PHP, they also use Cassandra (Java DB) for inbox messages I believe.
Didn't know they switched to HBase, it's still Java though.
"Facebook uses hphpi (and now hhvm) for day-to-day software development, but uses the HipHop compiler (hphpc) to create optimized binaries that serve the Facebook website. hphpc is in essence a traditional static compiler that converts PHP→AST→C++→x64."
According to wikipedia: http://en.wikipedia.org/wiki/HipHop_for_PHP
"in Q1 2013, the production version of facebook.com started running on HHVM, replacing HPHPc."
I wonder how well silverstripe runs on it....
C++ is a tool just like any other language. It is not the answer for every question, but it is pretty good.
Some companies use it heavily and they are pretty successful: Google, Microsoft, Oracle, Facebook, OKCupid etc. So C++ is useful, even for Web.
BTW, it is used to implement PHP, Java Virtual Machine, Ruby, Windows and so on - that went reasonably well too.
Also, did you see wt is widget oriented and has a java version, which you can use with jruby if you want?
The real reason for the difference is that the rewrite into C++ used all of the domain knowledge he had acquired in writing the Java version. If he has made a Ruby version next, it would likely have been similarly efficient (maybe 5 secs? Who knows).
It's a key problem in these kind of anecdotes: a rewrite will nearly always be more efficient as it has more knowledge to work with during the architecture phase of the project.
The point of my comment is that your basis is flawed. The apples to chimpanzees reasoning you are using is not valid.
5) Performance monitoring, debugging and profiling tools. See how well those compare against Java's JMX, HPROF, Heap dumps with OQL, MAT, YourKit etc. Just no match unless you are extremely competent and can manage debugging complex production systems without these tools.
I find the C++ tools much better than the Java ones. I was recently tracking down memory use with a C++ client and a Java server (with help from a Java programmer).
I found VisualVM kind of pretty but mostly useless for finding the source of memory use but with C++/valgrind/massif I got the guilty data structure and the calling function on the client side in a few minutes.
The point is JVM tooling has matured enough that you have plenty of choices - you'll find something that works well even for production uses.
The use of C++ is a little questionable, but the nice thing about C++ is that you can create bindings to other languages reasonably easily. I would have preferred to see it in pure C to make it easier to write bindings for, but I can see why they chose C++.
As well, most of the other arguments are a bit hard to take seriously .. In #1 you talk about RoR and PHP but now in #6 you want me to pay Oracle or RedHat for these EE application containers and imply that without such containers we have big problems ... I mean, which one is it? As for connecting to LDAP and all these myriad of other things which you seem to being mistakenly thinking are unconnectable from C++, leave alone the fact that most of these services you aspire to integrate with were, themselves written in C or C++, do you really think that you connect to these things with PHP and not C++? I find that to be pretty interesting ... maybe even worthy of a "citation needed]."
For #4, so is everyone on here that does Web development, shipping products in binary form? Really, is the Web portal that you work on for ConAgra foods or whatever a product you shipping and selling? So, what you're saying is JBoss and all these others you want perform swimmingly well in a "cross platform" environment ... really, is that really you're argument? I think that's a fantasy. I think you're lobbing a lot of inconsistent criticisms all over the place against native programming.
By the way, people build, deploy, and manage complex native applications all over the world without Java or the JVM. It's a real thing, I promise.
Not everyone is making employee portals for the DMV or whatever projects your talking about ...
(The commercial license doesn't allow private modifications, though it does give a perpetual license. Perhaps it could use some improvement if they want to make more sales. http://www.webtoolkit.eu/wt/license/Wt%20License%20Agreement... )