by rafram · 3y ago · 0 comments
…Yes. Ever seen an image file with circular dimensions? No, because digital images (at least in standard formats) are always rectangles, sometimes with transparent areas that make them to appear to be other shapes.
There are so many shockingly basic misunderstandings in this post.
My understanding is that transforms can’t cause reflows because they occur in the compositing layer. And as a sibling comment points out: everything round in css is actually a rectangle. Unless it’s a path drawn in an svg element. But then that lives in a rectangular frame. You could animate it with svg, though.
Regardless, I want to say I reject the premise here. I’m not sure why a transform would be so inefficient. I have a feeling it could be something else at work here.
They have an article on "cracking the hackerrank test" that straight up advocates for cheating on screeners companies are starting to do through hackerrank. I'm not about to claim that these tests are at all good at measuring your skill as a developer, but I would much rather a candidate engages with the process honestly than openly brags about cheating.
I know not everyone is perfectly honest all the time. But if you advertise cheating a process meant to reveal rather than conceal information, there’s a real problem.
Last i asked, if you change a (1) pixel on a modern computer, you need to redraw the screen because it's a surface which is being updated.
I've ran the same on my computer at home and I also got double digit percent difference on a 32 cores AMD.
https://thehftguy.com/2016/11/01/docker-in-production-an-his...
https://thehftguy.com/2017/02/23/docker-in-production-an-upd...
Maybe they were trying to argue that for something as simple as that, it could’ve been a div with a background and a font icon, and used CSS to make the div into a circle, and rotate that? It certainly seems more complicated at a glance, but I’m not a frontend dev, so, who knows?
Yeah I don’t get it either.
I kept reading it expecting something to jump out at me. He just goes on about how “a square cannot be rotated”.
This honestly feels like more of a chrome bug or more likely some really weird settings on behalf of the author. I’ve seen this exact approach on the web. Nothing struck me as odd.
What is odd is that he didn’t do any testing with a different browser, machine, or OS even. He just decided to make a blog post.
I dream of a polar-punk alternate reality where we address pixels not by (x, y) but by (r, θ).
Of course there's one big flaw with this line of thinking: even if we used circular (or elliptic) screens, we can't tile them with other circles. Circular windows would waste a lot of space. Maybe we could split in "slices" instead though?
The browser isn't displaying a file, it is displaying data mapped to a rectangle. It is 2023 you should be able to spend some polygons on those shapes.
>> A circle can be rotated in place. It doesn’t take more space than the initial circle. *A square cannot.*
Edit: and just in case you or someone else miss the forest again:
the site developer treats the image as a circle, assuming rotating the image would change only the image.