News for hackers. Stuff that matters.

bmuon

Re:My First CSS on Monday July 26, 2021 @03:23PM (#27964108)
This makes me very happy.

As a frontend engineer who started 15 years ago, learning the box model required a lot of knowledge of the internals of the browser. The times of having to know things like quirks mode, abusing overflow hidden [1], how to break the behavior of float, etc are long gone. This is great both for us having to struggle less, and for the newer generations to be able to tackle harder problems than just layout and build cooler stuff.

[1]: https://css-tricks.com/clearfix-a-lesson-in-web-development-...

Re:Virtual DOM is pure overhead (2018) on Tuesday June 29, 2021 @10:41AM (#27676467)
> I am convinced that if react really wanted to, they could make optimizations to make it really close to svelte

Facebook has been working for a while on Ahead-Of-Time compilation for React. Interestingly, it looks like they thought the problem was too complicated and they gave up:

> To address this challenge we initially experimented with one approach to ahead-of-time (AOT) optimization — Prepack — but ultimately that direction did not pan out. Specifically, we realized that many AOT optimizations don’t work because they either don’t have enough global knowledge or they have too little. For example, a component might be static in practice because it always receive a constant string from its parent, but the compiler can’t see that far and thinks the component is dynamic. Even when we could make optimizations work, we found that they were unpredictable to the developer. Without predictability it was hard for developers to rely on them.

Instead they're now experimenting with moving the virtual DOM resolution to the server and avoiding sending all the "templating" code to the client, which achieves a similar result. See https://reactjs.org/blog/2020/12/21/data-fetching-with-react....

Re:Virtual DOM is pure overhead (2018) on Tuesday June 29, 2021 @10:33AM (#27676327)
Yes and no.

Browser differences are mostly disappearing, they have gained some very good APIs are CSS has gained significant layout capabilities with grids and flex. So the need for libraries like jQuery for dealing with DOM differences is disappearing. New standard libraries like Intl and now Temporal make libraries like Moment obsolete.

The web is also gaining a component model with Web Components that will help you get some level of sanity when building some mildly complex reusable stuff. This is probably very good for content heavy sites, which make the majority of the web.

The other part of the web is applications running on top of the Web platform. Those still heavily benefit from frameworks. Having some amount of sanity when managing state is very much welcome. And functional programming models have proven that a declarative way of approaching UIs is much better than dealing with browser APIs imperatively.

So for some years frameworks will still be useful for certain use cases. For the others, we should be embracing Web technologies. Maybe with some light libraries like Stencil and Catalyst.

You don't need a zoned date. You can invert the question and ask if a zoned datetime falls within a plain date.

Temporal is very well designed thanks to building on years of prior art. Give it a try and you'll realize that it leads you to ask those questions the right way.

Re:Challenges in the diagnosis of magnesium status on Sunday June 27, 2021 @05:47PM (#27655760)
If you're getting muscle spams, are you really "supplementing"?
Re:It's time for a data-first front end revolution on Tuesday May 18, 2021 @05:03PM (#27201108)
The industry is definitely dropping the ball on offline. To give us credit, legal/privacy issues don't make it easy.
Re:Parsix: Parse Don't Validate on Saturday May 15, 2021 @01:19PM (#27167051)
I've been using this small library inspired by Elm/Swift decoders [1]. It works, but it's not low boilerplate.

I'm gravitating towards GraphQL now because strict parsing is built into it, so there is no need for all this boilerplate.

https://www.npmjs.com/package/@mojotech/json-type-validation

Highly debatable. In fact, trying to classify it as a dark pattern may derail the very valid discussion that the FTC is trying to have. There are significantly worse patterns out there. See [1].

What the push notification pattern is, is annoying. And it is specially annoying because of a prevalence of confirmation dialogs all over the Web with GDPR/CCPA, paid subscriptions, etc. But does it cause harm or monetary loss as the sneak into basket pattern? Or the opt-out unnecessary "insurance" that airlines continue to put in the checkout flow?

We do a disservice to ourselves littering the web with these constant asks. But it's not what needs regulation and enforcement.

[1] https://www.darkpatterns.org/types-of-dark-pattern

Is this really a dark pattern? There's tons of truly deceptive practices but this is one where websites are plainly asking for permissions.
Re:Ask HN: Why Isn't Open Source Voting Software Mandated? on Sunday November 15, 2020 @04:46PM (#25105215)
It's not just about security. It's also about democracy. Who can verify that a voting system is secure? Only software engineers. And to be honest, only a small subset of them. Your own comment hints at that. Paper ballots allow anyone to verify the results of an election. It's supposed to be a universal process that everyone can be a part of.
Re:Full-Bleed Layout Using CSS Grid on Monday October 05, 2020 @07:57PM (#24693431)
The parent-child problem you mention can be addressed with names. Children can say "grid-name: footer". This is just a hint for the parent to decide where to place it in the grid. Then the parent can use grid-template-areas to arrange its children. You no longer need to change the children if you're adding columns to the layout.

(I agree with you on this simple layout)

I'm surprised there's so many comments here about demographic data while that's only a really basic view into current ad tech. Since the late 2000s ad networks have invested heavily in retargeting [1]. It's quite common that people end up in a vendor, add something to the cart and never finish the transaction. Retargeting attempts to catch behaviors like that and adjust to display the items that the user showed interest in. I haven't been in that industry in years, but in the 2020s I can only expect much more nuanced systems based on ML. And everything falls apart without being able to keep a history of what you do and who you are.

[1] https://en.wikipedia.org/wiki/Behavioral_retargeting

Re:Playdate – A New Handheld Gaming System on Wednesday May 22, 2019 @08:00PM (#19986951)
For $150 you get the console and 12 games. That's not too bad.
Re:Math and front-end on Saturday June 09, 2018 @09:26PM (#17275934)
I was also a bit disappointed to find basic arithmetic. There is more. I was expecting something like an algorithm for a tile layout like https://masonry.desandro.com/ or https://github.com/d3/d3-hierarchy#treemap. In terms of animations, understanding linear algebra can help you take full advantage of CSS matrix and matrix3d transforms. Certain parallax effects can be done done better with trigonometry...
Re:Microsoft acquires Github on Monday June 04, 2018 @10:54AM (#17228287)
If I learned anything working at large companies is that hardware is never close to being as expensive as headcount.
Re:I put all my personal data on eBay on Monday May 28, 2018 @11:44PM (#17176308)
Jana is doing this by building a browser (mCent) that shows people ads in exchange for tokens that they can use to buy mobile data. It's becoming really popular in India. http://www.mcentbrowser.com/
Re:Make front end shit again on Sunday May 13, 2018 @03:45PM (#17060614)
I feel like your site is better than the OP site at what the OP site tries to do.
I thought they had confirmed LIGO's detection of gravitational waves coming from a certain pulsar that Fermi saw independently. The article you link to seems to be about gravitational waves from the background. I'm also curious now.
Re:Three Meanings of E=mc² on Monday February 05, 2018 @08:22PM (#16313767)
While it might be true that the temperatures of rocket fuel burning are enough to create plasma and some reactions that lead to mass turning into energy, I think Jabavu is right in that the energy comes from the chemical reaction, not from E=mc2.
I'm seriously concerned about this. "Self-driving" is not a library that you get from Github and just dump it into your car. Waymo has been doing this for a decade. Do GM's claims mean that Waymo's experience doesn't matter much or is GM actually going to cause real world accidents by moving too fast?
I wonder if they've made any significant advancements in input latency. Something like this was my dream device when I was in college.
> You can't handwave your way through a math exam

This reminds me of a calculus exam a long time ago. One of the problems was "given the ellipsoid define by formula ______ and a certain line, find the point in the line closest to the ellipsoid". The goal for this problem was for us to use Lagrangian multipliers and I hadn't studied that one particular subject. However... They made a mistake writing the exam. The ellipsoid was symmetrical, its intersection with the xy plane was a circle and the line was also in the xy plane. I only needed high school math to successfully handwave it. Lots of facepalms from my TAs.

Re:How to never complete anything on Friday March 10, 2017 @02:21PM (#13841236)
Well, it must be easy when you can make art _like that_ ! Kudos!
Re:Life may be getting better at evolving on Thursday March 02, 2017 @03:26PM (#13777857)
You seem to be talking about humans, not life in general. Human evolution still happens, but selection is not based on adaptability but on societal rules. And then we're going to start messing with our own genes and things will get more complicated.
Re:The Multiverse Is an Ancient Idea on Tuesday January 31, 2017 @04:40PM (#13535504)
Nautil.us seems to be obsessed with the multiverse. This seems to be related to "Fake physics": https://www.math.columbia.edu/~woit/wordpress/?p=9053
Re:Using Immutable Caching to Speed Up the Web on Thursday January 26, 2017 @02:57PM (#13494740)
You would need to use Service Workers to use that header the way OP wants it, since he wants to have the HTML page decide when the resources of that page need to become stale. Fingerprinting resources with the hash of the content works a lot better for that.
Re:Obama Commutes Bulk of Chelsea Manning’s Sentence on Tuesday January 17, 2017 @05:00PM (#13421796)
Sorry, non-native speaker here. But wouldn't "they" apply when you don't know when the gender of the person? In this case you do know.
For the record, this is incorrect. The SEC filing does not indicate she is resigning as CEO. See other comments for explanations about what's actually going on.
No. It doesn't.

Older »