Earlier quoted context omitted.
It is a weird myth that CSS somehow discourages tables. CSS have supported styling html tables and ‘display:table’ (allowing a table-like layout without html-tables) for 25 years. Float and clear was grandfathered into CSS since they were added to HTML by Netscape. They are fine for their intended purpose: placing images in a text and have the text flow around. Other positioning systems you mention does not solve the…
> It is a weird myth that CSS somehow discourages tables. CSS have supported styling html tables and ‘display:table’ (allowing a table-like layout without html-tables) for 25 years. Not a myth in any way shape or form. Tables for layout (not tables in general) were discouraged with various arguments in favor of "float/clear", even decades before a sane substitute (grid/flex) was available. > Other positioning systems…
Hardest problem in computer science: centering things
431–440 of 473 posts
Re: Hardest problem in computer science: centering things
#432Earlier quoted context omitted.
CSS never recommended float/clear as an alternative to table-based layout. CSS had ‘display:table’ for when you needed a tabular layout without the semantic baggage of the table-tag.
CSS is just a language + words of paper spec. CSS, as in "CSS evangelists", influential web designers, guidelines in web development resources, books, and so on, recommended and advocated for the use of clear/float. You might not have been there, but float layout was a big thing back then, and everybody was guilt-pressured to use that - neither tables, nor "display: table" (which was used by some, but also discourage…
What, no? I did a lot of web development in those days and read a lot of blogs. You just needed to filter out anyone who was obviously over-opinionated and lacked any nuance. Most pragmatic people used tables and didn't feel guilty about it. If you delivered working software with a decent UX, why on earth would you care what some shouty internet person said??
Re: Hardest problem in computer science: centering things
#433Earlier quoted context omitted.
I absolutely remember a ton of pieces about how we all needed to stop using tables (and 1x1 transparent gifs, too) for page layout because CSS was The Right Way
The issue is people taking “tables are bad for non-tabular layout” and just remembering the first three words. People like stark binary yes/no rules, so “tables are bad” was born and spread widely. If your layout is intended to be a table, then a table (styled with CSS) is the way to go, otherwise use semantic HTML (styled with CSS) and you will (in theory) have an easier time making the design work well at different…
It's the same today though - half of HN is utterly convinced rebellious technologies like HTMX are going to save us from the evil of front-end libraries. People adopt guides or entire technologies without ever actually building something significant with them.
Re: Hardest problem in computer science: centering things
#434Earlier quoted context omitted.
I've heard this described as inherent complexity versus accidental complexity. Inherent complexity (due to difficult real-world constraints) is fine. Accidental complexity, like that caused by overcomplicated tools or architectural decisions, just feels bad.
And then you have weaponized accidental complexity, aiding cv-driven development and vendor lock-in (which are really the same sort of thing).
Re: Hardest problem in computer science: centering things
#435Don't read this article, if you are not in web dev. Once you start seeing it, you can't stop seeing it, and it will drive you crazy forever. It is the same for noticing misalignment, recognizing color oversaturation, high quality speakers/headphones, etc. (It is a good article!)
The same happens when you: - Install flooring - Install trim in your own home - Build / install cabinets You will now see: - Odd flooring patterns and uneven floors - Know what it looks like when trim isn't coped - Uneven gaps between doors
Re: Hardest problem in computer science: centering things
#436Earlier quoted context omitted.
"CSS" (not sure what you're referring to here, the standards bodies?). Endless articles from the mid 2000s kept saying tables bad, here's how you layout without tables. All of them used floats for layout, not display:table. Partly I suppose this was because IE didn't support it until 2009, I think. Nearly all layouts people actually want are table-like, and I think CSS really was misguided in its text-flow as layout…
> Nearly all layouts people actually want are table-like, and I think CSS really was misguided in its text-flow as layout approach. I think this is the core misunderstanding in this discussion. CSS 2 supported both text-flow and tabular layout and both layout models were reverse-ingeneered from how Netscape rendered HTML. There is this weird idea that CSS is somehow opposed to tables or tabular layout, while a signif…
Re: Hardest problem in computer science: centering things
#437Earlier quoted context omitted.
JavaFX uses a dialect of CSS so that's not necessarily a great example. It's also somewhat simplified compared to normal CSS, for example, the way layout works is more normal for GUIs (containers that implement different constraint systems). For things like theming your UI it works pretty well. I've done web CSS and JavaFX CSS and for app GUI I'd much rather use the latter. For nicely styled documents with good typog…
I misspoke in my comment and must have used Swing more than JavaFX (I’ve used both, but forgot which one I primarily used, this was 8 or 9 years ago and a short job). Either way, I really don’t like when only a subset of the language is supported, because then it becomes a constant guessing game of whether or not something is supported. In the case of JavaFX, there are a few features not supported and a couple gotcha…
The problems with CSS are more around the high levels of inconsistency, difficulty making it fast, lack of modularity and the fact that if you make a mistake either nothing happens with no error, or you get visual corruption. It's just an extremely frustrating technology to work with, especially if you only use it occasionally. Although the article talks about font metrics a lot, a big part of why centering things is so hard is thanks to CSS and its legacy which is why it opens with that. Every time I do web design I discover that the current best practice has changed, and there are dozens of new properties with similar names to existing properties which don't seem to work or can only be used in combination with other properties.
Re: Hardest problem in computer science: centering things
#438> That’s exactly why people love web programming so much. There’s always a challenge. LOL, these examples are exactly why I got out of web programming. Thankfully I never had to deal with any of the modern frameworks. I was getting hot flashes just scrolling through this page.
I am not even sure whether the sentence you quoted is genuine or sarcastic.
Re: Hardest problem in computer science: centering things
#439Earlier quoted context omitted.
> Somw people like to think centering things is taking the bounding box of the visible pixel and centering the center of the bounding box. That was my naive understanding for probably my first year at the uni. It got cleared up fairly quickly. I imagine there can be typesetting/layout styles where this holds, but I would classify them as niche (maybe brutalism or something like that). Funnily enough, in the very firs…
This vertical centering of text in buttons is more noticeable when there is an icon next to it. But it drives me crazy that the default is not to center around the cap and baseline. This is what I usually see in figma designs and it looks the best, but it's not simple to apply in html & css.
Icons can be less ambiguous, but still it depends on the shape and white space within one and the interplay with text label.
I think it all depends on your vision and its consistency.
Re: Hardest problem in computer science: centering things
#440Don't read this article, if you are not in web dev. Once you start seeing it, you can't stop seeing it, and it will drive you crazy forever. It is the same for noticing misalignment, recognizing color oversaturation, high quality speakers/headphones, etc. (It is a good article!)
The same happens when you: - Install flooring - Install trim in your own home - Build / install cabinets You will now see: - Odd flooring patterns and uneven floors - Know what it looks like when trim isn't coped - Uneven gaps between doors