CSS now has an if() conditional function
71–80 of 245 posts
Re: CSS now has an if() conditional function
#72Earlier quoted context omitted.
This is so true, I have seen it happen with so many projects. It always starts with a cute declarative DSL, and inevitably imperative / flow control structures emerge, at which point you wonder why they didn't use a real programming language in the first place and save you the hassle or learning a half baked imperative DSL. - Puppet - CMake - Terraform - ... All these started with pure declarative DSL then incrementa…
- Visual Studio project files are XML files that are interpreted line by line, and can contain variables, branches, and loops. Hell on earth.
Makes reading it even harder, and any possible constraints due to type safety go out of the window, so we get worst of both worlds.
Re: CSS now has an if() conditional function
#73Here is a much better link to how it works: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...
padding: 1em;
padding: if(style(--size: "2xl"): 1em; else: 0.25em);
> Note: Remember to include the else condition. In if()-supporting browsers, if no else value were included and --size was not equal to "2xl", the padding would be set to initial.This is counterintuitive. You would expect the above falls back to "1em" (from "padding: 1em;") when "else" is not specified. Instead, omitting "else" apparently means "else: initial".
Re: CSS now has an if() conditional function
#74Earlier quoted context omitted.
We can blame von Neumann (et al) and his infernal architecture, where memory stores both instructions and data.
You can blame whoever invented the word "if", as soon as you can branch based on data you can just write an interpreter that turns data into instructions, no matter the architecture.
Re: CSS now has an if() conditional function
#75Earlier quoted context omitted.
You can blame whoever invented the word "if", as soon as you can branch based on data you can just write an interpreter that turns data into instructions, no matter the architecture.
You need more than if for Turing completeness though.
Re: CSS now has an if() conditional function
#76Re: CSS now has an if() conditional function
#77Give it enough time, every declarative language becomes a programming language. This is happening with all config files, markup languages, data formats. The distinction between code, config and data is being erased. Everything is a soup now. Data is application, configuration is code. Code is an intermediate, volatile thing that is generated on the fly and executed in the temporary lambda containers.
This is so true, I have seen it happen with so many projects. It always starts with a cute declarative DSL, and inevitably imperative / flow control structures emerge, at which point you wonder why they didn't use a real programming language in the first place and save you the hassle or learning a half baked imperative DSL. - Puppet - CMake - Terraform - ... All these started with pure declarative DSL then incrementa…
CMake today is effectively an eso-lang / Turing tarpit with some “modern” declarative conventions that people try to push.
Re: CSS now has an if() conditional function
#78Earlier quoted context omitted.
This is so true, I have seen it happen with so many projects. It always starts with a cute declarative DSL, and inevitably imperative / flow control structures emerge, at which point you wonder why they didn't use a real programming language in the first place and save you the hassle or learning a half baked imperative DSL. - Puppet - CMake - Terraform - ... All these started with pure declarative DSL then incrementa…
- Visual Studio project files are XML files that are interpreted line by line, and can contain variables, branches, and loops. Hell on earth.
Re: CSS now has an if() conditional function
#79So we were looking in the wrong direction for AGI!
Replying to myself (hey, I like myself and I'd like to have a conversation with me): CSS doesn't have it right? Just Chrome. Considering how all kinds of "experts" have started to make web sites that only work fine in Chrome [1], this is not exactly a useful new feature, more like embrace and extend... [1] Orange Romania, when will I be able to download my invoices again in Firefox?
I don't see Mozilla's or WebKit's positions anywhere, so this is a Chromium-only feature for now.