- I was afraid it would change the language culture
- It was not comfortable to use
- The idea and design was, as you said, bizarre
- Use use a dynamic language, why the hell would I want that?
Years after the fact, I'm really happy about it.
First, most of my Python code don't use them, so Python stays python. But if I ever need them, there are here.
Of course, you could argue I should just use a language that has been designed for that since I need type. But that's missing the point: I don't usually start using hints. I code regular Python, because it's awesome. I just sometimes add type hints after the fact as a bonus.
The ability to do that is fantastic, even if the type system is far from perfect.
I want to code with Python most of the time anyway. I personally have very few use cases for another language, doing mostly web stuff.
Type hints are still very verbose, and convoluted, although it will get better with 3.9 thanks to 2 PEP targeting type hints ergonomics. So sure, it's never going to fit perfectly, but I'm glad it's here.
Now for a JSON schema, I guess it's the same deal. You use JSON because it fits your use case, and one day you realize your situation could now benefit from more robustness, and you add it to the mix.
Again, you could argue you should have though of that at the beginning, but projects don't have frozen requirements, they evolve. And often, you want to start lean, because it will most probably stays that way, and otherwise would be so costly the project would never grow to a point you would need robustness.
Now in this particular case, this lib is not just checking type, but also arbitrary logic. And making sure data is consistent is necessary no matter how dynamic or static your language is. There is a limit to the constraints your type system can represent.
I've worked with Python professionally for 3-5 years, but only type-hinted Python for ~5 months. This is coming from someone who prefers Java, but I don't like Python type hints because they were bolted onto the language worse than classes, type hierarchies aren't mature, and if I wanted types, I'd be using Java. That said, you do need strong typing for a project once it hits a certain line count or developer count.
Java's type system is weaker than what Python's typing provides. If you want to make fun of Python's type system, compare it to TypeScript, ocaml or haskell. Python's typing is actually useful even if it's bolted on and the typeshed is incomplete.
I led a project for validating customer-provided data against a json schema. The structure of the data was moderately complex, and it was getting bound to pojos by a pretty lenient binder. This caused issues when making additions to the API since customers were sending arbitrary fields, and duck typing the data wasn't that reliable. The easiest thing to validate before binding with a json schema.
What's different this and Python type hints is that this was a public-facing API, so you have far less control over what data you'll see, and the server code was Java, so getting things strongly typed and validated early on makes your life easier.
Schema validation is more than type checking, and has been very well solved by libraries like marshmallow and pydantic for a long time. I don't think the comparison holds.
There are languages though like eg: Groovy where gradual typing is more designed in. It's unfortunate to me that Python has cultivated this attititude because it's like local maxima that prevents the mainstream getting to soemthing better. Python is the new perl / PHP etc.
I mean the attitude that Python is "good enough" because it has type hinting and therefore it is not worth bothering with exploring other languages, especially ones that have wholly more powerful type systems. I have found (personal experience only here) that it can be tremendously hard to get Python programmers to learn and embrace other languages and approaches to software.
that's true of any sufficiently popular tech stack. some people get either way too attached to their beloved language (...do carpenters fall in love with hammers?) or just are too lazy to learn something else - assuming that programming is their profession and not just a means to an end.
I'm curious how many of those operate independently from Amazon. In the US at least, there are several storefronts that (on the back-end) actually contract out warehousing or shipping to AMZN.
All of these examples are large independent companies that operate without Amazon network. Very few French companies use Amazon to ship products, and only small ones.
Fnac and darty now have a so called "marketplace", like amazon, which means resellers. Some friends of mine ordered a Vitamix blender, which was from a reseller. The later just ordered it on amazon, and sent to him.
I find it hilarious, and a bit sad at the same time.
rueducommerce is operated by carefour, while cdiscount is operated by geant. These are the two biggest supermarket chains in France, like wallmart and costco in the US.
And all those other websites should have to comply with the exact same restrictions or shut down. The law should not be applied unequally to just one company.
> The $1.1 trillion company was given 24 hours on Tuesday to comply with the ruling to sell only essential items such as food and hygiene products, and to upgrade its health-security procedures.
> order the online shop to limit itself to sell "essential products" (food, hygiene or medical) as long as the sanitary risks of the activity in the warehouse haven't been evaluated
>But the American e-commerce giant was condemned to "restrict the activities of [its] warehouses to receiving goods, preparing and shipping orders for food, hygiene and medical products", "until the company has carried out, with the participation of employee representatives, an assessment of the occupational risks inherent in the Covid-19 epidemic in all of its distribution centres and the resulting measures".
Or rather we don't agree with the notion that companies stand above the laws of a country. The USA has insane bias towards companies to the extent they get better benefit as people and even qualify as people.
Obviously $1mil per infraction is a bit lopsided when the definition of which products are infracting is not clearly spelled out. Likewise, coordinating a review and implementing all measures in a 24h period is obviously not feasible when that hasn't happened over the last month(s).
This was phrased as a threat in the article title, but I don't see how Amazon had any choice until implementation of measures is either done or they have an answer to a court appeal. Likewise, there could be a case to be made that measures should already be implemented, but there is no documentation in the article over what progress there has already happened. Per this court order and event, I again don't see another response by them.
My understanding per the article is that this is not about applying a uniform set of safety standards, so there is no legal template we as outsiders can use - say, the safety standards implemented by their French competitors - to judge whether this order is or is not "fair". I also don't think it is my place to judge. Instead, Amazon has the right to determine whether or not they provide service within a country under that country's laws, and to raise awareness if _they_ feel the judicial system is giving illegal preferential treatment disguised in the context of crisis response. I don't see that as happening here either, though - at least not yet.
I have to guess at what you're referring to, since you're not specific, but let's say for example, you're asking why a company should be regulated in hiring and firing, since freedom of association is a human right.
The obvious answer, to me, is that the hiring and firing involves the abstraction of the company, and is not predominantly a product of a human, but a system. When a manager fires someone, they're not acting as an individual human being, just as when a police officer coerces or shoots someone they aren't doing it based on universal rules for people.
Your argument makes more sense when applied to a sole proprietor. And I think that the legal system recognizes this sort of thing because it makes sense. For instance, if you are renting out a room in your home, you aren't held to the same non-discrimination requirements (in the US) as otherwise.
It's a very common if not universal complaint among libertarian anarchist types that police and/or other government employees shouldn't be subject to different rules from the rest of us. It seems obvious that like it or not, they are in present society.
I'm not suggesting I'm in favor or against it, just acknowledging that the rules for what's acceptable depend on what collective entity you're part of. It doesn't seem peculiar to me if there are always non-individual responsibilities to go with non-individual powers.
As the law is written, police officers in the US are not allowed to shoot or kill people in circumstances where non-police cannot.
This is why you hear the common police trope of “I feared for my life”.
In practice, of course, the prosecutors will aggressively prosecute people defending their own homes from intruders, and fail to prosecute police engaging in premeditated murder; but that of course is a different story. The legal framework, in theory, provides them no special privileges to kill.
The police, by law, are allowed to create circumstances that non-police are not.
However, even if they weren't, it's irrelevant to my point, that people, including but not limited to the police, have powers that come from their membership in an abstract entity, and it's perfectly natural for them to have regulation of those privileges as well.
Yes, but most people don't like their job, and don't want to be productive in it. On HN, we have a lot of passionate people, but as soon as I go into the corporate world or the administrations, the feedback people give changes a lot.
IT is the far west. There are few educational requirements, and hiring laws specific to our craft. It's a very young field, unlike medicine or architecture, and we just beginning to establish professional standards on the job.
The fact most people see it as magic and can't evaluate it at all doesn't help.
Anecdotally, I've seen many programmers that can't code.
Remember that 2 dev projects out of 3 fail, for a clusters of reasons. And when it doesn't, there is sometimes a few hard kernel of devs that are doing most of the important part of the job, fixing other's mess on the fly, or just plainly doing it for them.
So those bad programmers can go from failure to failure, and never be blamed for it.
But honestly, it it weren't that way, I couldn't have entered the field. I've been given my chance more than once, and I've screwed up many times, before even becoming a decent professional.
I think it's very nice, and should be the default behavior. Ergonomics of GNU tooling is lacking to say the least. That's why we love fdfind and ripgrep and love find/grep way less.
I would use it if it were the default behavior, but the problem is already solved by the "moreutils" package, which I install on all my machines. This lets you do:
vidir filename
or
vidir directory # default to .
And it will open your $EDITOR with one file name per line. You edit it in the comfort of your favorite editor, and it batch renames for you, or rename the single file for the first case.
Note that if you use vscode, $EDITOR should be "code -w", not just "code".
It's more subtle than that. Here's some background before I answer your question.
One doctor has said that corona patients should be treated like altitude sickness patients, not like viral patients (and this Wuhan article implies that.)
All doctors say that ventilator intubation is the equivalent of major surgery, requiring anesthetics for the duration of ventilation and a long recovery period. High air pressure damages lung tissue, so afterwards you won't be walking or talking much for weeks or months.
So when you put those together, the best US approach today so far is to provide supplemental oxygen with face masks or cannula until the patient faints repeatedly (turns blue or purple), then make a decision to intubate. (China learned and published this in Jan. or Feb., but we learned it in Mar. or Apr.)
The only problem there is that mouth-breathing patients aerosolize corona virua and infect staff and other patients, so they should be moved out of the hospital to a quarantine facility or sent home. I don't think we are doing this yet, and it's an important step to stopping lockdown since we'll have thousands of new patients to monitor and help breathe.
The US mistakes made pre-Apr. 1 were early intubation based on traditional oxygen level monitoring (and to prevent aerosolization to protect staff.) That had a 66% - 90% mortality rate and consumed too many ventilators.
> out best chance now is not to cure them, but to help them survive until their immune system fight it off?
There is no plan, cure or pattern except we give them oxygen and see what happens next. We have no diagnostic tools that tell us cause and effect. For example, X-rays can show corona virus lung congestion, but there's no measurement or inference we can draw from any image. All we know is that ventilators are a one-way trip for most patients. It is what it is.
In a less political time with more open societies, we could confirm earlier research started by the Chinese, giving us lead times for our doctors to confirm their theories, which would help get to a scientifically proven and recommended course of action. (Like the pre-print that discusses COVID-19 attacking hemoglobin which then inhibits the ability for the blood to hold oxygen.)
Unfortunately, nationalism has kicked in, and there are rumors that China is censoring any papers that discuss a possible origin, hindering progress.
So now all we can do is give oxygen and hope for the best.
One thing that might help for the general population could be iron supplements. Not to prevent infection but to help the body to respond to low oxygen levels if you become infected.
Maybe. There's a pre-print, not-(yet?)-peer-reviewed paper[0] that theorizes that SARS-Cov-2 directly inhibits the ability of red blood cells to carry oxygen by binding in the place of iron (approximately)[1].
If this is true, then iron supplements could be dangerous, as too much iron is toxic, possibly fatal.
[0] The paper's abstract explicitly calls out the status of the research: "This paper is only for academic discussion, the correctness needs to be confirmed by other laboratories. Due to the side effects and allergic reactions of drugs such as chloroquine, please consult a qualified doctor for treatment details, and do not take the medicine yourself."
- I was afraid it would change the language culture
- It was not comfortable to use
- The idea and design was, as you said, bizarre
- Use use a dynamic language, why the hell would I want that?
Years after the fact, I'm really happy about it.
First, most of my Python code don't use them, so Python stays python. But if I ever need them, there are here.
Of course, you could argue I should just use a language that has been designed for that since I need type. But that's missing the point: I don't usually start using hints. I code regular Python, because it's awesome. I just sometimes add type hints after the fact as a bonus.
The ability to do that is fantastic, even if the type system is far from perfect.
I want to code with Python most of the time anyway. I personally have very few use cases for another language, doing mostly web stuff.
Type hints are still very verbose, and convoluted, although it will get better with 3.9 thanks to 2 PEP targeting type hints ergonomics. So sure, it's never going to fit perfectly, but I'm glad it's here.
Now for a JSON schema, I guess it's the same deal. You use JSON because it fits your use case, and one day you realize your situation could now benefit from more robustness, and you add it to the mix.
Again, you could argue you should have though of that at the beginning, but projects don't have frozen requirements, they evolve. And often, you want to start lean, because it will most probably stays that way, and otherwise would be so costly the project would never grow to a point you would need robustness.
Now in this particular case, this lib is not just checking type, but also arbitrary logic. And making sure data is consistent is necessary no matter how dynamic or static your language is. There is a limit to the constraints your type system can represent.