5,586 karma · joined December 1, 2011
"otherwise comments get outdated easily" - not mine. If this is a problem, it's a problem that needs fixing, not a reason to comment less.
"extract that piece of code into a method" Sometimes, yes, but you can overdo this and end up with a fragmented codebase that is harder to follow.
This is an old debate, and there are books on either side. My preference is something approaching Knuth's literate programming.
I'm not saying you don't need to include the 'why', I'm saying there is value just in the 'what'.
As for code comments that just 'explain something obvious'... I have no problem with comments that simply summarise, in English, what the next few lines do. It means I can skim through a file just reading the comments, until I find the part I want to debug/modify/understand in more detail. Also, if you can sum up some code with a sentence then there's a good chance it makes sense, so it's a good quality check.
These aren't mutually exclusive.
But I agree with trying to get rid of cruft from OS licences. I think the ISC one seems like the best balance.
(It's at 1:05)
No, I can't do it (don't even understand the question) but I certainly understand what recursion is, and can solve problems and make things work far more reliably than many of the more academic programmers I have worked with.
Also, the API docs being automatically customised per-table is awesome.
It's really not disturbing.
It's obvious that the way something is presented can affect your judgement about things like the motives (or credibility or even identity) of the person saying it, and it's obvious that this will in turn affect whether you believe what you're being told. Things like tone of voice, choice of words, and typeface all have an effect.
Why does it surprise people that the manner in which you communicate can affect how likely people are to believe what you're saying?
https://github.com/SublimeLinter/SublimeLinter-shellcheck https://atom.io/packages/linter-shellcheck
I didn't say it was a free pass to do anything. You can't lie about the company, for example. But that would be libel, not trademark infringement. As long as it's obvious to consumers that your use of the trademark is not on behalf of or authorised by the company, then it's not trademark infringement.
And yes, simply adding "sucks" would pretty much always be a free pass against trademark infringement , except in really contrived scenarios, like if the trademark was a brand of vacuum cleaners :)
That said, the Dumb Starbucks example is interesting, I think that's in a grey area, the kind of edge case you're talking about. Starbucks might well be able to demonstrate that some customers thought it was official (albeit obscure) marketing effort by them, especially because it's a coffee shop.
Of course it's fine to market a series of magazines called "_____ sucks". It's just expressing an opinion. Trademark law doesn't come into it, unless the trademark owner can prove that consumers might reasonably think your use of their trademark is somehow authorised or affiliated with them. In the case of "____ sucks", that would be self-evidently not the case.
For trademark infringement, there has to be "likelihood of confusion", i.e. your use of their trademark could lead to people thinking that your goods/services originated from the trademark owner. In the case of someone explicitly critisizing a company, this could never be argued.
That sounds far fetched. There would be no consistency in the kind of sites you'd get, no way for this to develop into a mnemonic. It would never become such a 'thing' that it could compete with the status quo – that you can just google for negative stuff about any company or person and get multiple, relevant results (instead of just the ravings of one particular random person who had a grievance).
Or to put another way, what problems will I run into if I just commit large media files without using this?
https://github.com/getify/You-Dont-Know-JS/blob/master/async...
Both of them are really good, and come at it from slightly different angles.
I don't agree the keyword "generator" would have been ideal. It wouldn't work when using 'enhanced object literals' [1], where you can declare a method without even using the keyword "function". In this case, if you want the method to be a generator, you can just put an asterisk in front of its name, so it's consistent with the "function*" syntax.
[1] https://babeljs.io/docs/learn-es6/#enhanced-object-literals
Yes, loads of things work without JS. You can use Wikipedia, even to edit articles, with JS disabled – it's all simple HTML forms. JS just makes the experience smoother (adding buttons to help with WikiText formatting, etc).
Most content and shopping websites work fine without JS. You asked how do you fire off AJAX requests without JS? You don't. You just design your app so it basically works as a set of HTML pages connected by hyperlinks and form submissions. Then you add JS to enhance things.
> Apparently I've missed a whole area of web development if this is all possible with no Javascript.
Yes you have. When I started (~12 years ago), JS was only used for little whizzy effects here and there, not much else. Then JS started becoming more viable due to prototype and jQuery, but it was always the most flakey part of web development, and we learned to use it cautiously as an optional layer of enhancement. You couldn't rely on it always working. It was a way to 'differentiate' your site, not a serious building block.
Now, everything has changed, JS is everywhere and we tend to call things 'apps' more than 'sites'. I spend 70% of my day writing JS. I'm not sure if I agree with the JS-bashing sentiment of the article. But I do think it's still good practice to design your app so it delivers your core content/functionality without JS. Most stuff (blogs, e-commerce, forums, etc) can be built like this. (Admittedly some things like p2p streaming apps just can't.) Then you can use JS to enhance things, like enhancing your basic search form with as-you-type suggestions. This approach makes your codebase more structurally sound and less entangled, and makes your app more resilient.
This claim always bugged me. The output of dart2js is raw JS. Same with CoffeeScript (which makes a similar claim). So these claims are totally reliant on parameters that haven't been defined, ie. what constitutes "equivalent" handwritten code?
Can you give a reference for that?
HTML5 Boilerplate, Yeoman's generator-webapp and Google's Web Starter Kit do not come with these script attributes OOTB.
EDIT: ha I just noticed your username. Maybe you can tell me why those projects don't come with async script tags?