Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I got a quite huge JS library whose details I need to be able to understand. Unfortunately, I am quite new to Js development since I am coming from Flash and Flex. It is very hard for me to orient around all the files of the framework. I miss one great advantage of the AS3 support tools - being able to see the actual definition of a given piece of code, and thus start my journey from somewhere. Whatever file I tend to pick up, I have the feeling that they are all mixed up, and I am somewhere in the middle. methods are being called, properties are being set, however, I don't even know where to look for the definitions of those things. I am desperate.

In general, what tips could you suggest for browsing and studying large and distributed pieces of JS code?

share|improve this question
Don't pelt me with stones here - but API documentation is killer. – Danjah May 31 '11 at 23:09
String search is easy to use. Hopefully the code has documentation. You can read it all – Raynos May 31 '11 at 23:21
If you would be under Linux i would recommend grep + cTags but... – JackLeo Jun 2 '11 at 7:47

migrated from stackoverflow.com Jun 2 '11 at 3:47

4 Answers

Since you're using Eclipse already, I highly recommend Aptana. It's a brilliant, free plug-in for Eclipse that provides tools for HTML, CSS and JavaScript. The JS editor highlights JavaScript keywords and provides tool tips if you hover over them. There's an outline editor that shows the outline of your .js file. You can even enable JSLint, a JavaScript validation script that shows you where your code could be or should be better.

share|improve this answer

also don't forget to use keyboard shortcuts :)

share|improve this answer

Get a good IDE? So you can click around and find definitions without having to search for them. You could also try some code analysis tools but unless the code is really horribad a good IDE should get you started.

share|improve this answer
Please, suggest one. I've always been using Eclipse due to my work with Flex – user3308 May 31 '11 at 23:03
I personally use PHPStorm because it's fast, some colleagues use NetBeans. – Frits van Campen May 31 '11 at 23:05

It depends on the editor, in Geany, you can Ctrl+click a function to go to the function's definition. In Eclipse, F3 jumps to where the selected function is declared.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.