BTW, 18 LOC to draw «Hello» like he did with Cinder is also possible with SFML. :-D
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window{ sf::VideoMode{ 400, 400 }, "", sf::Style::Close };
sf::VertexArray vertices;
while( window.isOpen() ) {
sf::Event event;
while( window.pollEvent( event ) ) {
if( event.type == sf::Event::Closed ) {
window.close();
} else if( event.type == sf::Event::MouseMoved ) {
vertices.append( sf::Vertex{ sf::Vector2f( event.mouseMove.x, event.mouseMove.y ), { 255, 127, 63 } } );
}
}
window.clear();
window.draw( vertices );
window.display();
}
}
I count 14 :P.
As for the keynote, I can't help but find Sutter's speeches... all kinds of things. On the one side, you have the fact that he does acknowledge the fact that the C++ standards committee has been more than not conservative and cautious when it comes to exploring new areas. This is contrasted with the current developments regarding language and library evolution, which is being done at a much faster pace than ever before. I also can't help but notice his enthusiasm when talking about the things he finds worth mentioning and why he seems to consider C++ the language for everything, while at the same time remembering at the back of my head that he is employed by Microsoft, the only big compiler vendor that still doesn't have a release version that supports the newest standard. His advocacy for standard C++ also contrasts the fact that he is linked to many non-standard C++ topics and areas including CLI, CX and AMP. Maybe this is a good thing since C++ is trying to extend its library to be more comparable to other more "complete" languages.
If I had to describe Mr. Sutter in a few words, I guess I would call him a "C++ salesman" or "C++ marketing representative" which probably fits well to his position as convener of the standards committee. He is good at selling us these ideas, but the real issues behind them are the work of others on which we will depend to see e.g. the 2D API one day. I can only hope these "invisible people" in those workgroups are independent enough to not incite internal "vendor wars" which might delay or even prevent good things from happening. As he noted, we really don't know how people program in C++, let alone using libraries to get whatever they need done. The same can be said about SFML. We don't have any reliable metrics about its real userbase and the majority of the code written with it might be "dark matter" that we will probably never see. This is why I think standardising a 2D C++ API is going to take longer than what many people might expect. There are so many different ways it can be done, finding a common ground, and one that is true to the "C++ way" is going to go through many iterations until it is written down permanently. I guess they are in the pre-case study phase right now where they collect impressions from existing libraries and see what the general public is used to since one can assume that libraries generally cater to the needs of most users and show some convergence.
One thing that made me wonder: When all those workgroups are done with their work and C++'s library is expanded to what Mr. Sutter said they envisioned, and the platform independence problem is practically solved and the undefined behaviour (which I found surprising they even considered making a workgroup for) is... defined? (:P) What advantages will a language such as Java have over C++ any more? Beginners and experienced programmers always argued in favour of Java because of all those things that C++ currently lacks but is being worked on, so once all those things are in C++ as well, why would anybody even consider Java any more? To top it off, if both languages were truly equal in all aspects, one must not forget that C++ is an ISO standard, whereas Sun decided to keep Java more or less to itself. If Java advocates watched the video, I would expect them to start to asking themselves how things will stand in several years.