Is it...? I feel like there's a lot more to unpack here. What if the thing a person fell in love with was that somebody just had more power (over them)?
I'd argue that people should fall in love on equal grounds, so the personality of a partner matters more than the perceived status of power.
If I understand you correctly, #1 is just plain wrong. JSX is transformed into standard ECMAScript[0]. You can store JSX-nodes in variables and pass them around however you like.
// this
{
shouldShowAnswer(user)
? no
:
Text Content
}
// ...can be written like this
const answer = (
no
);
const comment = (
Text Content
);
const result = shouldShowAnswer(user) ? answer : comment;
{result}
In React at least, null won't render anything.
#2 is a known trade-off, and so marginal and well known that it's almost not worth mentioning it.
It’s not wrong, this is a limitation of JSX, every interpolation needs to be a statement.
Ofcourse you can split every control flow into separate component and combine them together finally, but that means exactly that - that every minute condition or iteration is deferred elsewhere. And it makes the actual render result hard to understand.
At this point I honestly don't know what you're on about...
> every interpolation needs to be a statement
Interpolation??? JSX extends the PrimaryExpression in the ECMAScript grammar. So yeah, every JSX element/fragment is an expression, not a statement. You can't seriously consider an ECMAScript expression a limitation?
> you can split control flow into separate component[s]
You do realize that none of the variables in the example above are components, do you? They are the result of JSX elements, and if we're talking React they'd be React elements.
> combine them together [...] makes the actual render result hard to understand
So, for you, a long ECMAScript expression is a limiting factor, but composing shorter, simpler expressions into a longer, more complex one is hard to understand. Even though in your comment above you wrote:
I may have mixed between expression and statement, however in JSX {} must return exactly 1 expression, so that limits the amount of code you can place there.
Your'e missing the point arguing about semantics of components or JSX elements, the point is that if you want to avoid control flow via expressions, you must destruct you template (however simple it may be) into tiny template fragments that makes it harder to understand the complete rendered picture.
Imaging if JSX could look like this:
My list
@for(item in list) {
{item.name}
@if(item.loading){
Loading...
} @else if (item.error) {
Error loading item
} @else {
{item.description}
}
}
This is much easier than the suggested JSX approach:
The suggested JSX approach depends on the example you just made up, and EMCAScripts statements are enough, there's no need to redefine them in JSX.
My list
{
list.map((item) => {
let text = null;
if (item.loading) {
text = "Loading...";
} else if (item.error) {
text = "Error loading item";
} else {
text = item.description;
}
return (
<>
{item.name}
{text}
>
);
})
}
or (btw, I have never seen somebody creating a component for a list)
function Item({item}) {
let text = null;
if (item.loading) {
text = "Loading...";
} else if (item.error) {
text = "Error loading item";
} else {
text = item.description;
}
return (
<>
{item.name}
{text}
>
);
};
My list
{list.map(item => )}
I still don't see any limitation. The @statement-things don't read better either.
Anyway, thanks for the quick human exchange of opinions!
In my suggestion I demonstrated a theoretical approach to how I think JSX shouldve been done.
JSX eventually is not a templating engine, it’s just sugar over createComponent/createElement functions, and thats its downside, we are creating html components that need templates to render.
I also don't quite get your complaint... asyncio provides a high-level concurrency primitive with coroutines, and that's a good enough primitive for workflow engines. Even with asyncio you could fork/spawn processes easily with aiomultiprocess[1], if you'd ever want or need to.
What's your use case for having more low-level concurrency primitives (threads/processes) available, having to deal with their synchronization, and running workflows sync?
No such thing is typically necessary. If modeled correctly, the need for synchronization is minimal.
With sync code, tasks run on different threads/interpreters/processes. Message passing via queues is used to communicate which tasks need to run. Many asyncio users seem to wholly unaware of how well it works. Go-lang doesn't even have or need async.
I actually like asyncio; I am just not a religious zealot about it as many here seem to be, also without awareness of the struggles they face with loop-hogging coroutines and multicore parallelism.
I'm all-in on the Apple ecosystem and so I have my passwords almost everywhere that way. But like, I have a lot of devices and a whole family. Sometimes it turns out one is not set up properly and I logged in with a QR code.
I had similar problems for a while. Especially Safari tabs that were dumped from memory on iOS. Logging in again was annoying. A quite over-engineered solution that slowly evolved in my Kagi usage uses Tailscale Golink [0].
Case 1: Kagi extension for Safari redirects from Ecosia to Kagi when on the good path. I rely on this mostly because it’s first-party so there’s a bit more trust with my queries.
Case 2: Safari Redirect Extension [1] redirects unauthenticated Kagi pages to Golink. Golink redirects back to the original page with a Kagi Token appended. Instantly authenticated.
Also, I highly recommend setting custom DNS records on Ecosia/DDG/whoever-you-redirect-from to prevent query leakage.
Ah forgot to explicitly point out that this fixes the multiple-device log-in problem. All my devices end up redirected through that single point of Golink which appends the token.
There might be some interesting factors that affect quality and convenience. GP already mentioned corrective glasses, then there are probably many more things to consider, like low-light environments, having a full beard, etc.
The choice of technology being used (camera VS radar) might have various trade-offs, and it's worthwhile to discuss them.
EDIT: Granted, GP could've asked in a less dismissive way.
HackerUsers: List of HN accounts and their skill set. Since I already got emails from my HN comments I'm sure some big consultancy companies already have this in place.
What makes you think it's fixed? They just state that they "blocked the exploit", and that could mean anything:
- did they just take the affected API offline?
- or did they just disable the account of the attacker?
- or is the exploit actually being fixed?
Environment variables are sensible data, and marking a security incident as resolved with that little detail is quite a take. Even changelog entries for harmless bug fixes are more detailed.
I assume it's fixed based on it being marked resolved and from what was communicated. Yeah I agree it's a major issue but if it's fixed what they have done so far seems totally fine
reply