![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
necessary to make it happy. As I recall from my C days, lint was more like a pre-compiler that would tell you what real errors/warnings you have in your code, rather than how it's not suiting one person's style choices. It was used because it was quicker than running the full compiler. |
#12
| |||
| |||
|
|
On Jun 12, 7:35 pm, Stevo <n... (AT) mail (DOT) invalid> wrote: I think it's wrong for it to be called jslint when really it should be called jscrockford. |
|
Concerning the OP's question: there is not a damn difference between Array and [] - they are equal. One plus of Array is that it allows to set the initial size of the array without members' initialization: var a = new Array(1000); it may be useful if one needs to take extra steps on array elements above or below the initial size. |
#13
| |||
| |||
|
|
* * *[] and new Array() do the same thing. |
#14
| |||
| |||
|
|
On Jun 13, 12:08 am, Douglas Crockford <nos... (AT) sbcglobal (DOT) net> wrote: [] and new Array() do the same thing. And it's a very bad one, indeed : var empty = []; that can turn even worse : empty.push(empty); Have to have somebody take a look at it *asap*, jejeje. |
#15
| |||
| |||
|
|
Duncan Booth wrote: Dan Rumney <danrumney (AT) warpmail (DOT) net> wrote: I've no problem against JSLint choosing a specific convention and applying it. I'm just wondering if there is anything *beyond* convention to speak in favour of literal over constructor notation. I do have issues with some of the other warnings generated by jslint which is why I produced a modified version that lets you ignore particular error messages if you don't like them. I think it's wrong for it to be called jslint when really it should be called jscrockford. It's something that he wrote that highlights anything that doesn't meet his particular coding standards. They're not rules, just preferred styles. Not that I'm saying there's anything wrong with the things it complains about, but they're certainly not all errors. I tried it once and didn't want to change my code in the way necessary to make it happy. As I recall from my C days, lint was more like a pre-compiler that would tell you what real errors/warnings you have in your code, rather than how it's not suiting one person's style choices. It was used because it was quicker than running the full compiler. Right. I'm not worried what he calls it, but lint for C warns you about |
![]() |
| Thread Tools | |
| Display Modes | |
| |