Starting a new blog
Dear fellow programmers!
Today I'm finally starting a blog on a subject I have been working quite a lot on for many years, in my spare time. Yes, it is about C++ programming and more specifically how we can make C++ programming better by improving the standard. When I started with C++ in about 1994 the language was far from mature and compilers were far from being able to support the language we had. More on this in a later post. However, with C++11 things started to move. The C++11 standard was such a great improvement that it inspired me and many others into working on furthering this even more. The work (and my part is tiny of course) has resulted in more updates in the C++14 and C++17 standards and also in a much closer tracking of the standard by the major compilers, which of course is as important for the regular users.
My motivation for engaging in the standardization work goes a bit deeper than just being able to write the code I want in an easier way. It is about sustainability! We all know that C++ programs perform much faster than most other languages. It is also a fact that computing consumes a large fraction of the electricity of the world (http://www.independent.co.uk/environment/global-warming-data-centres-to-consume-three-times-as-much-energy-in-next-decade-experts-warn-a6830086.html). A significant part of the problem is that a lot of code is written in languages which consume much more power to do the work than C++. By making C++ more attractive to new projects we could thus reduce the number of servers and the amount of electricity needed. Of course, as the world goes more and more digital this will be more and more important.
So why are people using inefficient languages rather than the efficient alternative? My simple answer to this is that C++ is viewed as very hard to learn and by an increasing fraction of young programmers as a niche and old style language. There is also the effect of web programmers currently being forced to use javascript, which may account for its supremacy. I have tried to find a reliable list of popularity of programming languages but the ones I found use very strange measures I think:
Girhub placed C++ as sixth but measured number of pull requests. So a million line C++ library has the same weight as a 100 line javascript snippet. PYPL is an almost official measure but measures the number of times people google for tutorials in different languages, of course favoring the new over the old. C++ ends up sixth here too.
However, what I wanted to point out is that if it was scoring better the programs running on our devices and server parks would be more performant and thus both ourselves, companies and the planet would gain!
So what can we do about this, and get more of the world's programming done in a faster language? My conclusion was that what is main weakness: The small scope of the standard library. With most other popular languages like Java, Python or C# there is one go-to place to find libraries for most common tasks including networking, database interfaces, user interfaces and so on. In C++ not so, you have to either invent it yourself or rely on some external library which may or may not be well proven and still actively maintained. There are many problems with using external libraries including the often wide and deep list of other dependencies they rely on in turn, a wide range of build systems you need to master to build them and that they most often use only C++03 level features, restricting their usage, and in many prominent cases such as Qt for instance, don't even use the standard container and string types. Add a few more of these libraries to your project and you may end up with several string classes, several vector-like containers and lots of unnecessary data conversions.
Different measures to improve this situation is going to be subjects for upcoming blog posts on this list, as well as some of my more or less (usually less) formal proposals for language and library features pointing in this direction. In addition I will likely write about my C++ framework library BAF and maybe ideas for new programming languages.
Today I'm finally starting a blog on a subject I have been working quite a lot on for many years, in my spare time. Yes, it is about C++ programming and more specifically how we can make C++ programming better by improving the standard. When I started with C++ in about 1994 the language was far from mature and compilers were far from being able to support the language we had. More on this in a later post. However, with C++11 things started to move. The C++11 standard was such a great improvement that it inspired me and many others into working on furthering this even more. The work (and my part is tiny of course) has resulted in more updates in the C++14 and C++17 standards and also in a much closer tracking of the standard by the major compilers, which of course is as important for the regular users.
My motivation for engaging in the standardization work goes a bit deeper than just being able to write the code I want in an easier way. It is about sustainability! We all know that C++ programs perform much faster than most other languages. It is also a fact that computing consumes a large fraction of the electricity of the world (http://www.independent.co.uk/environment/global-warming-data-centres-to-consume-three-times-as-much-energy-in-next-decade-experts-warn-a6830086.html). A significant part of the problem is that a lot of code is written in languages which consume much more power to do the work than C++. By making C++ more attractive to new projects we could thus reduce the number of servers and the amount of electricity needed. Of course, as the world goes more and more digital this will be more and more important.
So why are people using inefficient languages rather than the efficient alternative? My simple answer to this is that C++ is viewed as very hard to learn and by an increasing fraction of young programmers as a niche and old style language. There is also the effect of web programmers currently being forced to use javascript, which may account for its supremacy. I have tried to find a reliable list of popularity of programming languages but the ones I found use very strange measures I think:
Girhub placed C++ as sixth but measured number of pull requests. So a million line C++ library has the same weight as a 100 line javascript snippet. PYPL is an almost official measure but measures the number of times people google for tutorials in different languages, of course favoring the new over the old. C++ ends up sixth here too.
However, what I wanted to point out is that if it was scoring better the programs running on our devices and server parks would be more performant and thus both ourselves, companies and the planet would gain!
So what can we do about this, and get more of the world's programming done in a faster language? My conclusion was that what is main weakness: The small scope of the standard library. With most other popular languages like Java, Python or C# there is one go-to place to find libraries for most common tasks including networking, database interfaces, user interfaces and so on. In C++ not so, you have to either invent it yourself or rely on some external library which may or may not be well proven and still actively maintained. There are many problems with using external libraries including the often wide and deep list of other dependencies they rely on in turn, a wide range of build systems you need to master to build them and that they most often use only C++03 level features, restricting their usage, and in many prominent cases such as Qt for instance, don't even use the standard container and string types. Add a few more of these libraries to your project and you may end up with several string classes, several vector-like containers and lots of unnecessary data conversions.
Different measures to improve this situation is going to be subjects for upcoming blog posts on this list, as well as some of my more or less (usually less) formal proposals for language and library features pointing in this direction. In addition I will likely write about my C++ framework library BAF and maybe ideas for new programming languages.
Kommentarer
Skicka en kommentar