Generic-user-small Stéphane Boi... 5 posts

Good day, Thank you for a great book Christophe,
I was wondering if you had any suggestions as to an IDE (or eclipse plug in [JSEclipse doesn’t seem to work]) that would do prototype code completion for those of us who have “difficulties” with remembering functions and writing in general. Also I just had a few comments, On page 82 (and others) there are the examples now I am pretty sure I know why $R(1,20).include(12) is true [because 1 evaluate to true and so does 12] but I would like to a small explication beside the answers that might not be fully certain or fully certain.

Merci!

 
Headshot_120px_small Christophe P... 28 posts

Hey Stéphane, you’re welcome :-)

As for an IDE: I just stopped using full-blown IDEs when I switched to Rails, so I’m not all that up-to-date on the state of the art for JS-related IDE tooling. I do hear a lot about Aptana (incidently, these guys took over RadRails as well), which is still Eclipse-based, but appears to be the most advanced JS-related IDE there is so far. I don’t know how well they support Prototype. Typically, IDEs do a sub-par job when dealing with dynamic languages, as they can’t infer as much completion as they could in statically-typed systems. Prototype’s code style is also heavy on nice JS idioms that are, however, difficult to auto-analyze and complete/scope for by an IDE.

If you’re on Mac, I would suggest looking into TextMate and recent bundles I’ve seen flying around that specifically address Prototype. As they focus on the regular idioms the library recommends, they may be of more help code-style-wise. If you’re just in it for method name completion, other tools may be sufficient.

Also know I’m starting work on a RefCardz™ from the book, which may help you get the kind of quick reminders you need.

Now on to the second part of your message: I’m not sure I get all that you mean, but on the specifics of $R(1,20).include(12), your text doesn’t make sense. $R creates an ObjectRange, and the reason why this call returns true is that 12 is, indeed, in the integer range [1;20]. Boolean equivalence is never used here, and frankly, if it were, the statement would be downright weird.

‘HTH

 
Generic-user-small Stéphane Boi... 5 posts

Christophe,

As for the second part of my message reading it now… I have no idea what I was thinking… some strange coffee hallucination maybe….
As for IDE’s with Dynamic languages I have had an incredible with PHP on the PhpED and ZDE Studios with their magic figuring out variables type and object types and such and was therefore hoping to see something of the like to remind me of the arguments and the function names. a cheat sheet on the second monitor could be almost as useful.

thanks again.

 
Headshot_120px_small Christophe P... 28 posts

Look up Kangax’s awesome Prototype 1.6.0.2 cheatsheet for this :-)

4 posts, 2 voices