Why is C++ not used in web development?

However when it comes to web based applications level programming, I find some qualities of C/C++ to have significant scopes of improvement:

1. Low level-ness – both C and C++ are complied directly into machine level code as binaries unlike Java which compiles to bytecode and C# to MSIL, which makes them runnable on any machine on any OS. But portability is way harder across operating systems for C/C++ because every machine is different and so you need have binaries compiled for specific hardware and OS which is cumbersome. For example, you need to think whether your code is POSIX compliant. Just because it works on Windows doesn’t mean it works on Mac/Linux.

2. Lack of an industry grade 3-tier stack (framework)- this is probably the top reason why C/C++ is not used much in web development. J2EE and Spring are just two of the many stacks built to code with Java. With jsp for front end, Java for business layer and jdbc for database operations in J2EE, similarly ASP for web pages , C# for business layer and ADO for database ops in dotnet framework, Django for Python, Rails for Ruby, MEAN and MERN for javascript, there isn’t one for C/C++. So you would end up building the components first before you build the tool.

3. Syntax – I particularly found c++ to be overwhelmingly detailed about the syntax – you have to be pretty careful with a single space sometimes. As you dig deeper, you will get to know when string is better than const char* and vice versa.

4. Playing with pointers – if you grew up with C++, you would be either super happy that you have control over an exact memory address or quite confused about generous usage of pointers. You could easily crash your app if you missed an asterisk (*) because the memory address you needed vs the one you de-referenced to would be different altogether.

one more because, well… pointers!

5. Manual control – It is probably about 12856313th time you are reading or hearing or telling someone else “with great power comes great responsibility”. C++ is the best example for this. It gives you too much control over your machine making you wonder why does it not handle <insert some operation here> by itself? Maybe this has been addressed in the later revisions but one example was where i found it unnecessary for me to terminate strings with null characters. You can do more than what is needed which should not be allowed.

6. New technologies – in this era of advanced programming languages and frameworks like Spring, React, Node, MongoDB, AWS, etc, web technologies have advanced a lot while C/C++ remain the ultimate warriors of system level programming.

Don’t get me wrong, I do like C/C++ without which nothing new could ever happen in computer industry. In fact, there are other places it is used – internet browsers, computer vision tools, heck even Windows OS is written in C++. I would just try to research which language is best for what purpose before making a decision.

Publicado por djalmabina

WordPress and Google Maps developer,Blogger, Article Writer,Freelance Writer. Please look my recent Blogs: https://geatland.wordpress.com/

%d blogueiros gostam disto: