Web Development with C++ in 2019

Web development with Cpp in 2019 Featured image

First, let’s accept the fact that C++ is not one of the most popular programming languages, usually, the popular chart is being taken up by languages like JavaScript, Python, Java or usually other modern languages. but don’t get me wrong here C++ is definitely not the popular language. But C++ still is one of the most powerful and underlying language.

For most of the frameworks that you work around, they are somehow being interacted or being touched by the C++. For example, Flutter is one of the most famous and getting popularity kind of a framework. Under the hood, they are interacted quite a lot by C++ programming.

And usually, when I talk with other developers about C++ the all say that it’s an academic language. And if somebody who is much more interested in C++, always says that I want to do game development with C++.

Yes, it’s a truth that C++ can be used for game development. But that would really be an underselling of C++. C++ is very powerful and can do a lot of things. But usually what happens people don’t know how to get started with C++ and building projects as well.

Usually, the best they can come up with is the game development. No, it’s not like that. C++ is completely capable even of interacting with the modern web applications that use MongoDB, Heroku or Docker, and all these things. Of course in the popularity chart, you will not see most of the Youtubers, Bloggers or Developers or other people who are social media influenced are talking about this language.

The reason is pretty simple because this language usually comes up from the academic sign assigned, and people who are doing their engineering or masters or Ph.D. usually get in touch with these languages, and on the internet most of the people are those who are influencers, and who are pretty good in the technology don’t have that kind of educational background.

I’m not saying it’s wrong, it’s totally fine but usually this language definitely has a heavier side on the academic world.

A year ago I got a freelance project, for that particular project I realized that I need to jump now into C++, to be honest, I didn’t like it. I was using Python and javascript for that but it was terribly slowing the web application.

I didn’t like using C++ because the syntax is very verbose and coming up from a world of Python and JavaScript, where you don’t have that much of verbose syntax, everything is abstracted into a layer, you don’t declare datatypes, the loops are pretty easier as well.

Too much of the code is there… in C++

But of course, I also realized after a few lines of codes on that project that, yes this language is ridiculously fast and we have to use it.

Now the biggest issue is first and foremost is the development as well as deployment because there are some libraries in C++ which you install at the development side. If they are not exactly those versions are not present on the deployment side everything is going to be crash. And you won’t be able to see much of the errors you won’t be able to resolve that so that’s one of the biggest issues.

What we used to make a web app with C++ and how you will implement it.

So, we used Docker because DevOps technology helps in resolving the exact same kind of error in the Local and Production environment. So, If you want to use the same docker that we have used in this technology it is simply available by the below command which we got on the internet:

$ docker pull hiteshchoudhary/hello_crc

So, the Library that we used in this project was Boost. This set of library helped a lot because we don’t want to write everything from scratch.

For the web application, we used CROW which is pretty useful but not well documented you can check the CROW framework here. It is like Flask or Django of C++.

We used Heroku to Push all these things.

So 80% of our problems were solved by these technologies but the next challenge was yet to come.

We wanted to have MongoDB as our database. And this was the biggest problem. If you can I would recommend using MySQL because it would be easier to work with.

But you still want to use MongoDB think twice. Because it will not be easy.

So, If you want to use MongoDB then you have to follow the hard way, that we did. Firstly, we went to the MongoDB official repo and we had to install the MongoDB drivers to the core of the C++ Language.

But we careful these drivers are written in C so, compile those drivers into C++ and then you will be good to go.

If you go through this hard step believe me everything will be super easy.

After going through a lot of stupid things that we got our results, a web application that was super fast just like Light. Now You know that C++ can do more than Game Development right?

Leave a Comment

Your email address will not be published. Required fields are marked *