> The caller has free choice over the returned lifetime, including 'static. Indeed, this function is ideally used for data that lives for the remainder of the program’s life, as dropping the returned reference will cause a memory leak.
I can see the use case of the function and from reading the commit discussion, it seems it was based on Vec::<u8>::leak() but I'm not able to understand why either of the functions are safe instead of unsafe.
Bjarne Stroustrup is emphatic that prohibiting all leaks must be part of safety, but I have no idea what the logical justification is to distinguish say Box::leak, which this prohibits, from the moral equivalent of freeing resources only on exit, which is fine under such a rule.
It composes (if A doesn't leak and B doesn't leak, then a combination AB also does not leak) which is a property safety also has, but I don't see another connection.
If you're in it for the long haul (1-2 years), I'd recommend working through the recommendations in https://www.teachyourselfcs.com/. The Algorithms part, the Networks part and DDIA all have a very high return on time invested.
I'm not aware what exactly the German government has said in the past w.r.t mask usage. However, governments claiming mask usage was not required near the start of the pandemic followed by them later requiring people to use masks was actually an understandable decision on their part from what I've understood of the situation as it unveiled.
At the beginning of the pandemic, it was believed that the virus was using droplet transmission alone. In such a scenario, surgical masks, for the general public, would only be required in people who were sick to prevent transmission and N95 masks would primarily be required by health care workers. Considering the mask shortages faced in many countries at the time due to panic buying, the communications made by governments to the public w.r.t the benefits of masks make sense from a cost benefit perspective since it would guarantee that the people who needed the masks the most (medical workers and sick people) would receive them and reduce the spread of the virus.
Fast forward 2 months later, airborne transmission as well as asymptomatic transmission of the virus were both confirmed independently in several labs. This would mean that the prior strategy of only using surgical masks on sick people wouldn't really work well anymore. In the meanwhile, the availability of masks was much higher due to increased production. Hence, to reduce the risks of airborne and asymptomatic transmissions, governments released advisories asking all people to wear masks.
Governments didn't say that a mask wasn't required. They said masks didn't help (presumably to prevent a run on them). It's definitely an understandable decision, but there's a big problem with it.
When officials start doing this, you have to play a sort of game where you try to figure out why they said something and what it signifies. You have to try to divine the state of reality and figure out what to do based on what you think they were trying to get people to do (there's a lot of uncertainty in this).
By that point, by definition, trust in the person (and probably the institution) is gone, and we don't have a lot of trust in institutions to spare.
Indeed. I'm quite furious that my government (Finland) ordered such a "mask assessment" from a retired professor, in order to reduce the political pressure caused by PPE shortages.
Now anti-maskers and other covid deniers are citing that report: "don't do anything, even the government research says it is useless".
I was well aware even by March that masks were the way to go. It was a simple lie, by e.g. the Surgeon General, in order to try to save masks (while they didn't even start ramping production of them!)
But of course if a government official lies to you about your own health risks then that has very high costs, much higher than whatever masks were saved. They could have just said "masks are useful, but you need to be trained to use them correctly, they are difficult to manipulate, etc. and they are very scarce so sadly let's stay home and let doctors and nurses use them".
I might sound as if I'm upset at that, because I REALLY am. I hate when governments lie, even if they are "white lies", and I hate when they treat their constituents as kids.
The lesson from 1918 for public health is that if you lie to or mislead the public once, even if by accident, you have reduced credibility in the future and are less likely to have the public listen to you. The authorities didn't learn this lesson and instead misled the public for 2 months, then did a 180 and expected people to blindly listen to them again.
As a citizen, would you trust the government if they did yet another 180, after demonstrating to you 2x that they didn't actually know what they were talking about?
> As a citizen, would you trust the government if they did yet another 180, after demonstrating to you 2x that they didn't actually know what they were talking about?
One of the many things that I've learned from this pandemic is that for better or worse, the answer to this question is emphatically yes for a significant percentage of the population. Many folks will indeed blindly trust whatever they are currently being told by people they believe are authorities or experts. At times this may be a good thing, but I personally lean toward thinking it's not good overall. And as you correctly point out, another big chunk of people will understandably lose faith in institutions and authorities that either were wrong or simply lied, which I'd argue likely causes significant long term damage to the healthy functioning of a society.
Even if it was believed that sick people wearing mask would be enough, there will be asymptomatic infections as well as the social stigma of wearing a mask if only sick people do it. The only way that enough people wear masks is to have everyone do it.
> Considering the mask shortages faced in many countries at the time due to panic buying, the communications made by governments to the public w.r.t the benefits of masks make sense from a cost benefit perspective since it would guarantee that the people who needed the masks the most (medical workers and sick people) would receive them and reduce the spread of the virus.
The government lying to its people is never acceptable. Also, there was plenty of time to ramp up mask production when the virus was spreading in China and later Italy. Taiwan did this successfully, why did supposedly more developed countries fail so badly at ensuring adequate mask supply?
Truth does not work that way. If you have to prioritize masks for something, regulate that market down - by simply making it a crime to deal with them without offering them to the government first.
Small nitpick here. For drugs, novel drugs in particular, 20 years is actually the required amount of time for the pharma companies to actually turn a profit. The patent applications are submitted as soon as a viable drug is discovered. After this, it requires 10-15 years of animal testing, clinical trials, etc with costs amounting to 100s of millions to billions of dollars before it can be brought to market.
> The caller has free choice over the returned lifetime, including 'static. Indeed, this function is ideally used for data that lives for the remainder of the program’s life, as dropping the returned reference will cause a memory leak.
I can see the use case of the function and from reading the commit discussion, it seems it was based on Vec::<u8>::leak() but I'm not able to understand why either of the functions are safe instead of unsafe.