61 karma · joined April 5, 2012
Ads that follow you has absolutely nothing to do with Google services. These are retargeting companies using their cookies to track you. They use ad exchanges, so even that is not principally Google.
Though I agree with OP - these projects and Java are here to stay for the foreseeable future.
Well I disagree with that. In C++ it is quite common for most objects to be allocated on the stack. I have never heard stack allocation being described as irrelevant. Of course if the language puts everything on the heap then that statement might be true.
Except the ones they were written to copy. Each example you give is an open-sourced clone of an pre-existing version implemented in a different language.
Like you say when your jumping around a lot then it matters less. When you're typing a lot then it does matter to keep your fingers on the home row.
template< typename Func > int escape(std::complex<double> c, int iter_max, Func& func)
Why build your own when C++ has std::shared_ptr.
C++ is a large, multi-paradigm language. It gives you choices and one is free to abuse those choices. But having more options gives you more power to express.
I think with modern C++ style, boost and C++11 its "difficult-to-work-with" reputation is massively overstated. It is possible to write succinct code with good design and get massive performance benefits.
Several boost libraries are inspired by python and C++11 features all help to write C++ code that is surprisingly similar to python, with a bit of extra type sepcification. If you think otherwise I'd suggest you're probably thinking of the C++ of the 90s - a more C with classes, and not modern C++.
I often find it useful to develop and prototype in python and convert to C++. Most often I'm doing this because my python simulations can take days and the C++ versions hours. Often I find it is not just the performance critical areas, but it is easy enough just to wholesale convert the lot.
So do this call, and then when its finsihed do this.
I like it.
I think it fails on all three of these, so in some sense it is anti-competitive to block other sites that fail these measures whilst it doesn't hold itself up to those same standards.
using namespace boost::adaptors;
s | reversed
or reverse(s)So for correct programs the end result might be the same in terms of values. For buggy code and runtime speed that's not necessarily the case.
For other reasons to write in C++ (or any static typed lang), I'd add type dispatching: calling different methods based on type. I also hate having a typo in a method name throwing at runtime.
I also often convert python implementations to C++, often using boost, usually for performance in one part of the code. You can quite often get the same implementation in a similar number of lines, especially since C++11 with boost.
Anthony William's book "C++ Concurrency in Action" gave me the impression that implementations of std::async would stop spawning new threads at some implementation defined limit based on harware concurrency levels. Instead, delay execution or switch to serial for extra tasks.