News for hackers. Stuff that matters.
Re:How true hackers write JavaScript by olavk on Wednesday September 05, 2018 @08:21AM (#17917248)
Well using divs would at least make you able to group the elements semantically so you could remove a single node rather than having a for loop which removes exactly three nodes. This would be significantly simpler in my opinion. And it would be less fragile since now you can redesign everything inside this node without the JavaScript breaking.
Re:How true hackers write JavaScript by jmiserez on Wednesday September 05, 2018 @11:08AM (#17918652)
Agreed. But getting divs to do what you want has also gotten considerably easier in the last 10 years. It used to be a lot more work/boilerplate to get a consistent div-based layout across all browsers down to IE 6.

As for the redesign, the total amount of code (HTML/CSS/JS) you’d need to touch is still small. Do web designers still exist that only do HTML/CSS but no JS?

Re:How true hackers write JavaScript by TeMPOraL on Wednesday September 05, 2018 @02:01PM (#17920437)
> Do web designers still exist that only do HTML/CSS but no JS?

I hope so, given that most websites (as opposed to web apps) in existence should not need JS for core functionality.

Re:How true hackers write JavaScript by olavk on Thursday September 06, 2018 @03:07AM (#17924416)
> Do web designers still exist that only do HTML/CSS but no JS?

That is really beside the point. HTML and JS should not be coupled to the extent that adding or removing some whitespace from the HTML will cause the JS to fail. This kind of things turns a trivial improvement into a nightmare, so you end up not daring to change anything.

Re:How true hackers write JavaScript by Izkata on Wednesday September 05, 2018 @09:35AM (#17917770)
I expect the layout would also be simpler in another way: Give every "child" div a static indentation, nothing more. They'll nest and the indentation will stack the deeper the comments go.

Right now there's already nested tables-within-tables, just to work around how table columns work in order to handle indentation (and each row's indentation is handled separately with a stretched 1x1 image with a width attribute that's calculated server-side).

Re:How true hackers write JavaScript by krapp on Wednesday September 05, 2018 @07:21PM (#17922683)
Or better still, use the HTML elements whose sole purpose is to display nested content: <UL> and <LI>