If I understand it correctly they have DNS servers spread out at different locations. These locations are also BGP peering locations. If the DNS server at a location cannot reach the other datacenters via the backbone it stops advertising their IP prefixes. The hope is that traffic will then instead get routed to some other facebook location that is still operational.
Yes! I wanted to address this idea in the article, but it didn't make the final cut as I didn't think it added much to the points being made. Moving away from direct field access and only using functions is definitely in line with the Alan Kay OOP model.
Well, as someone who has taught different languages as first, second and third languages to students and young pupils I would say it becomes easier. Not easy in an absolute sense. It still requires effort.
I would however agree with you that those who say "it's easy to learn another" in an absolute way has usually only considered languages from the same group so far.
Not sure how to write this. I am hoping the next level of fluff to be removed will be implementing concrete algorithms in procedural or functional style in day to day coding. Instead we should be leveraging other programs (such as SMT solvers, but not limited to those) to produce a suitable implementations of solutions.
That is, we should try to focus more on specifications, in one form or another.
So much of the software I work with could plausibly have been written by a machine instead.
In this piece of code, the return type is explicitly dependent of the type of the argument (it's path related template
#include <iostream>
#include <string>
struct A {using ret = std::string;};
struct B {using ret = int;};
template <class T>
auto f(T t) -> typename T::ret
{
return {};
}
int main(int argc, char *argv[])
{
auto s = f(A{});
std::cout << s.size() << "\n";
auto i = f(B{});
std::cout << i+1 << "\n";
return 0;
}
There is also stuff like this where the return type is defined as the return type of builder.makeObject(), builder which is the argument:
template <typename Builder>
auto
makeAndProcessObject (const Builder& builder) -> decltype(builder.makeObject() )
{
auto val = builder.makeObject();
// do stuff with val
return val;
}
The return type has to be dependent on the value of the input, not its type. Like it'll return an int[3] if you provide 3 as in input and int[4] if you provide 4. Note that both 3 and 4 should have the same type, but int[3] and int[4] are different types.