I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.
Using HTML5 tags such as , you don't need CSS or JS! Try this in Chrome: https://jsfiddle.net/timdavila/f5rcarmn/
CSS is powerful, you can do a lot of things without JS
281–290 of 319 posts
Re: CSS is powerful, you can do a lot of things without JS
#282Earlier quoted context omitted.
If it involves jQuery then it is not 3 lines. The original claim was 3 lines of Javascript. Making a claim something is only 3 lines of Javascript without including the fact that jQuery is required is a disservice to the many people that made jQuery the wonderful library that it is. That is the source of my disagreement.
You're being disingenuous. Firstly, "3 lines of Javascript" wasn't meant to be taken literally. Not only that but 73% of the top 100,000 websites use jQuery - if you are on a large web development project you are more likely than not using jQuery. [1] http://trends.builtwith.com/javascript/jQuery
And I know the trends around jQuery, that was not the issue at all.
Re: CSS is powerful, you can do a lot of things without JS
#283Earlier quoted context omitted.
If it involves jQuery then it is not 3 lines. The original claim was 3 lines of Javascript. Making a claim something is only 3 lines of Javascript without including the fact that jQuery is required is a disservice to the many people that made jQuery the wonderful library that it is. That is the source of my disagreement.
That isn't a disservice to jquery. The fact that people don't explicitly mention it could actually be viewed as a demonstration of its ubiquity.
Re: CSS is powerful, you can do a lot of things without JS
#284Earlier quoted context omitted.
If it involves jQuery then it is not 3 lines. The original claim was 3 lines of Javascript. Making a claim something is only 3 lines of Javascript without including the fact that jQuery is required is a disservice to the many people that made jQuery the wonderful library that it is. That is the source of my disagreement.
>>If it involves jQuery then it is not 3 lines. The original claim was 3 lines of Javascript. jQuery is JavaScript, so...
I've written a couple of small jQuery plugins and I don't claim I wrote this awesome Javascript code that does this cool thing. I say I made a jQuery plugin that does this cool thing.
Re: CSS is powerful, you can do a lot of things without JS
#285Earlier quoted context omitted.
If you had read the next sentence of my comments you would have seen that it would be a "few more lines" if you didn't use jQuery, basically you need a function like: function eachItem(arrayLike, cb) { return [].slice.call(arrayLike).forEach(cb); } So 3 more lines. If I said you can write a very verbose accordion in under 20 lines would that be good enough for you?
>> So 3 more lines. If I said you can write a very verbose accordion in under 20 lines would that be good enough for you? Since that's more realistic, yes that would do nicely.
Two others completed the accordion in 3 lines task without jQuery.
Re: CSS is powerful, you can do a lot of things without JS
#286Earlier quoted context omitted.
Your complaint is essentially that they are using a language that other people working on the same project don't know. There are good reasons to discourage that: it fosters bikeshedding, and CSS's ways of expressing dynamic behavior doesn't match intuition as well as procedural javascript. However these reasons have to be weighed against technical limitations. Using CSS for dynamic behavior is often better than using…
Lets be honest, 99% of people who disable javascript are programmers who take great honor in complaining about every website that is more than 200k in size. This is a non-issue for most companies.
Re: CSS is powerful, you can do a lot of things without JS
#287Earlier quoted context omitted.
Your complaint is essentially that they are using a language that other people working on the same project don't know. There are good reasons to discourage that: it fosters bikeshedding, and CSS's ways of expressing dynamic behavior doesn't match intuition as well as procedural javascript. However these reasons have to be weighed against technical limitations. Using CSS for dynamic behavior is often better than using…
Lets be honest, 99% of people who disable javascript are programmers who take great honor in complaining about every website that is more than 200k in size. This is a non-issue for most companies.
Re: CSS is powerful, you can do a lot of things without JS
#288Earlier quoted context omitted.
That isn't a disservice to jquery. The fact that people don't explicitly mention it could actually be viewed as a demonstration of its ubiquity.
No, it's people becoming not being able to know the difference between jQuery and Javascript. Calling either of them the other is a disservice to both.
Ignoring the fact that it clearly wasn't intended to be taken literally, "in 3 lines of JS" when speaking in the context of a team effort on a web application can be understood as "adding 3 additional lines to the source code." Context.
There's no need to be nasty and argumentative for no reason.
Re: CSS is powerful, you can do a lot of things without JS
#289Re: CSS is powerful, you can do a lot of things without JS
#290Earlier quoted context omitted.
It would actually be wise to arm special forces with laptops, as we're only going to see more and more operations depending on hacking into security systems and building automation systems with the rise of smart devices that have no business being on the web (aka IoT). Only a matter of time before guns will only really be useful in third world countries without electricity.
So, are you saying that a bunch of guys with wire cutters and guns would be unstoppable? Simple scenario: 1. Cut all the power (grid connections A, B and C, disable generators) - nobody says no if you ask nicely and have a big gun 2. Watch the special teams struggle helplessly to hack into offline systems 3.PROFIT!!! Your assumption (that the network somehow runs on unicorn farts and that the need for boots-on-the-gr…