|
title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
|
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
|
x
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
|
| Sunday, February 14, 2021 | |
|
No, really. Think this is intentional? I mean, you'd think the Chrome developers know what JSLint is. You'd think maybe they could sneak in an exception for it... Either way, this doesn't bode well for JSLint's usage rate. posted by ruffin at 2/14/2021 02:41:00 PM |
|
| Monday, February 20, 2017 | |
|
From Jslint Is Not A Code Quality Tool For 3rd Party Code โ Hugh FD Jackson:
Yeah, wow, no. That is bad advice. As I've said on Stack Overflow before:
I'm a huge fan of linting your JavaScript code, and there's no more thorough linter for less investment on your part than JSLint. Nothing it forces you do is objectively wrong, and you don't have to worry about getting everyone in a room to set up an ESLint rule set before you get started. But there's absolutely no reason not to use libraries that aren't themselves lintable in their original. There's a clear interface between you and that code. It's sort of like how RMS wishes you wouldn't use any non-GNU code. A proscription from using non-JSLinted libs is more political than rational. posted by ruffin at 2/20/2017 08:42:00 AM |
|
| Tuesday, May 24, 2016 | |
|
Saw a question on StackOverflow this morning that mentioned ESLint was merging with another JavaScript linter, JSCS, or at least their teams were. I added a quick comment:
Aside: I like aqui-volunteering. See what I did there? (Sorry.) One comment from the ESLint project's announcement about the merger bugged me, however...
Ah, the mythical volunteer month strikes again. If only all that were true. I still don't know what more coders really buys you. If you take the time to create clearly defined interfaces between every chunk of work, you can gain nearly 2x production from double the coders. And I think there's something to careful use of pair programming, which provides three sets of advantages:
The third is one of the most important. Forcing coders to share what they were doing and thinking with someone else gives you the first and second, but also means that your cyborg -- and all code is full of cyborgs, some strange melding of code and the style of the person(s) writing it -- is more spread out, reducing the impact whenever some of the meatware decides to move on. But does it work here?But when it comes to great JavaScript linting, I'm not sure more is better. You've still got one guy working on a linter as a side project that, afaict, is every bit as useful, if not moreso, in standardizing code and enforcing best practices than the work of the 371 (to date) at ESLint. (In case you're new to the blog, that's JSLint.) I mean, tell me which code you'd rather maintain:
or...
And I should point out the JSLint repo has no folders, and you really only need that single I like Nicholas at ESLint. Seems like a really good guy -- and ESLint seems like a good, well thought-out tool. It just seems like overkill -- harder to maintain, more to learn to use proficiently, more likely to change from installation to installation, which means less standardized code -- and there's nothing that bugs me like over-engineering. One example: Autofixing? Why not just use Typescript from the start? Seems too much for a linter. Teach me how to write good code. Don't automate the fishing. Here's a less biased example: Looks how excited this guy on SO is that ESLint makes it exceptionally easy to create new rules.. To me, that's cringeworthy -- No, no no, I don't want everyone on the team creating new rules! But if quickly creating custom rules is your use case, well, ESLint might be what you're looking to find. (Though, admittedly, I have suggested to others that they hack JSLint directly, since it's just JavaScript, which might be even worse.) Anyhow, just an interesting [to me] cultural contrast between two popular and useful linting projects. posted by ruffin at 5/24/2016 09:58:00 AM |
|
| Wednesday, April 13, 2016 | |
|
Yay? I guess I could do something like add ESLint to the list of alternatives to JSLint on the JSLint tag wiki, but that's not that horribly exciting. The next priv on SO is "Access to Moderator Tools", which actually is awfully powerful. I would've never thought I'd make it there, but with the way points from old answers keep coming in like dividends from old investments, I guess it could happen. And I can't help myself. 5000 came from another JSLint answer -- one I posted yesterday. I'm always surprised at the amount of venom JSLint gets on SO. There's almost always Within a few minutes of the question's posting, there's that second comment...
... and it's got four votes. So five people have complained about the topic of the question within a few minutes of its posting, and rewarded pretty inflammatory, off-topic speech. So I finally did it; I replied too harshly.
The implicit VBScript comparison might have been too much. ;^) I'm sure JSHint & ESLint are good tools. I've followed both a bit and used JSHint for a while, and they're fine, if you want lots of room for customization... and intra-office debate. Painfully, I replied twice, ending with, "Show me where JSLint "actively harms Javacript" & I'll show you someone who doesn't understand the lang," which I'd still stand behind, I think. You can disagree with JSLint, and it will, famously, hurt your feelings, but it's almost never wrong in any definitive way. Okay, actually I ended with...
Always makes a quick exchange more fun when you can drag in Thumb Wars. Still, I just don't get it. Is there another tool that gets this much flame? Honestly, I really do believe one of JSLint's strengths is, as I've mentioned, that you precisely don't have to get together as a committee every time someone wants to change some minor piece of JavaScript coding style. Crockford's not dumb, and, again, his prescriptions (well, proscriptions) are very rarely, if ever, wrong. And if it's wrong, he'll fix the code quickly, as I've seen a number of times (and even been a part of once or twice). Why is more opinion always better? I hate JSLint's whitespace rules, particularly with hanging lines and end parens, but say what you want, at least it's an ethos. WARNING: Some NSFW language here: Often, it's lazy to decide for yourself instead of figuring out why a convention suggested by an expert might be smart. I'm also much happier looking at JSLint's code. Have you looked at ESLint's repo? I mean, nothing wrong with it, but it sure isn't a single file. Looks like it's a node-directed solution too. Why must tools become so complicated so quickly? (I know Nicholas wanted "a JavaScript tool with pluggable linting rules", but I'm not sure all the overhead is necessary.) Anyhow, there's nothing wrong with JSLint. If it doesn't work for you, I'm sorry. But when a JSLint user has a JSLint question, give them a JSLint answer. If you've got to throw in a, "But I usually use ESLint or JSHint," that's fine, but answer the question first. /rant Labels: coding, gamification, JSLint, stackoverflow, style posted by ruffin at 4/13/2016 10:49:00 AM |
|
| Friday, November 20, 2015 | |
|
I'll try not to get too verklempt, but I finally hit my informal goal for StackOverflow: I received the [second] JSLint badge [SO's awarded]. It used to be difficult to program without googling answers to what were sometimes pretty straightforward questions -- it was more efficient -- and smarter -- to "borrow" and improve on something that'd already been through the crucible than coding "from scratch". Now, it's even more difficult to code without leaning heavily on StackOverflow. It should also be hard to receive that much value without giving something back. Admittedly, I'm nowhere near as "giving" as one of my old coworkers, who is creeping up on 80,000 StackOverflow points as I blog. But you shouldn't feel good about benefiting from StackOverflow without finding some means of giving back. For me, giving back was sitting on the JSLint tag. We started using JSLint at a company I worked with a while back, and I think I was one of our better JavaScript guys (ie, Whitaker, above, was pretty busy, so I guess I was second), so I got stuck with implementing JSLint as a company-wide blocking check-in test for TFS. I first got a Visual Studio JSLint extension working and configured like we wanted it, then I copied what it was doing and wrote a TFS rule using Noesis, the same engine that plugin used, to test files folks were checking in, slowly forcing us to JSLint our legacy code (though with exceptions for third-party libraries) as we edited files. Looking back, I should've used Node, which would have been much easier, but Noesis didn't require any serious installation. Anyhow, when you're the contact person for something like this, of course you also end up being the person who actually does much of the linting, as almost every time someone edited a file over a hundred or so lines, I'd get an email about how difficult and unfair the new policy [though I believe JSLinting code is a great idea, it was our dev manager's idea, so the unfair complaints were unf. misdirected!] was. With a few folks, after a few good tries to convince them otherwise, though I feel badly about it, I occasionally relented and gave fish rather than taught folks how to fish 'em up themselves. It was ultimately better for everyone to spend the time linting than arguing about whether they should learn to lint. And admittedly, some of those files were a mess, coded by employees who had left years ago, and having everyone in your company editing JavaScript regardless of their expertise in the language can be a bad policy. Some folks (I'm looking at you, most of the iOS team!) probably had no business being in the JavaScript files to begin with. (Note: I never so much as opened an Objective-C file while working at said company. ;^D) Regardless, like Jim Morris pitching, the unofficial work meant I became pretty good at understanding JSLint. More importantly, JSLint was (and is!) a manageable tag on StackOverflow. I'd learned it was easy to get reputation at SO just by sitting on topics and being the first to answer, but that wasn't always the best way to learn, and seemed to be more gamification than "scholarship". It's the difference between sitting on jQuery and wishing you could sit on child jQuery selectors or DOM concatenation. But JSLint had that specificity built-in. It was a small pond, but active enough that you could actually contribute. Overly long story a little shorter, here we are. I'm the second person in StackOverflow history!!!1!1!!2 to bag the JSLint badge. And boy, I did it the hard way (which is not a complement to me). The first guy to get it, James Allardice (who also has the JSHint badge) currently has 202 points answering 32 questions. I've got 101 for answering 57. I'd like to think James plowed up the ground pretty well with the obvious answers (I've gotten 24 of my points for being the first to document `ignore`, for instance), but still. There are at least 20 people with more JSLint points than me, but since only one has 20 or more answers in there, I still get to be second badged JSLinter on SO. (TJ Crowder will be there soon, I think, but other than Quentin at 13, nobody else has 10 answers.) I also like that with the exception of the last two guys on the list, who essentially have the same rep as me, everyone else has 3k or more than me, many with tens of thousands more. It's good company. Looks like my first JSLint answer was on 5 Feb 2013 (with my first question on 1 May 2012), when nobody had earned this tag yet. Just a little over two years since Allardice bagged the tag, and just over 33 months since I started, I get the second. Nobody remembers the second schmoe on the moon, but that doesn't mean it wasn't enjoyable taking the trip. Guess I'll keep watching JSLint, but (and I'd already kinda started relaxing) I'll be a little less likely to want to be FIRST! and more likely to just chime in when I have something good to add. Which is how StackOverflow should work. Labels: coding, goals, JSLint, stackoverflow, style posted by ruffin at 11/20/2015 01:44:00 PM |
|
| Friday, October 16, 2015 | |
|
So my JSLint plugin of choice for Sublime Text got a bee in its bonnet and updated JSLint.js today. Apparently, Sublime Text 2 package control automatically updates plugins by default, because my code went crazy after a reboot. And this is why I say "bee in the bonnet"; it's not like the plugin has been particularly good about updating JSLint as it's updated. Out of the blue, WHAM. There's a setting to turn autoupdate off, even one (auto_upgrade_ignore) to just ignore nasty, GOT YA!! plugins like this one. ;^D So my settings got blown away today (okay, fine, the edits should've been in my user pref file, but sometimes that file doesn't seem to take for some plugins), and JSLint got upgraded to Crockford's ES6 "friendly" version that hates this and for. Most folks I work with aren't ready for all that just yet, and I don't have the fortitude to argue they should go bleeding edge and use it. I mean, it's fighting just to get the old version of JSLint used on projects... Luckily there's a good backup of the plugins sitting in a folder (for me, it's C:\Users\YourUserNameHere\AppData\Roaming\Sublime Text 2) waiting on me, so I'm a auto_upgrade_ignore setting and copy and paste away from being back at work. UPDATE: I did a better job explaining this over on the plugin's Github Issues page, though the issue title is admittedly a little over the top. ;^) Luckily, I seem to have captured the feeling of a few other users... I'll paste that here. A few important tips, I guess, if you want to do this without bothering with
So, for instance, my Preferences.sublime-settings file currently has:
If I fall into a lot of spare time, maybe I'll fork this and let you chose a specific jslint file, though I had some trouble dropping an old jslint.js file directly into Labels: JSLint, sublime text posted by ruffin at 10/16/2015 04:28:00 PM |
|
| Tuesday, September 01, 2015 | |
|
I recently bumped into @slicknet, a developer for Box who maintains the ESLint project. Here's a quote from ESLint's About page:
Here's a good example of when open, pluggable architectures are bad news, and why benevolent dictatorships might still be the best mode of governance. Questions to ask before deciding on your own linting rules:
Answers:
Technically speaking, of course open, pluggable architectures are superior. But in this case, culturally, it's a huge mistake. Maybe Box's tech stack includes Node, where it's much harder to hide only so-so JavaScript skills, and maybe, in that environment, the openness of ESLint allows them to create something that's no worse than JSLint. But show me one place where JSLint's rules are demonstrably worse than your own (where they can't be turned off with directives) before you argue for ESLint or JSHint. (That's not to say I don't think ESLint is cool, or that a pluggable interface isn't technically superior to what JSLint offers. But now take your time from questions 5. and 6., and add an obviously smart dude's time maintaining this project. If he's doing it on his own clock, well, more power to you. It's fun to [re]create these sorts of projects, and there's no way to understand a problem better than to live in a "meta-project" like this. My guess is that Mr. Zakas knows his stuff (if I really knew him, I'd have to change #2 to "4-4.5" Or I'd keep it the same, and take myself out). If he's doing it "at work", however, we might have a priorities problem.) Labels: business, JSLint, priorities posted by ruffin at 9/01/2015 12:34:00 PM |
|
| Monday, January 26, 2015 | |
|
I wanted to see if JSHint had a provision for checking imported packages for property names in a file it was, um, "hint"ing, and ran into a link to the, "Why I forked JSLint" post (which was down -- domain now points to github? -- but lives at archive.org) again.
The post is interesting. The representative example given to fork JSLint is a horrible one, imo. Kovalyov argues that he should be able to put a
That's really not a good reason to leave JSLint. Forcing you to acknowledge variable hoisting doesn't seem that objectionable. There are other things that it forces you to do that I don't see as much wisdom in, but this really isn't one of them. And that his snippet has "Example taken from jQuery 1.4.2 source" as if that made it automatically something worth emulating also gnaws at my craw a bit. But the post's epigraph from Crockford does resonate:
Wow. Reminds me of the link I use in my StackOverflow profile to undercut where I quote, "You should take JSLint's advice," a bit. The guy's a great coder, and I enjoy his very strict approach to JavaScript 99.44% of the time, but Kovalyov is right: Crockford's social skills (and, from what I've seen, hubris) are awful. But again, bad social skills don't make the tool just as toxic. Kovalyov links to Brenan Eich, "creator of JavaScript", where Eich says, "JS Lint can suck it" That's said, sure (Eich is using automatic semicolon insertion, though he's doing it to make his code look like CoffeeScript, so Kovalyov has already taken the quote well out of context), but there's an interesting counterpoint Kovalyov misses in that same blog post from Eich:
What I like most about JSLint is that I know I'm getting similar code across the board. JSLint honestly enforces well-considered conventions. When Kovalyov says, "It is quickly transforming from a tool that helps developers to prevent bugs to a tool that makes sure you write your code like Douglas Crockford," my reply would be, "And you think your committee is going to do better?" So many questions about JSLint on StackOverflow get answered with, "You should use JSHint." But if we all use JSHint to turn off whatever bugs us, as we'd do if we followed that advice each time, what do we leave turned on? Just the things that aren't troublesome? Isn't our code getting lint-i-er each time? Show me an example of where what Crockford requires from you is wrong -- not just annoying, but undeniably worse than an alternative. I don't think it exists, yet. Isn't the point of a linter to challenge us all to write better code? posted by ruffin at 1/26/2015 12:33:00 PM |
|
| Wednesday, November 26, 2014 | |
|
So we all know how to run JSLint from Node, but what if you want to use Firebug or something to step through? The version Crockford uses on jslint.com is minimized and includes a lot of overhead you don't need to run locally (http://jslint.com/webjslint.js). It's obviously not that difficult to set up. Here's the easy version. I'm not sure how well the formatting will keep with this email-to-blog post, but hopefully I'll eventually remember to return and clean it up. So save the below into index.html and knock yourself out. No jQuery or nuttin required. Gosh, I hope this post works. HTML always worries me with Blogger. It's anyone's guess how it'll parse it this week. <html>
<head>
<script src="jslint.js"></script>
<script>
function jslintalizeMe()
{
var i, divOut, errs, errsMsg = "";
divOut = document.getElementById("errors");
divOut.innerHTML = "";
if (!JSLINT(document.forms[0].elements[0].value))
{
errs = JSLINT.errors;
for (i=0; i < errs.length; i++)
{
err = errs[i];
if (null !== err)
{
if (undefined !== err.id)
{
errsMsg += "Error: "
+ err.code
+ " -- line "
+ err.line
+ " char "
+ err.character + "<br />"
+ " "
+ err.evidence + "<br />"
+ " " +
err.reason + "<br /><br />\n";
}
else
{
errsMsg += err.reason;
}
}
}
divOut.innerHTML = errsMsg;
}
}
</script>
</head>
<body>
<form>
<textarea rows="24" cols="80"
placeholder="// Paste quality code here"></textarea>
<br />
<button onclick="jslintalizeMe();return false;">JSLint</button>
</form>
<div id="errors"></div>
</body>
</html>
Look, that's ugly, I get it. But it's the easiest way to get JSLint running in a good, easily Firebuggable fashion. Enjoy. ;^)Labels: javascript, JSLint posted by ruffin at 11/26/2014 10:52:00 AM |
|
| Friday, July 11, 2014 | |
|
I give up. I was going to blog about brittle code in jslint.js, but instead I think I'm inching closer to leaving Blogger after almost 13 years. In the last few years, the changes Google's made to the composition tools have made it excruciating difficult to write and edit (compose, right) blog posts. How can Pyra have gotten this so much "righter" a decade ago? Here's what I sent them that their robots will enjoy reading. I don't normally like to complain in feedback, but this is a reasonably important service for me, and they're botching the crap out of it. The usability trendline should not be a consistent cliff. Heavens only knows what's going to happen to the ampersands in this paste. Hopefully just using the compose window works. Good grief folks, can we roll back to the old pyra editor? I've put the following text into the HTML pane: Labels: blogger, google fail, JSLint posted by ruffin at 7/11/2014 10:16:00 AM |
|
| Thursday, October 03, 2013 | |
|
Alex Leโs Blog ๏ฟฝ Blog Archive ๏ฟฝ โsaferโ parseInt() for JavaScript with plus unary operator
Alex Leโs Blog ๏ฟฝ Blog Archive ๏ฟฝ โsaferโ parseInt() for JavaScript with plus unary operator:Additionally, parseInt and make different assumptions about the radix when thereโs a leading zero. โ012โณ returns 12, but parseInt(โ012โณ) returns 10. The leading zero causes parseInt to treat it as an octal number in probably all browsers, despite octals being summarily deprecated in ES3. Of course, you can use parseInt(โ012โณ,10) to get around that. Ran into this while looking for info on using the "unary plus". See? This is another reason why Crockford's not full of it, for those who still think he is. Missing radix !== jslinted. Labels: javascript, JSLint posted by ruffin at 10/03/2013 01:55:00 PM |
|
| Sunday, June 16, 2013 | |
|
jslint_com : Message: Re: Does a global variable exist?: Re: Does a global variable exist? < Prev Next > This man's got it. (Surprise, I know.) So, if I wanted to see if knockoutjs exists inside of some browser-based javascript code, I'd write... if (window.hasOwnProperty('ko')) {... Got it? Good. Labels: javascript, JSLint, noteToSelf posted by ruffin at 6/16/2013 03:30:00 PM |
|
| Thursday, May 02, 2013 | |
|
For some reason, I'm often forgetting how to set JSLint options in Darren DeRidder's excellent Sublime Text 2 plugin for JSLint. Here's how: You can set any of jslint's options under preference -> package settings -> jslint -> advanced built settings. See http://www.jslint.com/lint.html#options for a list of options in JSLint. There's no move_var option (that's just a label for an error condition), but you can use the vars: true option to permit many variable declarations per function. Now any other random blog would stop there. Done. You're on your own. But not freakinname. No no, we also clutter up the net with some bonus bytes showing what options I'm currently using. Why? To jump start your own JSLinting? Oh no, no, it's in case I set up a new box again, natch. {
"cmd": [
"node",
"${packages}/JSLint/linter.js",
// sloppy line breaking?
// tolerate dangling _ in identifiers
"--nomen",
// tolerate ++ and --
"--plusplus",
// tolerate missing 'use strict' pragma
"--sloppy",
// sloppy whitespace
"--white",
// assume a browser,
"--browser",
// suggest an indent level of ...
"--indent", "4",
// assume node.js to predefine node globals
"--node",
// tolerate unfiltered for in
//"--forin",
// tolerate stupidity
"--stupid",
// tolerate todo
"--todo",
// anon whitespace okay
//"--anon",
"--maxerr","6",
"$file"
],
"file_regex": "^\\/.*\\/([^\\/]*)$",
"line_regex": ".*\/\/ Line ([0-9]*), Pos ([0-9]*)$",
"selector": "source.js, source.css, source.json, source.sass, source.less, source.html"
}
You're welcome. ;^) Labels: JSLint, sublime text posted by ruffin at 5/02/2013 11:25:00 AM |
|
| Monday, January 14, 2013 | |
|
jslint4java - A Java wrapper around Douglas Crockford's jslint tool. - Google Project Hosting: This is a java wrapper around the fabulous tool by Douglas Crockford, jslint. It provides a simple interface for detecting potential problems in JavaScript code. Labels: java, JSLint, noteToSelf posted by ruffin at 1/14/2013 10:02:00 AM |
|
| Thursday, January 03, 2013 | |
|
Javascript .NET - Documentation: This section provides documentation to get quickly started to embed and run Javascript .NET in your application. The project you were looking for is Javascript.NET, which is/uses (?) Noesis.Javascript, which embeds the "Google V8" javascript engine. Enjoy, profit, whatever. Found that by chasing down how the JSLint plugin for Visual Studio worked. Labels: Google, javascript, JSLint, visual studio posted by ruffin at 1/03/2013 09:51:00 AM |
|
| Tuesday, December 18, 2012 | |
|
Web Reflection: JSLint: The Bad Part: In few words, as I have said already before, null is == only with null and undefined, which means we can avoid completely redundant code such: I think that's a fair critique, if accurate. It's an interesting trip through JSLint quibbles. Ultimately, I guess I'm finally on the side of, "Nobody should care if I don't use it while I'm developing, and I shouldn't care if I'm made to use it (or other lint my code) once I'm done." JSLinting is a fairly painless process, and if nothing else, at least it removes meaningless discussion over coding convention preferences. I mean, this guy covers everything, it seems. Does minified JS pass JSLint? Labels: javascript, JSLint posted by ruffin at 12/18/2012 02:54:00 PM |
|
| Monday, December 10, 2012 | |
|
Principles of Writing Consistent, Idiomatic JavaScript: All code in any code-base should look like a single person typed it, no matter how many people contributed. Though I'm exceptionally guilty of trying my darnedest to revamp coding practices, in theory I can't argue with that at all. Note to self: Return and look through. JSLint is one way to move in this direction, but there are plenty of cultural choices even Crockford can't reach [programmatically]. Labels: coding, javascript, JSLint posted by ruffin at 12/10/2012 12:55:00 PM |
|
| Tuesday, September 11, 2012 | |
|
unscriptable.com ๏ฟฝ JSLint puked on my javascript!: Iโm not sure what specs you were looking at but ECMAScript defines the following syntax: JSLint apparently told the OP not to write code like... if (!already) You needed brackets, JSLink said. The OP thought Javascript's specs backed JSLint. (Aside: I know, it's apparently supposed to be JavaScript, but we've already talked about style rules.) The commenter claims ECMAScript says that's not the case. I think JSLint is useful but crazy. It's fun to see I'm not alone. Also fun to see searching for JSLint foibles turns up hits like this. Edit: Crockford really is a little crazy. Have you ever heard someone speak in so many absolutes that wasn't speaking religion? Wait a minute... Listen to the fetish on perfection. He actually believes it exists. He's Plato. He's stuck in the Renaissance. It's a dated, neurotic, naive worldview. Bizarre. "There has been no human evolution since the paleolithic age." Oh, okay. This claim drives me mad. Of course there has been. Are you kidding me? No, we don't have a different number of genes than we used to, if that's what he means. Sure, we could reproduce with a fairly old model of homo sapiens. No, we're not (yet) a new species. /sigh But that's not what evolution is. Rather, that's not all that evolution is. Here's how evolution works: An organism morphs randomly. It doesn't improve viability. There's no selective advantage. The mutation goes away, or, if zero sum (or only a small disadvantage), it randomly sticks around, hoping to tack itself to other traits that are useful. You know, like widow's peaks or nearsightedness. Or the mutation improves the organism's selective condition. Crockford might pick up Falk's Braindance (iirc). Mutations happen quickly, at times. There's some evidence our hands became feet in an evolutionary second. WHAM. More footed homo whatevers than not. Our brains? Braindance says we WHAM, got better radiators around our brains. They could be cooled, and they exploded in size and ability. Turns out that was the right way to go, at least in the short run. The brain didn't grow like mad because we needed to use tools. The randomness allowed us to use tools in a manner than provided a selective advantage for a time. It didn't make us hunters and gatherers. It enabled hunting and gathering. Get this -- the move to large brains works for programming too. The brain isn't a hunter and gatherer's brain. It's a mutation, ready to try on whatever comes its way. It's not (literally) directed. It's a passive selective system. There's no a priori reason why our mutations can't push us to be better at both -- hunting and gathering and programming. And moonwalking, both kinds. Can you imagine the real world Fred Flintstone equivalent having this discussion? "We have brains that allowed us to pick fruit from trees with more efficiency, not to be hunters and gatherers. We're not evolved to do this! Our feet were made to allow us to travel between trees quickly, not to run along the savannah! This is madness! We're not made to do this, Nemo!" The point is that if we forced Fred from the trees to the laptop-equipped cubicle instead of the savannah, he'd have done just as well as we're doing now. In a sense, Crockford's arguing against himself. We haven't changed a heck of a lot, and that means we're even less hunter and gatherer than he assumes. We're simply human. Admittedly, at that incensed point, I stopped listening and got Videobox to save it for me to watch offline later. /sigh Some smart people get caught up in their own press. Doesn't make them dumb. Makes them lazy. Never be positive. Never. (What? Oh yes, yes I am. Positive, not smart.) Labels: JSLint posted by ruffin at 9/11/2012 09:03:00 AM |
|
| Thursday, September 06, 2012 | |
|
douglascrockford/JSLint: The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature. A great writer doesn't express himself by putting the spaces before his commas instead of after, or by putting extra spaces inside his parentheses. A great writer will slavishly conform to some rules of style, and that in no way constrains his power to express himself creatively. See for example William Strunk's The Elements of Style [http://www.crockford.com/wrrrld/style.html]. E. E. Cummings might disagree. Look, I've written about JSLint's Crockford before. He's a little off his rocker. It's perhaps a productive neurosis, but it's something of a [non-clinical, popular connotation only] neurosis nonetheless. The important thing here is that there are not persistent rules of grammar, in writing or coding. Strunk & White didn't decide what was a best practice when they wrote of grammar and style. They tried to capture current convention. Language doesn't sit, sessile. It's morphs. Nobody says, "Verbing weirds language," until they do. Maybe he's against illegal opcodes too? Well, that'd be stupid. Why not do what the machine lets you, if there's an advantage? Let your peers decide if what you've written is better, and the circle of peers is lots larger than just Crockford. We don't all evolve lockstep with someone's plan. That's the whole point of a passive selective system. The worst part is the take it or leave it mentality JSLint has. Found an error? Sometimes, apparently, it just stops. I'm sure there's a setting somewhere, but a coworker has experienced it stopping on (var i; i < intLimit; i++). Stopping. No additional information. Change where the i is declared or I'm taking my toys and going home. If you don't fix each error, I'm not letting you know where all of them are, regardless of if the code works or not. That's wack, man. Bring back the poetry. Or at least the chance for all us primates slapping at keyboards to accidentally make some. EDIT: This, from the Criticism section of Elements of Style's entry on Wikipedia, has some interesting info... In criticizing The Elements of Style, Geoffrey Pullum, professor of linguistics at Edinburgh University, and co-author of The Cambridge Grammar of the English Language (2002), said that:The book's toxic mix of purism, atavism, and personal eccentricity is not underpinned by a proper grounding in English grammar. It is often so misguided that the authors appear not to notice their own egregious flouting of its own rules . . . It's sad. Several generations of college students learned their grammar from the uninformed bossiness of Strunk and White, and the result is a nation of educated people who know they feel vaguely anxious and insecure whenever they write however or than me or was or which, but can't tell you why.[10] Yeah, see, that's not the paradigm we're looking for. [sic] Labels: coding, communication, javascript, JSLint posted by ruffin at 9/06/2012 09:15:00 AM |
|
| Tuesday, May 01, 2012 | |
|
Hilarious "exchange", though that's being kind, on github regarding JSLint. I could copy and paste, but it's required reading in the original. I'll highlight two bits with images for you "TL:DR or click"-ers. ![]() So kittteh sayz "Can I politely ask for cheezeburger". ![]() ... I get an additional error stating Unexpected space before '['. Mr. Crockford responds: NO WAY KITTEH!!! ![]() When this happens to me, I get a little flush. What thah...? I mean, engage the asker, right? Why the draconian SLAM? He's not asking if it's, in your royal opinion, The Right Thing to do. He's asking, nicely, if you wouldn't mind him doing This Wrong Thing briefly. When someone is asking respectfully, likely represent a problem experienced by more users than themselves, what's the right move? Well, wrong is, "NO KITTEH, THAT'S MY POT PIE!" I mean, it's fair game to say, "I get your meaning, but, at least subjectively, I'd like to encourage different behavior." Macro it. It's nicer. Thank you to Cartmans around the world for your pleasant conversation, even when you're right. ;^) Labels: communication, crockford, JSLint posted by ruffin at 5/01/2012 10:56:00 AM |
|
|
| |
|
|
All posts can be accessed here: Just the last year o' posts: |
|||||||||||||||||||||
|
||||||||||||||||||||||
|
|
|
|