Live data from Hacker News

CSS now has an if() conditional function

caniuse.com

141–150 of 245 posts

Re: CSS now has an if() conditional function

#143
post #138
post #115

Earlier quoted context omitted.

They are badly copied Ant build files. Ant came first, then when Microsoft redid the VS project format, they created MSBuild. As incredible as it may sound, Ant is still easier to deal with than MSBuild.

Ant did not include IF THEN ELSE, unless you added the contrib package. If you understood the paradigm, you could write branches in Ant files simply using properties and guards on properties ("unless"). Using IF in Ant was basically admission of not having understood Ant. This said, I used Ant for a very limited amount of time.

It sure did, you use conditions, no need for contrib.

https://ant.apache.org/manual/Tasks/condition.html

The else part is easily done by repeating and negating the condition.

Two other advantages of Ant that MSBuild lacks in a sane way to this day, are macros, and proper documentation.

Re: CSS now has an if() conditional function

#144
post #127

Earlier quoted context omitted.

> All these started with pure declarative DSL then incrementally created a nightmarish imperative monstrosity. "Huh?" I asked myself when you mentioned that Terraform is now imperative somehow. Took a look at the website again, and seems to still be HCL, and still be declarative. Am I missing something? How exactly is Terraform today a "imperative monstrosity"?

Terraform has modules which are an elaborate method of doing function calls. HCL 2 has loops and conditionals. It is most definitely imperative. This is not necessarily a problem except that they had to live in the original HCL v1 landscape which makes them awkward syntactically.

> Terraform has modules which are an elaborate method of doing function calls

... What? How is modules a function call? It's just a hierarchy, everything about/with modules is still declarative.

> HCL 2 has loops and conditionals. It is most definitely imperative.

So what? Just because there is loops and conditionals doesn't mean it's suddenly imperative.

How exactly you do loops in HCL? Last time I used it, you still used declarative configuration for that, and use `for_each` as an declared option, you don't "call for_each which returns config", all that happens inside of HCL/TF, because it is declarative.

Did something change like yesterday or are people even here on HN so ignorant about what declarative vs imperative actually means?

Re: CSS now has an if() conditional function

#145

Earlier quoted context omitted.

> every declarative language becomes a programming language. Overly pessimistic, lots of non-programming languages remain non-programming languages. Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down... > The distinction between code, config and data is being erased. As as lisp programmer, I love it. Get rid of treating things d…

> Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down. The question still is: why is CSS becoming a programming language? And who decides on this, anyway?

Because modern UI toolkits like Flutter proved that UI should just be code, not separated into three different languages. In this case, adding conditionals can remove the need for js in some cases, which is good.

Re: CSS now has an if() conditional function

#146

Earlier quoted context omitted.

Horrible. Would’ve been much nicer if they’d reached for Scheme.

You say that, but people in OCaml keep bemoaning the use of mostly declarative s-expressions in the Dune build system. Imagine the reaction if MSBuild used an actual Scheme.

They don’t know how good they really have it :)

Re: CSS now has an if() conditional function

#147
post #133

Earlier quoted context omitted.

> every declarative language becomes a programming language. Overly pessimistic, lots of non-programming languages remain non-programming languages. Just because one of the most widely used declarative languages start adding conditionals doesn't mean the whole world is turning upside down... > The distinction between code, config and data is being erased. As as lisp programmer, I love it. Get rid of treating things d…

> > The distinction between code, config and data is being erased. > As as lisp programmer, I love it. You make bad engineering decisions because you consider the advantages, but not the disadvantages. https://news.ycombinator.com/item?id=29231493 >

You make bad comments because I can't understand the point you're trying to make. I'm am engineer, I make choices based on informed tradeoffs, anything else would be sub-standard. Not sure why you think I only consider advantages, but I'm afraid asking you for clarification will just lead to more ramblings.

Re: CSS now has an if() conditional function

#148
post #42

Give 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.

can someone interpret this as not a skill issue?

i want better, declarative, interactive, fast UIs

CSS is the best answer we have

Re: CSS now has an if() conditional function

#149
post #115

Earlier quoted context omitted.

- Visual Studio project files are XML files that are interpreted line by line, and can contain variables, branches, and loops. Hell on earth.

They are badly copied Ant build files. Ant came first, then when Microsoft redid the VS project format, they created MSBuild. As incredible as it may sound, Ant is still easier to deal with than MSBuild.

The legacy version of MSBuild was really bad, but the modern MSBuild project files for .NET are actually quite concise and clean by default?

Re: CSS now has an if() conditional function

#150
post #133

Earlier quoted context omitted.

> > The distinction between code, config and data is being erased. > As as lisp programmer, I love it. You make bad engineering decisions because you consider the advantages, but not the disadvantages. https://news.ycombinator.com/item?id=29231493 >

You make bad comments because I can't understand the point you're trying to make. I'm am engineer, I make choices based on informed tradeoffs, anything else would be sub-standard. Not sure why you think I only consider advantages, but I'm afraid asking you for clarification will just lead to more ramblings.

The disadvantages are in the post I linked to.
Post reply on HN