Live data from Hacker News

CSS is powerful, you can do a lot of things without JS

github.com

41–50 of 319 posts

Re: CSS is powerful, you can do a lot of things without JS

#41
post #27

Earlier quoted context omitted.

JS is far more predictable than CSS.

CSS ( properly written ) is easier to debug than JS.

I write a lot of CSS and I would probably disagree.

CSS has no console.log() for debugging, CSS often fails silently, and the demos in the link are more or less (albeit pretty neat) hacks, but don't use CSS features in the way the specifications intended.

Re: CSS is powerful, you can do a lot of things without JS

#42
post #19

Whenever someone makes a menu with CSS instead of javascript i go crazy as a user. The lack of delay is such a frustration.

Fortunately you can use animation-delay to simulate bloated Javascript.

It's not about bloat, it's about accidentally triggering menus when you move your mouse down the page.

Re: CSS is powerful, you can do a lot of things without JS

#43
post #26

History is going to look back at CSS in disbelief when it calculates the amount of engineering time was spent trying to position elements correctly. This isn't hating on CSS as much as how broken layout creation is with no end in sight--but plenty of hacks.

CSS layout is actually pretty good these days, with flexbox anyway. It's hard to come up with a better layout system used anywhere near as much as CSS.

Re: CSS is powerful, you can do a lot of things without JS

#44
I prefer using CSS for my styling and javascript for my functionality, as God intended. These examples could be educational for getting a bit more out of your CSS while keeping only the pure functionality in javascript. Too much styling-related stuff seems to be sneaking into code these days. I like my concerns separated.

Re: CSS is powerful, you can do a lot of things without JS

#46
post #5

The problem with relying on anchors means it stays in the browser history, so if you press 'back', you get the modal dialog again! I don't think this is very useful, but it is a fun exercise in CSS.

To be fair in some cases this can be a benefit. There have been occasions where I have wanted to link to content contained within a modal. You are right in that there are also occasions where this isn't desired.

Re: CSS is powerful, you can do a lot of things without JS

#48

Earlier quoted context omitted.

CSS ( properly written ) is easier to debug than JS.

I write a lot of CSS and I would probably disagree. CSS has no console.log() for debugging, CSS often fails silently, and the demos in the link are more or less (albeit pretty neat) hacks, but don't use CSS features in the way the specifications intended.

Also no unit tests and a program model that is hard to make into a coherent mental model.

Re: CSS is powerful, you can do a lot of things without JS

#49

Earlier quoted context omitted.

CSS ( properly written ) is easier to debug than JS.

I write a lot of CSS and I would probably disagree. CSS has no console.log() for debugging, CSS often fails silently, and the demos in the link are more or less (albeit pretty neat) hacks, but don't use CSS features in the way the specifications intended.

My reasoning is that CSS is not a language, it's just a configuration file.

It doesn't have a console.log, but it has `background: red`.

JS as a language and as such ( especially it's callback / event-driven nature ) makes it harder to debug.

Post reply on HN