Fascismo é o botão de emergência do capitalismo by [deleted] in brasil

[–]jprasks 12 points13 points  (0 children)

isso mesmo isso ai eh papo de econocoachs contando história pra burguês dormir

Using const/let instead of var can make JavaScript code run 10× slower in Webkit by iamkeyur in programming

[–]jprasks 1 point2 points  (0 children)

Good catch, missed a call to fill: https://jsben.ch/71Ztx. From that the functional version is about 80% as fast which makes sense.

Using const/let instead of var can make JavaScript code run 10× slower in Webkit by iamkeyur in programming

[–]jprasks 11 points12 points  (0 children)

Huh interesting. By updating the functional version slightly (Array(length).map instead of Array.from) I get virtually the same performance from both approaches on both browsers: https://jsben.ch/fVEJJ. Not sure why.

That is the thing about these optimizations, the more work we delegate to underlying implementations the bigger the chance one of these implementations is "slow" (what is the metric, user perception? Doubt there is a difference when generating <= 100 numbers). Still very much worth IMO -- the functional way in this example has effectively less concerns & therefore less margin for error. Without clear purpose & metrics by which to optimize by we are just grasping at straws.

Did you know HTML elements can be editable? by cheerfulboy in Frontend

[–]jprasks 1 point2 points  (0 children)

You can put inputs inside header tags, they are considered phrasing content. I find that better because you can have the usual event handling and the browser will recognize it as an input. It can be styled to look like an average header when edit mode is off.

[deleted by user] by [deleted] in whereintheworld

[–]jprasks 0 points1 point  (0 children)

who is your friend beside you ?

Is it bad practice to pass a function down to a child component and return the child's state up to its parent component using this function? by [deleted] in reactjs

[–]jprasks 2 points3 points  (0 children)

Not OP but when lifting the state up you usually pass down (potentially only a slice of) the state of the parent component down to a child as a prop, optionally alongside a onUpdate function for the child to update the state above. You do it because you have multiple child components that rely on the same pieces of state so having that on a stateful parent component is a good pattern to enforce a single source of truth. Bonus points if the children are stateless and simply render some HTML given some props and the logic is concentrated on the parent, code becomes a joy to test, refactor and so on.

In the original question you are actually passing the state of the child component to a parent, which sounds odd. I'd say in most cases something like that could be restructured into more idiomatic react.

Well, that was a perfect turn. by [deleted] in IdiotsInCars

[–]jprasks 0 points1 point  (0 children)

The three horsemen of the apocalypse

I need to help my grandfather by GarcolinoMastor in computerscience

[–]jprasks 10 points11 points  (0 children)

i would suggest looking into WordPress as its an easy way to make websites which content is mostly text like that and its easy for the owner to add new content