CCS is worst language ever created
-
Jörgen Andersson wrote:
Luckily everyone doesn't think like that
Indeed, most people don't even think at all... But I don't particularly agree that we only advance from unique ideas. I am sure a lot of people come up with the same ideas all the time, it's just who gets to market first, so to speak.
musefan wrote:
who gets to market first
Word. Edison comes to mind.
Wrong is evil and must be defeated. - Jeff Ello
-
The reason stuff like that isn't possible is because you will get endless recursion. Let's say you have:
The height of B is determined by the content of A, but if you are changing the width of A based on the height of B then the height of A will also change, which in turn forces the height of B to change, which would then require the width of A to change, which will once again change the height of B, and the loop continues until you get a StackOverflow exception. So perhaps you say: "Well, don't allow rules like that", but then you end up with even more of a headache trying to make sure your rules don't conflict with other rules. Put it this way, if it was possible to make it work well then it would for sure already exist. As the saying goes: if you have a good idea, it either already exists or it really isn't that good an idea.
What you describe already happens in the layout engine of modern browsers. The rules that I outlined earlier already happen, but is invisible to us. There are hundreds of such rules that must be evaluated to produce the final layout, and some are in direct conflict with each other, so the engine is designed to make a compromise. These compromise heuristics is what avoids endless recursion. So imagine that tomorrow the Google Chrome team launches a new module called JSCSS, were they have moved out all those heuristics from inside the layout engine and written them in JS. From now on you point to a JSCSS file at the beginning of a HTML page, which defines all the CSS rules you intend to use. CSS still works exactly like before. But the HUGE difference is, now you can see how a flexbox actually figures out layout, AND you can extend CSS with your own definitions for things you think is better than the standard. AND you can omit CSS altogether, and write your layout directly in JSCSS of you want. This would be a huge relief for everyone, because browser makers only have to make sure the core layout engine works correctly, and every CSS definition is in external JS, exactly the same for every browser. And any developer can extend CSS with his own definitions.
Bjorn
-
It's a language by committee. And a committee made up of teams that are actively competing with each other. Read this discussion on CSS4[^]. They actually, deliberately, don't want to increment the CSS version anymore. That's like macOS stopping at version 10 (...but instead is 10.1, 10.2 etc), and Windows 10 stopping at 10. Or 10 20H1, 20H2...) I think the hardest part of CSS is the "C" - the cascading, which relies on Specificity. It's super logical and very well defined. And an utter nightmare as soon as you step off the beaten track. Switch elements around, decide you need some special formatting, try and generalise it, and boom! Still - it does at least attempt to encourage a separation of layout and style. Except the CSS defines the layout :doh:
cheers Chris Maunder
Yea I wish CSS was only about style, and layout was handled in a different way. I think it is possible to keep the core layout engine of the current browsers, and create a kind of scripting language they can run, so the developer can interact with the layout procedure. These ideas have been proposed before, so I can't understand why we still have CSS today. I was cursing HTML layout 15 years ago, and couldn't imagine we would still be doing things the same way today. Some developments in this space have been amazing, but HTML/CSS/JS has really been a disappointment. There is still not a practical way to write C# and run it in the browser, just promises of WASM and compilers that never hit mainstream.
Bjorn
-
Yea I wish CSS was only about style, and layout was handled in a different way. I think it is possible to keep the core layout engine of the current browsers, and create a kind of scripting language they can run, so the developer can interact with the layout procedure. These ideas have been proposed before, so I can't understand why we still have CSS today. I was cursing HTML layout 15 years ago, and couldn't imagine we would still be doing things the same way today. Some developments in this space have been amazing, but HTML/CSS/JS has really been a disappointment. There is still not a practical way to write C# and run it in the browser, just promises of WASM and compilers that never hit mainstream.
Bjorn
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
-
The fascination of presentation over content.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
"The medium is the message"
"Time flies like an arrow. Fruit flies like a banana."
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
I'm a simple man. I see CSS hate, I upvote.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
I'm a simple man. I see CSS hate, I upvote.
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Wrong is evil and must be defeated. - Jeff Ello
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
-
Wrong is evil and must be defeated. - Jeff Ello
I actually gave that on a mug to a designer, it's his favorite mug :D
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
Thanks for the link, interesting read. If PSL96 had been implemented instead, CSS would be a lot easier. You simply express sizes of things in terms of sizes of other things. It would have resulted in a much smaller language, that most people could grasp. And people would create libraries of handy expressions that accomplish the very same things that flex and grid does today. With the huge difference that you can look at the code and see what happens. Right now it is just a back box that almost no one understands. Browser support would be easier and more uniform, not harder, because there is a smaller feature set to implement. Do you know of any other language where there is so low predictability of outcome? You basically spend your time trying 100 different tweaks until it looks right.
Bjorn
bjoernen wrote:
If PSL96 had been implemented instead, CSS would be a lot easier. You simply express sizes of things in terms of sizes of other things.
That might work for basic stuff. Once you want to use different styles for different screen sizes, this becomes unworkable very quickly.
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
They have started to add programmatic elements to it and it won't be long before there will be a full blown css scripting language based on COBOL - because for reasons that are unclear to me the entire community is committed to making things as complex/multi-layered/obtuse as possible. Whatever you do on a webpage you must never just put an input element on the form - it must have a template that references other templates and style sheets that must be run through SASS and dozens of other utilities/mods/nightmares - all to collect a first and last name from a customer. I swear to Judas that some developers go into a project seeking to add as much complexity as possible.
-
CSS the worst language? Surely not. There is BrainF*ck, or worse - VB & Javascript!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Haters are going to hate. I don't know much JavaScript, never worked in it. But I have made a very nice living/career over the last 43 years with VB. :) All languages are just syntax. VB is a tool just like any other. If you misuse an axe bad things are going to happen to you. I am sorry to learn that someone who does "Thought for the Day" could be such an elitist. Oh well Nobody is perfect, including both of us. :(
A lot of people bash things they don't understand, or use properly.
-
They have started to add programmatic elements to it and it won't be long before there will be a full blown css scripting language based on COBOL - because for reasons that are unclear to me the entire community is committed to making things as complex/multi-layered/obtuse as possible. Whatever you do on a webpage you must never just put an input element on the form - it must have a template that references other templates and style sheets that must be run through SASS and dozens of other utilities/mods/nightmares - all to collect a first and last name from a customer. I swear to Judas that some developers go into a project seeking to add as much complexity as possible.
:thumbsup::thumbsup::thumbsup:
The tower of Babel indeed!
-
Haters are going to hate. I don't know much JavaScript, never worked in it. But I have made a very nice living/career over the last 43 years with VB. :) All languages are just syntax. VB is a tool just like any other. If you misuse an axe bad things are going to happen to you. I am sorry to learn that someone who does "Thought for the Day" could be such an elitist. Oh well Nobody is perfect, including both of us. :(
A lot of people bash things they don't understand, or use properly.
It's not elitism, it's "On Error Resume Next". Any language which supports that should be strung up and whipped ... :laugh:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
separation of content and style, that's what they say when they teach little kids about css the next logical step it was i never new what hit me, that was around 98. i discovered it was css when every page broke on every browser. it was said that browsers were guilty of not heaving decent support for it. for me it was the other way around, so i never looked at css whenever i see it embedded in html i just skip that part
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
That's why we have LESS and SASS, both able to do what you and I want. Personally, I still prefer using tables for layout, because it doesn't move elements around in odd places, as floating divs often do, but I am trying to get used to it, because it can make it easier to have one page for all sizes of screens.
-
It's not elitism, it's "On Error Resume Next". Any language which supports that should be strung up and whipped ... :laugh:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Just never use "On Error Resume Next" and turn on Options Explicit and Strict. Easy. I much prefer C#, but I spent years in VB and then VB.Net and never understood the hate. Still don't. If the hate is because of the capability of misusing it, I can do that in C# too. Or maybe it is because it has built-in settings that are questionable to non-VB users (Explicit and Strict)? Maybe I'm missing something. But I don't care as I don't use VB anymore (since 2005). I prefer C#'s syntax. On the other hand, if someone could explain the reason VB is so bad (without the hate), I would welcome the education. Send me a private message or point me to a well-written post.
Mike
-
No language has casued me more grief in my 30+ year career than CSS. It is almost like some form of black magic, where you can never be 100% sure what a page will look like. Even for the simplest designs you have to allocate 4 hours, just to make sure it looks the same in all browsers. Why the decision to write an enormously complex layout engine, and then keep adding more bloat to it every year? Why not let the page designer interact with the layout engine instead, as it is laying out the elements on the page? It could be done through JS calls, or even by writing simple math formulas into the CSS, that refer to the sizes of other elements. For example "the width of this element should be equal to half the width of that element". Then let the browser's layout engine simply be a multi variable equation solver. End of rant.
Bjorn
Like you, I have worked in our profession for a very long time, retiring in 2014 after 42+ years in this career. Its not that I had gotten fed up working with the technologies. I simply couldn't stand the arrogant incompetents any longer. So I believe I know where you may be coming from. However, I think you may be confusing the way CSS should be used and the way it has been abused. CSS is very good for simply making generic styles for a variety of HTML interfaces given its object-like nature for such definitions. However, like all software tools, its creators and users\developers seem to have to always extend their tools to death implementing ambiguity after ambiguity until people eventually react to all the bloat as you have with CSS. The problem with all software today is that both vendors and developers simply can't desist from creating and\or using every possibility any single language and\or framework is capable of or provides. Look at the recent "innovations" with the Microsoft frameworks. Do we really have to give up the standard framework implementations to create a quality application? Not really. Its just that Microsoft can't seem to leave well enough alone with what it already has. And if it wanted to refine the existing tools, fine, but why go and create an entirely new framework infrastructure leaving everyone to have to consider yet again another conversion? Its not as if many developers are really going to see any substantial improvement in efficiency and performance with the new frameworks while being forced to abandon the older ones. And if they do, they have already given up something to gain either. In the end, it is always a zero-sum game. The problems you legitimately see with CSS are merely an outgrowth of an industry that has already passed its development zenith and now has no idea what to do with itself...
Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com
-
Just never use "On Error Resume Next" and turn on Options Explicit and Strict. Easy. I much prefer C#, but I spent years in VB and then VB.Net and never understood the hate. Still don't. If the hate is because of the capability of misusing it, I can do that in C# too. Or maybe it is because it has built-in settings that are questionable to non-VB users (Explicit and Strict)? Maybe I'm missing something. But I don't care as I don't use VB anymore (since 2005). I prefer C#'s syntax. On the other hand, if someone could explain the reason VB is so bad (without the hate), I would welcome the education. Send me a private message or point me to a well-written post.
Mike
nothing wrong with VB.net, except MS decided to stop growing the language; about that time I decided to fully switch over to C#. I worked in VB (classic) for years and got a lot done, it was a great way to get a quick UI working that worked. plenty of hooks to tie into the lower API of windows and c/c++ libraries. when .net came out, it was a no brainer to switch. each language has it's strong points and weak points, but times change. a couple years ago I wouldn't have though you could use Rust for web dev but now we can with webassembly. I didn't think I would like javascript because of it's typeless programming, but have now found it's wonderful for web. if it wasn't for Android, I'd never touch Java again though, just something about that language that I find painful. no offence to Java devs out there, it's just not my cup of tea.