Question

I'm starting to learn java script by developing a webapp. I'm specifically working with google maps API. Coming from a Java/C++/C# desktop development background, I find it very frustrating to program using the imported code supplied by Google, without being able to "shop for options" using code completion. Is there any way to get this in Netbeans or other IDEs (I'm willing to learn a new IDE to go with learning a new language)?

Was it helpful?

Solution

Visual Studio has javascript autocomplete (they call it "IntelliSense"), but you come from a C# background, so I would have thought you would know that.

http://msdn.microsoft.com/en-us/library/vstudio/bb385682.aspx

Edit: I don't know how advanced the intellisense has become with Visual Studio 2012, but in earlier versions you would often use a vsdoc.js file that includes all the information you would need. For instance, here's a file somebody made for Google Maps API 3: http://gmapvsdoc.codeplex.com/releases/view/41099

OTHER TIPS

Code completion is generally a feature of compiled languages. Within a compiled language, it is predetermined what methods an object will have, so it's very feasible for an IDE to show you options.

This is much harder in a language like javacsript. Consider the following code

a = {}
a.foo = function(){ console.log("test1");};
a.bar = function(){ console.log("test2");};
a.bar();

you would need a different autocomplete at every line of that code depending on what functions had been added to a.

You do get a benefit in an interpreted language that you don't have in compiled languages that you can have a real-time interpreter.

If you install node (or open the console in your browser) you can have an interactive prompt that you can write code in at the command line. In that instance you do get autocompete because there is actually a live running instance of the software.

There is a tradeoff here. You don't get as much help remembering function names while writing in an editor, but it is also very handy to be able to type "at,b".split(","); in the command line and immediately see what the result is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top