7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 7y ago · link · parent
* Which provided $8B worth of rides in a single year
* Didn't hurt anyone
For crimes which amount to:
* May cost some IPO underwriters money
* May not make all of the employees rich
* May cost VCs money
The worst thing to really say about such a company is "I enjoy their convenient rides but I won't buy their stock".
Instead, the article attacks the founders for their age (too young), ridicules their visions of the future, and compares them to other young founders. Bewilderingly, the author compares the founders to Zuckerburg, which doesn't fit the point of the article at all. Not content with all of that, the author takes a shot at Musk for selling fantasies, when he has done more than many people thought possible.
comment 7y ago · link · parent
In rust, it creates the trait object right as it's calling a function that requires one. But "creates" is too strong a word -- it's just sending the virtual function table pointer along with the structure pointer and any other arguments, probably in registers. Only if you are actually storing the trait object somewhere does it matter much.
In your example, you have to construct the "derived" type each time you come from C to C++. Using an extra type is annoying. I think a better C++ example would be trying to do something closer to what rust does and use the C struct pointer most places, and construct the C++ object right before you need it. Would work, but doesn't come out quite as clean as it does in rust.
In any case, the main point is that the normal mode of C++ is to add vtable pointers to the structures to achieve dynamic dispatch, and adding stuff to the beginning of a struct does not interoperate with C code very well. The normal mode of rust is to not touch the struct layout and achieve these features through other means. I'm sure there's a way to work against the grain in C++ and make it work, but if you ask me, rust gets it a little cleaner in this particular case. Or you could argue that working against the grain is the normal mode of C++ ;-).
comment 7y ago · link · parent
Using soap has a big effect on how the UV light hits your skin, the damage it might cause, and the benefits that it might have. Of course this is all speculation on my part, but I am just warning of the idea of picking one natural thing at a time -- natural things go together.
comment 7y ago · link · parent
Choosing the natural over the artificial is a reasonable default where the science is uncertain. But just remember that science has eliminated an awful lot of problems.
Also remember that natural experiences aren't always a la carte. Picking natural foods from disperate regions might be very unnatural, as is getting natural UV light after taking a shower.
comment 7y ago · link · parent
I'm sure that you can construct the container object at each call site so that it behaves like rust (and it would just be allocated on the stack), but it would get a little ugly. In rust, it's very seamless and "rust-like" even though you are operating on a native C struct.
Similarly, the Option type magic is pretty darn useful. I'm sure you could do that in C++ as well, but again it would end up ugly because you'd need to invent a new COption type or something.
comment 7y ago · link · parent
In rust, you can do dynamic dispatch via trait objects over C structs. In C++, that wouldn't work, because dynamic dispatch uses inheritance and it needs to add a virtual method table pointer in the struct, meaning that you'd need to translate/copy the struct into a C+ one.
Also, rust has neat tricks. An Option type of a reference is represented as a single pointer where NULL means None. That means your plain old C struct can be interpeted as an Option type in rust without copying/translation.
comment 7y ago · link · parent
For instance, making drugs illegal (accounts for most federal prisoners) and running social welfare programs (accounts for most federal spending).
If something really is an important power the federal government must have (maybe some kinds of environmental regulation powers?), then make an amendment that clearly scopes the boundaries of that new power.
comment 7y ago · link · parent
I mean, you can do all of this stuff another way. But PostgreSQL represents a lot of lessons learned over decades with all kinds of applications.
Sure, there may be some level at which it's just easier to serialize the in-memory data. But that level is lower than most people realize and postgres is pretty darn easy to use given all the kinds of problems it helps you avoid.
Even an MVP of a trivial web app is probably fastest to deliver with postgres, and less risky.
And there are tons of things that are really convenient even for the tiniest app. For instance, being able to go in and browse your data to find out what's causing a minor bug.
comment 7y ago · link · parent
Investors invest in many startups. Each one starts in a different valley and starts climbing the hill. The investor's job is that one of the startups pays off. Your job is to climb your hill quickly and cheaply.
comment 7y ago · link · parent
Unique keys, foreign keys, check constraints, and DDL changes were all meant to solve real problems. I guess some apps might not benefit as much, but it seems like asking for trouble.
Given how easy it is to just use postgres, why invite all the risk?
comment 7y ago · link · parent
That sounds like a bad idea in many cases. Prone to many kinds of problems, like accidentally corrupting the stored state beyond recognition from a tiny application bug.