Can we use c++ for designing websites? | SoloLearn: Learn to code for FREE!


Can we use c++ for designing websites?

5/19/2020 2:50:47 PM


4 Answers

New Answer


Web design involves writing HTML for structured content and CSS for its presentation. Now, if you're talking about writing a web based application... Yes, you may use C++ to write the server side backend which would generate your pages. But it is not recommended as C++ is not suitable for sandboxes environment and posses a major security risk. Just imagine if you open a website and it contains a c++ program with major memory leaks.


At the very least, you need to use HTML and CSS to construct a very basic website. However, I presume you mean create a dynamic web application for your website, too. Common languages used for this purpose include PHP, Java, and Python. You can use C++, as well. There are several good C++ web frameworks or libraries.


The other answers are already pretty good but I'd like to add some more details. Nowadays you can write both frontend and backend in C++. Wasm allows you to run C++ like JavaScript in the web browser. And C++ is obviously a decent choice for backend as well, except that you might have some security problems. I can however recommend you Rust, a relatively new system programming language like C++. It's as fast as C++ (so a lot faster than JS, PHP, Java or Python), runs on front- and backend, is super secure by design, has a great ecosystem and is really fun to code (it has been the most loved language for four years now).


The order is the best