News for hackers. Stuff that matters.

fgerschau

Re:Top Web Developer Blogs in 2020 on Friday June 19, 2020 @11:18AM (#23575330)
Thanks for sharing!
By that I mean that there's a difference between calling React's render function and rendering something to the browser DOM (native renders).

React will try to reduce the number of renders to the real DOM as much as possible, so calling a component's render functions doesn't always imply a re-paint of the UI.

Expanding a text box wouldn't usually trigger a re-render because this is being handled by the browser and doesn't affect the state of the application (just like any CSS rules). Reordering elements on the other hand will trigger a re-render because the actual HTML element's position has to change.

So yes, the argument is that the entire screen doesn't have to be repainted. In the ideal case it only repaints the parts of the UI that need to change.

Why write inefficient code when it's just as easy to do it right?

I also wrote an article about this, if you can write efficient code without sacrificing readability I think it's worth the (small) effort.

https://felixgerschau.com/premature-optimization-javascript

Re:Ask HN: Where do you store your photos? on Thursday February 06, 2020 @09:27AM (#22256155)
Sounds interesting! I don't like dropbox due to the price as well. Also, I'm looking for a better solution in terms of privacy, that's why I'm considering running my own little server
Re:Ask HN: What are you currently working on? on Thursday February 06, 2020 @03:44AM (#22254520)
Is it open source? Mind sharing a link?
Re:Ask HN: What are you currently working on? on Thursday February 06, 2020 @03:44AM (#22254519)
I'm working on pomodoro-timer.app. My next step is to publish it as a PWA to the google play store :)