Skip to main content
11 events
when toggle format what by license comment
Dec 30, 2020 at 21:59 comment added Blindman67 @ScottyJamison Yes I totally agree, if there were no opposing view points then change would be very slow. Not a good thing for the forward edge of technology driven work IMHO. :)
Dec 30, 2020 at 20:30 comment added Scotty Jamison @Blindman67 Thanks for your opinions - while I'll continue to disagree, I always like hearing opposing viewpoints to better understand why people code different ways - there's usually something to learn from them :).
Dec 30, 2020 at 20:25 comment added Blindman67 @SᴀᴍOnᴇᴌᴀ Because a linter has an option we all must follow? Linters are products, products compete via features, features help gain popularity, popularity breads unquestionable dogma. Linters add warnings to a language without, that is all, they do not dictate what is good code and what is bad.
Dec 30, 2020 at 20:08 comment added Blindman67 @ScottyJamison I disagree. It is my opinion that... Clear and unambiguous intent is not self documenting, it just good code. There are many arguments against let (noisy, encourages long functions, increased memory use, to name a few) let is based on a flawed premise, dogmatically promoted on un-instantiated evidence (block scope makes code better!!?) . Id mapped to global scope came from IE 4 (or earlier, recalling my way back machine) Was then adopted by other browsers until formalized in HTML5. It is not magical, enforces uniqueness across page, scripts, and reduces code noise.
Dec 30, 2020 at 18:19 comment added Scotty Jamison There are many good points here, and a lot to learn from this post. But I'll respectfully disagree on a few: * Don't use auto-generated globals from element ids, they're "magical", hard to know where they come from, and browsers want to deprecate them. See stackoverflow.com/questions/3434278/… * I agree with @SᴀᴍOnᴇᴌᴀ and would still prefer let over var, even when they act the same because they're defined in a function scope - there's no advantage to self-documenting this.
Dec 30, 2020 at 18:17 comment added Sᴀᴍ Onᴇᴌᴀ Some argue "In ES6, there's no reason to use var - use const instead (or let when you must reassign)" and "(If you're writing in ES2015, never use var. Linting rule)" - citing linting rule no-var
Dec 30, 2020 at 9:15 comment added Blindman67 @user6248190 I did not use const as they all are variables. I used var because they exist in the function's scope, thus using let would not clearly indicate my intent.
Dec 30, 2020 at 9:10 comment added user6248190 also what is the reason for using var instead of let and const to define word, guesses, status, used;?
Dec 30, 2020 at 9:09 comment added user6248190 amazing feedback and detailed explaination. I think what was new to me was that I didn't know you could chain ternary operators like the following, status = !guesses ? STATUS.failed : finsished ? STATUS.finished : STATUS.playing;
Dec 30, 2020 at 9:06 vote accept user6248190
Dec 30, 2020 at 1:08 history answered Blindman67 CC BY-SA 4.0