Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
petilon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
301.
▲
by
petilon
4y ago
One of the biggest issues in React that I have come across is that you have to make copies of objects and arrays (as mentioned in this article) when calling setState(). Cloning works well for small arrays and objects (I use the code below f
302.
▲
by
petilon
4y ago
Incorrect. In fact, you can use React as the 'V' in MVC. That's how it was orignally designed. See here: https://github.com/facebook/react/tree/015833e5942ce55cf31ae... I am done with this thre
303.
▲
by
petilon
4y ago
MVC is unidirectional.
304.
▲
by
petilon
4y ago
LLMs are no different from us, because we modeled it after our brains. These papers suggest we are just predicting the next word: https://www.psycholinguistics.com/gerry_altmann/research/pap... https://
305.
▲
by
petilon
4y ago
I think you're thinking of MVVM, not MVC.
306.
▲
by
petilon
4y ago
So you're building business logic into your view components? This used to be simple in the old days when we used MVC.
307.
▲
by
petilon
4y ago
It is idiomatic JavaScript. If you learned Java at the university you'll immediately be comfortable with the code. Now consider React with hooks. It is neither OOP nor functional and it looks alien to anyone who knows idiomatic Java or
308.
▲
by
petilon
4y ago
There is no jQuery or React being used. You can use TSX without using React. See https://github.com/wisercoder/uibuilder
309.
▲
by
petilon
4y ago
The timing hack is a workaround for a browser bug. The exact same hack would be required in React as well. What is this browser bug I speak of? Browsers send a spurious "hover" event when you stop scrolling, so that the item under
310.
▲
by
petilon
4y ago
What is the point of REST API for the database? Why can't an application go directly to the database and run SQL?
311.
▲
by
petilon
4y ago
That would be cool, if true. I would like to see what the underlying query looks like, and whether it is efficient.
312.
▲
by
petilon
4y ago
In your home screen ( https://www.plato.io/ ) the screenshot has a Purchase column that has multiple values. Does that not violate 1NF? The first normal form (1NF) requires that each column in a table must hold atomic (indi
313.
▲
by
petilon
4y ago
But there must be a limit to how many rows you can display on screen efficiently, right?
314.
▲
by
petilon
4y ago
What is the maximum number of rows supported? What data types are supported? Do you support images and attachments?
315.
▲
by
petilon
4y ago
Can you clarify what you mean here? What state is in DOM? Do you mean the state inherent in input elements? What timing hacks are you talking about?
316.
▲
by
petilon
4y ago
None of that is true in React hooks. The negative sentiment towards hooks that you see here is because it is weird and complicated. Want to see how much simpler code can get when you code without React or any such fat frameworks? Take a loo
317.
▲
by
petilon
4y ago
Why is it necessary to use FP to write software that runs in web browsers? To be sure, FP has benefits (such as, it is much more straightforward to reason about FP code), but those benefits are not applicable in React. So why pretend it is
318.
▲
by
petilon
4y ago
I think you may be missing the forest for the trees. The point of FP is that you can glance at a function and say 'this is obviously correct' without having to work out the state and context of every call.
319.
▲
by
petilon
4y ago
Don't call this functional programming. If you call setCount() then this is not functional because your function is doing something besides returning a value. In fact, it is setting state, which is against FP principles.
320.
▲
by
petilon
4y ago
> ...and capture a sequential list of updates when you call setState. In functional programming, functions are not allowed to do that. The only thing a function is allowed to do is return a value. > ... you reach out up the stack to
321.
▲
by
petilon
4y ago
This is a great article on the frankenstein (neither OOP nor functional) that is hooks: https://medium.com/codex/can-we-all-just-admit-react-hooks-w...
322.
▲
by
petilon
4y ago
> useEffect is a side effect and if you use it you're gonna have a bad time. Right.. but then you can't really use React for building serious UI.
323.
▲
by
petilon
4y ago
> Ultimately, React is f(newState) => UI. If that function isn't pure you're gonna have a bad time. React is not that at all. Unless your UI is very simple, React is not f(newState) => UI. React isn't functional. M
324.
▲
by
petilon
4y ago
There is this belief among some, that the wealthy have an advantage when it comes to standardized tests such as SAT. This isn't true. Correlation isn't causation. You can't use your wealth to buy SAT scores. The best SAT tuto
325.
▲
by
petilon
4y ago
I don't get the point of Bing Chat. As a chat, it is not as good or knowledgeable as ChatGPT. As a search it is not as good as Google or even Bing. I don't know what I would use Bing Chat for.
326.
▲
by
petilon
4y ago
They jumped the gun... April 1st is still 4 weeks away.
327.
▲
by
petilon
4y ago
Calling it a spreadsheet and making it look and work like a spreadsheet is a bad idea, because now you're competing against Excel.
328.
▲
by
petilon
4y ago
> Laura sounds very realistic... Zod is a bit less so I thought so too. What do they use for text to voice?
329.
▲
by
petilon
4y ago
If null references are a mistake, isn't initializing an array index variable to -1 a mistake too?
330.
▲
by
petilon
4y ago
In related news, Tesla has been forced to tell the truth about "Full" Self Driving: https://electrek.co/2023/02/27/tesla-disappoints-owners-upda...
More ›