Yeah in a billion years. We should figure out the common issues (tragedy of commons, etc) that will follow us wherever we go -- before we try to leave. A billion years is plenty of time to focus on that.
The earth hasn't always existed in its current state, or for that matter existed at all.
Once day the earth will almost certainly cease to exist and intelligence will have to find a new home of some kind. We have probably got a couple of billion years though if we are careful and I have no idea what intelligence will evolve to over that timeframe.
Definitely not the solution. Ending capitalism for some other form of economy is the only way in my opinion. Not that I don’t think people should be rewarded for the products and services they offer just that the incentive to make cheap shit and sell an upgrade every year is definitely harmful to our earth. The problem I see is I don’t know what type of economic solution there is that would fit.
I think the tools to solve the challenges of waste, environmental damage etc. already exist within the framework of capitalism. Mostly they are just unpopular and seen by many as a government overreach.
1. taxes that force corporations and individuals to pay for the negative externalities / social costs of their actions
2. regulation (e.g. stop allowing planned obsolence, mandate the right to repair etc.)
3. government spending into R&D, incentives and subsidies for renewables etc.
Anyway, my point is that the issue is basically one of co-ordination and political will. It obviously doesn't help that many Americans (and Australians too for that matter, where I live) don't accept the basic facts of the situation (before we can even discuss solutions).
>Anyway, my point is that the issue is basically one of co-ordination and political will
Again, what does "political will" mean? What are you going to do to those that disagree? Lock them up? Exterminate them? What is the solution to force people to do your bidding, and has it ever worked?
I assume they mean convince enough people to implement the proposed policies that they can fix things through normal, legal means. "Forcing people to do your bidding" normally consists of winning elections and then implementing and enforcing legislation. This is how we force people who want to shoplift, cheat on their taxes, or murder to do our bidding. It doesn't work perfectly, but it only has to work well enough.
Theft is also a problem of political will. If people would just not steal, the problem of theft would be solved. For some definition of "solution", it is a solution. But not a useful or realistic one. It's just not going to happen in any reasonable timeframe. Only if human nature itself changes in some distant future. Same thing applies to environmental damage.
I have yet to hear of an economic model that humans have discovered which is better than free market capitalism.
The issue isn't the cheap junk; it's the demand for the cheap junk. Things would be far more sustainable if people focused on reducing their consumption habbits, as producers would be run out of business.
The free market is probably the best we are going to get, but we need to address some of its known failure modes: externalities, monopolies, and the imbalance of power between employers and employees.
Externalities: any negative externality upon an involuntarily third party can become illegal via law. This can cover things like littering, servitude, etc.
Monopolies: the free market has yet to produce a monopoly that increases prices for consumers if there isn't a natural monopoly. The gov deals with allocation of naturally constrained resources such as radio frequencies.
Imbalance of power: just save more. Save enough so you can wake up comfortable with the idea that you were fired overnight. It dissolves any power imbalance when your boss needs you as much as you need the income.
Most will probably come from non-major cities and towns so I doubt it will be a problem. CCP knows they can take stuff pretty far. Probably only food production and fossil fuels are their chokepoints.
An Optional is just a tri-valued null (null, None, and Some), so no.
It'd be nice if Java had a concept of a never-null reference (like a C++ reference vs. a C++ pointer), but the @NotNull annotation wasn't enforced the last time I checked.
Also, there's no way for an object to express that invariant because encapsulation is so weak. Given only this constructor (and no reflection):
Foo() { foo.bar = new Bar(); /* foo.bar is final; Bar() does not throw */ }
callers can still get an instance of Foo with bar set to null.
Anyway, null handling in java somehow manages to be worse than C, where you can at least inline a struct into another, statically guaranteeing the instance of the inlined struct exists.
I can't think of another statically typed language that screws this up so badly. It just keeps getting worse with stuff like Optional and @NotNull.
(Disclaimer: I haven't followed java for 4-5 years; it's possible they finally fixed this stuff.)
Arguably yes, but that doesn't stop people using it.
Basically Java had nulls from the start. A decade or so later some people who didn't like nulls introduced their own Optional type, as a third-party library. Enough people liked it that Optional was added to Java's standard library.
But as it's just an object, it can be null. Some null avoidance enthusiasts also use third-party @Nullable and @NotNull annotations, which some automated code checking tools will attempt to verify during compile/test.
It gives you the ability to treat nulls as something-to-fix.
In a team without Optionals, every time you touch a null that you didn't expect, you have to decide "Is this deliberately null, or was it a mistake?" Without that knowledge, you don't know whether your code should assert against the null, or allow it to pass through as a valid value.
With Optionals, it becomes much simpler to cut through that nonsense. A null is a bug and you fix it (with the exception of json at the boundaries of your system, etc.) If you do find a value where you change your mind about its nullability, changing it to/from Optional will give you compile errors in exactly those other parts of the code that you now have to check/change.
Yup. Your IDE will likely highlight it as an issue, but it's totally legal to return a null Optional. There's nothing special about it, it's just a wrapper class.
It doesn’t defeat the problem in theory, but in my experience it does in practice. I’ve never come across an NPE on a nullable reference even in development - it would have to be the result of a really fundamental misunderstanding of the concept.
Assuming that was the only constructor you defined on class Foo, and you used this.bar instead of foo.bar (latter won't compile), then the caller can't possibly get a Foo with bar set to null (except by reflection, and there are ways to prevent that). Moreover, even if new Bar() did throw an (unchecked) exception, the invariant would still hold, since Foo would rethrow the exception. This has always been the case, as far as I know.
I think you're right, if access to shared is not in any way synchronized. But the correct way to handle this, at least in this case, is to mark shared as volatile, which guarantees thread B will only ever read null or a fully constructed Foo from shared. This has been the case since Java 5, released 20 years ago, thanks to JSR-133.
By that standard, C and C++ are much worse, since they offer no runtime encapsulation at all, and have much worse and more subtle multithreaded errors (e.g. Java at least guarantees that all native word sized reads/writes are atomic, if I recall correctly). C++ doesn't even guarantee that a reference can't be null, or worse, deallocated before it is dereferenced. They allow you to specify that a field is of some type and shouldn't be null, which is nice, but they don't enforce that in any way, they just call any code path that violates it UB.
For example, this is code that any C or C++ compiler will happily run and do something:
struct Bar {
int b;
};
struct Foo {
struct Bar bar;
} foo;
strcpy((char*)(&foo), "ABC");
Or in relation to null C++ references:
int& foo(int* p) {
return *p;
}
int &r = foo(nullptr); //UB, but in practice will likely result in a null reference at runtime
Similarly, accessing an object from multiple threads without synchronization means its value is not fully defined in Java. Unlike C or C++, it is at least known to be a Java type, not a memory corruption vulnerability.
We can quibble on definitions here, but a reference in C++ can not be null. The undefined behavior happens before any assignment to a reference is executed so that at the moment that the assignment happens, the reference is guaranteed to not be null.
In your example, it's the dereference of the pointer to p that is undefined behavior, so anything that happens after that point is also undefined behavior. Note that means there is never an actual assignment to r if p is null.
As I mentioned earlier, this might seem like quibbling with definitions, but this is the proper mental model to have with respect to C++'s semantics.
Having said that, I don't disagree with the main crux of your point, which is that C++'s semantics are terrible and there is little that the language provides to write correct code, but I do think there are subtleties on this matter that are worth clarifying.
I agree, but by that same definition, a private reference field in Java that is initialized in the constructor also can't be null.
My point is that we can compare two things: valid programs, or programs that compile.
In valid C++ programs, references can't be null and there are no data races. In valid Java programs, all final fields initialized in an object's constructor have that value for the lifetime of the object.
If we compare invalid programs that compile, which is an important point as well, then those guarantees go out the window. But here Java is much more forgiving than C++: if you have improper synchronization, you may see fields which are null instead of having their final value, which is bad and confusing. But in C++ with improper synchronization, you can see literally any outcome at all.
>An object is considered to be completely initialized when its constructor finishes. A thread that can only see a reference to an object after that object has been completely initialized is guaranteed to see the correctly initialized values for that object's final fields.
If you don't publish a reference to the object from within the constructor, you will not see a null value of the final field, even if the object itself was unsafely published across threads via a non-volatile field.
This too is thanks to JSR-133. In fact, it seems that, thanks to this part of JSR-133, what I said above about marking shared volatile is actually unnecessary. There must be a memory barrier somewhere, under the hood, though.
At least on android arm64, looks like a `dmb ishst` is emitted after the constructor, which allows future loads to not need an explicit barrier. Removing `final` from the field causes that barrier to not be emitted.
Yeah, I wish the VM would prevent null assignment of optional and force to empty. There are probably side effects I can’t think of here and certainly would cause problems with legacy code misusing optionals.
Not avoided altogether. Static checkers cannot possibly follow all code paths, and they generally err on the side of false negatives rather than risking too many false positives causing people to disable them.
Evolutionary part of the brain to always be looking for obstacles or issues with what's happening in the moment. Clearly humans who were more laissez faire, got eliminated either by nature or society.
Same here. Aerobic exercise, as a long exertion, probably activates some part of the brain that quells it.
That last part - was trance/prog house always like that? Or did it start more underground and organic in 1989 onward until the mid-90s where it became very commercial and then went to the next level with someone like Tiesto?
When those forms became distinguished as separate genres, basically yes. I think there was a vein of maybe more interesting "trance" in 92, 93 timeframe (I'm thinking about Oliver Lieb's stuff and maybe Rabbit in the Moon and some other stuff) that was a bit more techno-ish, but with some of the hallmarks of what came to be the "trance" form. But by the time people were specifically carving out "trance" it had basically the drum rolls and drug rush thing going on. By 96 when I started paying attention to that, it was already unbearable (to me).