Frequently Asked Questions
-
-
- Are you crazy or a masochist?
- Why develop web sites in C++?
- Is CppCMS really a Content Management System, e.g. like Drupal?
- If CppCMS is not a CMS, where does this name come from?
- Why develop web sites in C++? It's a dangerous language!
- Isn't the major bottle neck of any web application the SQL engine and not the server side language?
- How can I contribute?
- How is CppCMS licensed?
- What existing frameworks have inspired you?
- Is this project cross platform?
- Why are HTML templates compiled? Why don't you use an interpreted template system or XSLT?
-
Are you crazy or a masochist?
As far as I know --- no.
Why develop web sites in C++?
Many reasons, see Rationale.
Is CppCMS really a Content Management System, e.g. like Drupal?
No, CppCMS is not a Content Management System (CMS) like Drupal. It is a web development framework like Django or RoR.
If CppCMS is not a CMS, where does this name come from?
The original idea was: "Write your own CMS in C++".
The lead developer asked in 2008 for a better name but didn't get any suggestions, so the name stuck.
It was decided later to keep this name as it was already well known name and all the software around used cppcms
as the namespace.
Why develop web sites in C++? It's a dangerous language!
Modern C++ is indeed a difficult language and it takes much more time to get familiar with it, in comparison to dynamic languages like Python or PHP, or static ones like C#/Java, that are very popular in web development.
However, once you know it well, you have great set of tools that allows you to write applications rapidly and safely, without memory leaks, without random crashes. Once you stick to RAII principles, write exception safe code and understand how the STL works, everything becomes simple and quite straightforward.
Isn't the major bottle neck of any web application the SQL engine and not the server side language?
This is a quite common misconception. And it is quite easy to check. Running simple benchmarks on typical CMS you are going to find that it may create about 5-50 pages per second.
If you log the database queries and run them as if these were requests from the CMS engine, you'll discover that you can reach up to 1000 requests per second (requests, not queries)... So, SQL makes about 5% of your performance problem.
In fact, if you take real big projects like Wikipedia, you can see that there are much more computing resources wasted on PHP processing than on processing SQL queries. See: Is Data Base the Bottle Neck of Web Service?
How can I contribute?
Read this guide
How is CppCMS licensed?
CppCMS 1.2 and above is licensed under MIT license. Versions before it were released under LGPLv3 and commercial licenses.
Read this to learn the difference and a guide to select a suitable license for you.
What existing frameworks have inspired you?
Mostly Django. Sometimes, when I want to add a feature to CppCMS, I read the Django documentation and try to understand how they did it.
Good examples are: templates inheritance and forms.
Is this project cross platform?
Yes
It supports: Linux, Windows, Solaris, FreeBSD and Mac OS X.
Why are HTML templates compiled? Why don't you use an interpreted template system or XSLT?
Let's start from the history. The first CppCMS template system (CppCMS 0.0.1b) was interpreted and dynamically typed. It required the user to provide some glue between the data he/she uses and the rendering system.
But this template system was abandoned in favour of statically typed compiled templates for the following reasons:
C++ is a non-reflective statically typed language, so performing compilation time type checks would require implementation of a C++ parser, which is quite unfeasible.
In compiled templates there are many checks that can be performed by the C++ compiler itself.
This is very important for HTML generation because Unit Testing of human interfaces is much more complicated and thus static typing gives significant advantages, moving more testing to the compilation stage.
Much more complicated data types may be supported by just implementing operator
<<
overstd::ostream
.Implementation of template inheritance, support of standard data structures (containers) like lists, maps, hash tables and even user defined ones becomes trivial.
There are few disadvantages of compiled templates:
- Updating a template requires the recompilation and relinking of the view or even the application itself.
- Such updates require a restart of the application.
The first issue is not so critical because when using templates compiled to shared objects or dlls the compilation time becomes very short and users do not need to wait too long. For example: the wikipp template compilation and linking takes about 1.5 seconds.
The second issue was addressed in CppCMS 1.x.x where templates can be reloaded automatically as view's in a shared object or dll. You can then update without needing to restart the application.
Also Note: Nothing prevents from you using any other template system if you find it suitable, you can always write an output directly without templates.