1,606 karma · joined Nov 12, 2012 (14y ago) · 758 submissions
comment 7y ago · link · parent
"Don't patronise me.” -> "No me patrocines.”
“Don’t patronize me.” -> "No me patrocines.”
"Don't patronise me!” -> "¡No me patrocines!”
“Don’t patronize me!” -> "¡No me patrocines!”
"Do not patronise me.” -> "No me patrocines.”
"Do not patronize me.” -> "No seas condescendiente conmigo.”
“Do not patronise me!” -> "¡No me patrocines!”
"Do not patronize me!” -> "No seas condescendiente conmigo.”
Word-sense disambiguation seems to work if you write “do not” instead of “don’t” and use ‘-ize' spelling, it fails otherwise.
33.
Australian National University hit by data breach(theguardian.com ↗)
1 points · by thomasfoster96 · 7y ago · discuss
comment 7y ago · link · parent
comment 7y ago · link · parent
I can’t find the link which details this right now, but I believe there are/were some cases where Flow’s syntax isn’t strictly a superset of JavaScript (to do with generics and comparison operators). I’m not sure whether TypeScript has the same problem or not.
comment 7y ago · link · parent
Still, when having to do things with JS/Python/C++ I’ve wasted many afternoons down the rabbit hole of trying to glean information from Github Issues, stackoverflow answers, Twitter threads and obscure forum threads — usually to find the problem (and fix) I ran into was so trivial it could have been a single line in an error message. (I feel like a lot of JS tools - particularly Webpack, Jest and Babel - have regressed a fair bit recently in this regard. Python just fails silently (or bizarrely) too often and C/C++ compiler error messages are often less readable than the code itself.)
comment 7y ago · link · parent
comment 7y ago · link · parent
comment 7y ago · link · parent
The book keeping could be moved into a couple of utility functions - it’d be largely the same for most custom hooks.
I’m also not sure relying on a linter is necessarily going to make static call Hooks simpler. Poorly written hooks are going to be buggy whether they’re Symbol keyed or not. I think that one of the big disadvantages of static call Hooks would seem to be that incorrect conditional usage could still accidentally work.
> My post does mention that we care about copy paste experience
I think I misunderstood that section when I first read it - it makes sense now. I’m not convinced it’s a huge win though.
> I later go into why allowing conditional declarations of state or effects isn’t even particularly useful or desirable because the semantics are too confusing.
We’ll have to agree to disagree - while I’m not eagerly wanting to use Hooks in conditionals, I dont think the semantics are that confusing.
comment 7y ago · link · parent
comment 7y ago · link · parent
> A key design goal is that creating a custom Hook is easy. You should be able to literally copy paste part of your component (e.g. a bunch of useState calls and some event handlers) and call it a day.
I'd totally understand that reasoning, because the keyed Hooks are more verbose and would generally require two or three parts of a component to be copy-pasted – but the examples under Flaws #3 and #5 didn't make this clear (to me at least), and I hadn’t seen ‘ease of custom Hook implementation’ cited as an argument against keyed hooks before.
I’m really just playing devil’s advocate here, because in my playing around with Hooks I haven’t yet found a case where keyed Hooks are necessary, but I have accidentally put calls to useState() inside a conditional a heap of times.
Edit: Flaw #5, not #7
comment 7y ago · link · parent
I would’ve used a WeakMap with Symbol keys that mapped to a list or object containing Symbols.
Sorry if I’m just overlooking something obvious, but most of the examples that I’ve seen to explain why Symbol keys aren’t better than the current proposal seem to be just be examples of badly implemented custom hooks, not necessarily flaws with Symbol keys per se.
comment 7y ago · link · parent
Also... a nitpick, but `new Symbol` always throws a TypeError. And Symbol.for() is a useful escape hatch.
comment 7y ago · link · parent
comment 7y ago · link · parent
I mean, in this scenario most Labor MPs keep their jobs, while thousands of people face an uncertain future as companies openly contemplate the risks of hiring Australians or doing business here, and perhaps millions risk their cybersecurity being covertly weakened. If you are subject to Australian law, you have just as much skin in this ‘game’ as the politicians themselves, if not more. After all, the law does apply to you.
> I wish the world were different, but it just isn't. Given a modest 1/10,000 possibility of some "terror" attack over Christmas, would a rational actor hang their political future on an issue that 99.99% of average Aussies don't understand?
Again, please define rational. Is Labor’s only rational plan to amass as much political power as possible at the least cost? To absolutely eliminate any risk of losing the next election by being as uncontroversial as possible? I’m not so cynical as to think there aren’t any technologically literate or principled people in the Labor Caucus, so I’m rather disappointed they simply went AWOL when they were needed most.
Labor just had an election in Victoria where News Corp went pretty hard after them on law and order for several months – yet they won. They weren’t going to lose federally in the next six months because of this bill.
> I hate this bill. I hate that we're moving in the direction of a world with mass surveillance, but realistically, if we take off our rose coloured glasses, and putting aside political idealism, would we expect Labor to do any different?
You’re sounding awfully defeatist. Labor didn’t have a gun to their head, either metaphorically or literally. They do actually have political power and they are allowed to use it. Be as cynical as you like, but opposition parties are still allowed to oppose things on principle.
comment 7y ago · link · parent
I absolutely, as an Australian citizen, resident and voter, have skin in the game.
Labor losing the next election just because they refused to pass this specific bill is an extremely unlikely course of events. I don’t find it particularly rational – especially when the urgency to do so is blatantly manufactured and it was so widely opposed by public submissions – to pass a potentially disastrous, under scrutinised and widely criticised law, just because you’re worried a hypothetical scare campaign might work. It sounds a lot like paranoia or cowardice.
> Politics isn't like Internet armchair quarterbacking, you do what you can to ensure that a) your position is safe, and b) that you will lose the battle to eventually win the war.
What’s the war here? If you keep losing battles you’re certain to lose the war.
If the war is the election, Labor could certainly have afforded to lose this PR battle. If the war is cybersecurity policy in Australia, then I think the tech industry and tech users are getting quite sick of people trying to make excuses for yet another surrender.
> The privilege of never compromising on your values is reserved for the rest of us who have nothing to lose by criticizing the process.
A lot of people have a lot to lose if the process is abused or outright fails.
comment 7y ago · link · parent
It’s legislative and electoral cowardice more than political pragmatism.
52.
The Cube Rule of Food Identification(cuberule.com ↗)
15 points · by thomasfoster96 · 7y ago · 5 comments
comment 7y ago · link · parent
I mean a collections of components like Polymer. Unless you plan on maintaining everything yourself, both React and Web Components share the same problem here.
> This universal compatibility and better reliability makes Web Components a better choice today for creating reusable components, than React.
You can mix and match any and all frameworks and Web Components if you try want. And again: React and Web Components mostly solve different problems. One isn’t going to directly cannibalise the other. You can use both.
comment 7y ago · link · parent
comment 7y ago · link · parent
Modules have existed in JavaScript for several years now, and there are numerous solutions for dealing with global CSS (CSS Modules, Glamor, etc). There are many large production web applications using React, probably generating billions of dollars worth of business - I don’t think they’re “brittle”.
> You can implement the same element as a Web Component and now it will work in any application regardless of framework... you can just drop in and it will work.
Sure, you can just drop a Web Component into any framework. People use React for a lot more than just defining components - they use it for data fetching, animations, etc.
> If your application has conflicting css classes or element ids or javascript variables the Web Component will still work reliably.
If this is the case I think you’ve got much bigger problems with your app than choosing which JavaScript library you’re going to use. React apps will work despite conflicting element IDs as well, but they’re still a bug in your app. Web Components don’t magically get rid of JavaScript variables. CSS classes still matter unless your whole app is going to live in the Shadow DOM, which isn’t really what the Shadow DOM is for.
> That’s hot! React components will feel a bit cold as cross-framework Web Components take over.
Again - you can use both. They solve different problems.
58.
Investigating Jeanne Calment’s Longevity Record(leafscience.org ↗)
4 points · by thomasfoster96 · 8y ago · discuss