Are there any conceptual drawbacks to building a web app with C++ and MySQL?

I’ve inherited a pretty interesting project where there is a good opportunity to take an existing piece of software and turn it into a SaaS web app. As the project is inherited, the code base/ framework is already defined as C++ and MySQL. The app itself is compiled and run as an EXE on Windows Server. The UI is web based and the app works as a kind of server. From what I do know of modern web apps, this is perhaps an unusual choice. These days, most people seem to opt for a PHP framework or Ruby on Rails. Certainly that is the impression I get from reading blogs on the subject. So, I’m very interested to know if a C++ EXE backed by MySQL is a solid foundation for a web app, or whether we should be looking to build in another way?

6

It is OK to make a web application using C++ IF the benefits outweighs the cost, obviously. Google, Amazon, Facebook are all built with C++ for efficiency in speed, memory and energy – aka servers costs.

However as you guessed, there are drawbacks to using C++ for this. It depends on your tools though.

First let me cite cppcms website on this:

When CppCMS Should Be Used.

C++ language is far from being popular for Web development for many
reasons: lack of appropriate tools, skills of developers and many
more.

However, there are areas where C++ web programming with CppCMS becomes
very useful and efficient, and some where it is just a waste of time.

When CppCMS should or can be used?

1.High load web sites and application with hundreds and thousands hits
per second, where high performance, efficiency and scalability is
required.

2.Application that require scalable Comet/Server Push
technologies — CppCMS can efficiently handle hundreds and thousands
simultaneous HTTP connection with minimal resources usage.

3.Embedding web interface into existing C++ applications/services with a small
cost of additional library.

4.Embedded underpowered devices — CppCMS
allows creation of rich applications with relatively low cost of
hardware that would perform reasonably fast.

When Not To Use?

If you create small web applications that do not require high loads
and require very short time-to-market period — probably tools like
Django or RoR would be more appropriate for such tasks.

The drawbacks specific to C++ are:

  • Compile times can be very very very very slow compared to other languages. This might impact iterations, release interval but also developer’s moral. Make sure it’s worth it.
  • Most of the time, you need to compile changes. It can be avoided but it’s the usual.
  • Writing modern C++ makes it easy (to learn, read, write, debug, etc.), but a lot of C++ developers don’t know what is Modern C++. So if you work in team, you need to have good knowledge of Modern C++ from the whole team. If not, you will easily get into very complicated bugs. That said, it’s more a people problem than a language problem. It’s just that C++ history didn’t help make it easy to grasp. Good teaching is not as common as in more modern (historically) languages.
  • Unicode is still poorly supported by the core C++ language, making it a potential source of great pain. Just use UTF-8 everywhere and some libraries (look into boost) to manage it.
  • C++ standard don’t know what is a library. So we use conventional ways to manage them on different compiler/linker/OS. This might be a problem if you start to get into cross-platform code that need to load/unload “on the fly” some modules.

Maybe take a look at CPPCMS? Or maybe wt if you want to make a GUI-style website?

Also check these questions:

  • Are C and/or C++ viable/practical options for web development?
  • Can C++ be used as a server-side web development language?
  • Thoughts on web development architecture through integrating C++ in the future to a web application

12

WordPress running in PHP with a few plugins installed brings my Winders server to it’s knees. So I have no problems at all with the idea of implementing a web application in C++. Speed is a critical part of the web experience.

Graphic design tents to drive the majority of web projects. PHP is an obscure scripting language that runs inside HTML. Allowing the PHP authors to escape in and out of HTML. There are many benefits with working with HTML as a result.

Still, you could implement any number of HTML template solutions in C++.

One could provide you with an long list of Python and PHP frameworks that make for rapid development, but if you have lots of time then C++ is definitely possible.

What I don’t understand is your decision to do C++ on Windows. lol

4

It certainly is an unusual choice. C++ wasn’t designed with web applications in mind, and while libraries exist to write, say, FastCGI applications with C++, you have to do a lot more work to get your basic application up. “Web languages” usually do a lot of things for you that you have to get from elsewhere in C++, such as implementing the HTTP protocol, generating HTML, etc.

Also, web applications are mostly about strings, which isn’t exactly C++’s strongest side – there is no string type built into the language itself, and this leads to a few quirks and makes string processing more clumsy than it would be in more high-level languages. Handling character encodings correctly in C++ borders on black magic. And C++ can crash really hard, on fairly innocent-looking code, which is far less likely with a higher-level language (they too can crash, but in most cases, the web server can recover gracefully, especially on platforms that use a per-request lifecycle model, like PHP).

That said, if you have most of the codebase written already, C++ might still be a viable choice. You will need to find some libraries to cover all sorts of web things (most notably, you want to be able to either integrate a standalone HTTP web server into your program, or hook into, say, Apache, either through FastCGI or by compiling to a module; you will also want some kind of templating library to make rendering HTML documents painless).

Finally, there’s the developer market issue. There are plenty of C++ developers available, and even more web developers, but the overlap is probably not that large, so if you ever need to hire people to work on this thing, you’ll have a somewhat harder time than with, say, PHP.

As others have said, conceptually, C++ is a fine environment for a web server development. There are however, several considerations as you make that decision.

The popularity of scripting languages for web server design is turn around time. Simple changes can be made easily with the demonstration of results nearly immediate. You will find that any good web server design will offer similar capabilities. Indeed, C++ is an excellent environment for achieving that goal.

The key to building a good web server application system is a separation of UI from code. A goal in building a web application environment is to avoid “Your UI is in my code and your code is in my UI.”

I would like carefully at systems like cppcms. I would expect that it offers something similar.

You don’t need a scripting language to offer flexibility and performance.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật