I am working on an ASP.NET project, and it is very frustrating how poor the support for JavaScript is in VS. For example, no outlining, no f12 to find a definition, no refactoring, no code analysis, no ready support for documenting functions, horrible navigation and barely functional intelisense.
Although JavaScript is no doubt an intractable language, it is clearly possible to do these things: many PHP/Python/Java toolsets have much better support.
I was wondering if there is a decent plug in for JavaScript in VS? Does everyone just suffer in silence, or am I missing something? I find the contrast between working in the C# side, which has awesome tools, to the JavaScript side which has tools with 1990s functionality quite disconcerting.
I'm looking forward (it's not available as yet) to the JavaScript support in ReSharper 6: http://blogs.jetbrains.com/dotnet/2010/09/resharper-6-javascript-css-support-coming-up/
This one is pretty good too ..
http://code.google.com/p/js-addin
Related
Is there a version of quickcheck that works for Javascript and that is well maintained? I have found several such as check.js and claire, but none of them seem to support shrinking of failing test cases, which has always struck me as the most useful part of the whole problem.
I'm creator of jsverify. I'll try constantly to make it better, bug reports and feature requests are welcomed.
There are also a list of other javascript generative testing libraries in a readme. So far I haven't found any other good alternative to the jsverify.
I recently released https://github.com/dubzzz/fast-check
I built it in order to answer several limitations I encountered in the existing quickcheck implementations in JavaScript.
It comes natively with a shrink feature which can shrink even combination of arbitraries (the frameworks I tried were failing on oneof like arbitraries).
It also can generate large objects and arrays.
By default it tends to try smaller values first in order to detect trivial edge cases while it covers all the possible inputs in next runs.
Lots of other features are on-going or already available :)
Cheers,
Nicolas
I wrote quick_check.js, which has a nice library of generators. Shrinking is not there yet, but is planned.
There seems to be a dearth of good quickcheck-like testing tools in javascript. However they are to be better supported in typed languages, and in fact you can write your tests in one of those languages if you wish.
To avoid dealing with runtime interop, I'd recommend going with a language which compiles to JS and runs on node.js (eg: Purescript with purescript-quickcheck), or a java-based language using the Nashorn engine provided in Java 8, for example ScalaCheck. You could even use ghcjs and the original flavor of the quickcheck library!
I'm looking for a good way to add a couple capabilities to VS 2010's javascript intellisense that are working properly for C#. Specifically, I want to:
reliably refactor javascript code
go to the function definition (F12 for me) and
check for all uses of a function or item (Shift + F12 for me).
I'm aware of Refactor! and Visual Assist X, but I haven't found any comment on how well the features they advertise are supported in javascript. Most of the features they advertise seem to be based on languages that are much less dynamic.
So, I ask:
Any comment on the plugins mentioned above?
Are there any other good plugins that add these features (or most of them) to VS 2010?
Are there any IDE's that approach this feature set?
ReSharper 6 has great support for JavaScript.
It does include features like:
Refactoring (it's not 100% reliable since it's not possible with JavaScript, but it's really good at it)
Go to definition
Find usages
On the downside, it's a little expensive; but, as far as I'm concerned, it's worth the price.
Though 99% of the code on our site is the work of 1 programmer, recently for the first time (and probably last) a programmer was hired to work on our site, he was given remote access to log in via ftp.
Background: He is located in a continent unknown to us, speaks a mothertongue that I cannot guesse from the English mails, and works in ways that are bit different than ours. It seems, this common workflow in long distant small projects where the original programmer is essential to update/customise their code.
Problem: The genius writes like a hacker, good quality but very poorly documented, some bugs occuring here or there. Now we are stuck with almost brilliant code with some bugs. Its Javascript mainly.
Question: First of all 1. What ways/utilities/websites are there to find bugs in freshly delivered JavaScript code, when its difficult to understand parts of thes code to begin with? 2. What are good code comparison programs/utilities/websites sothat one can vew in parallel side by side comparison differences between two versions of code?
Obviously both are very related so hopefully there is one great tool on this planet that aims to combine bug finding as well as shows you the differences between versions.
Any suggestions are good answers to me as I have no clue where to start from here.
I agree with the posts above, Firebug for Firefox and Google Chrome/Chromium's Web Developer tools are great for most JavaScript debugging purposes. IE8 has an o-k set of Developer Tools. I'd only recommend using them if you're having issues in IE-only, otherwise, the previously mentioned tools will perform much, much better. If you really want to run the JavaScript through the error-checking and code-quality gauntlet, take a look at Douglas Crockford's JSLint.
It's also worth mentioning community-driven JSHint as a resource for testing JavaScript code. It's not as strict as JSLint and has better support for commonly-used JavaScript libraries.
The Windows applications listed above should work great for comparing files. If you're on OS X though, Kaleidoscope is a wonderful comparison app. It costs a little money, but it integrates very nicely with most versioning systems.
I agrre with #BiAiB, about the need for a code management/versioning tool - this will save you hours of heartache.
Another excellent file comparison tool is Beyond Compare - it truly is worth every penny that it costs (which is not much)
Probably the best tool to help in the discovery of what is happening in your JavaScript code is Firebug, a plug-in to Firefox. Google Chrome and IE have similar functionality, although each solution may lack feature (or have extra features) that the others don't.
And, I agree with everybody else - you need source control in a big way.
For file comparison tools, there is also the excellent and free WinMerge
Eclipse can do compare.
JsTestDriver is a wonderful testing tool.
But you will need to write unit tests for it.
A great tool is using firebug and the Webdeveloper toolbar plugins for mozilla firefox.
I am currently half-decided to use Kohana + Zend as needed for the PHP part. What I would need next is an excellent base for JavaScript code. There are a bazillion of contenders here and choosing isn't exactly as easy as with PHP.
I would need practically everything from form posting and retrieving results to skinnable widgets and animations. For this reason using multiple libraries will probably be a must, as no one framework can do it all. The requirements I have would be this (initial list):
Good browser support. WebKit-based is hardly an issue and Firefox 3+ is good. However, I'm looking at you Internet Explorer. IE 6 can be ditched, seriously, but 7+ support is needed.
Good performance. While WebKit has had a stupidly fast JS implementation for quite a while (and Chrome even before), Firefox has only recently got TraceMonkey and don't even get me started on Internet Explorer. While it is true that you can't do much about IE as anything will be slow, I don't want to try running Chrome Experiments in the others either.
Excellent support. This is a total must. The better the support, the more inclined will I be towards a library.
I am currently looking into jQuery as it is a very neat library, but the quality of plugins is questioned by some. Processing.js looks extremely promising, but IE does not support canvas, thus something has to be done about that and I am not sure how it could be replaced.
Go with a known library that is used by many sites. This will ensure all 3 of the points you have mentioned.
Personally, I would go with jQuery for these above reasons:
Great cross browser support
Good performance, as it is a thin api layer
Excellent support. Good documentation, loads of other devs
Although jQuery seems to be the most used library these days, there are other very good candidates as well.
One of them are YUI Library.
YUI has excellent documentation, and support. And the source code is really good.
YUI is developed by Yahoo!, where Douglas Crocford is architect (the author of JavaScript: The Good Parts, and the man behind JSON). Yahoo! is well known for their focus on JavaScript development.
YUI has good browser support and is fast and robust.
If it's war simulation and you have custom objects that you want to animate beyond the simple CSS effects and animations, then canvas tag is your best bet. It's as close as you can get to Flash but much more smoother. Processing.js looks really good for manipulating the canvas.
If that's the core component of your game, then I see the other libraries as adjunct to Processing.js that can be scrapped out without any deep commitments. That said, jQuery is great if you're dealing heavily with the DOM. It has really good support and community. MooTools is highly modular and has been traditionally strong with animations. YUI is a great library too, but a little verbose for my taste. Thought, Yahoo has made heavy changes with v3 to fix that. And a bunch of other libraries, that I don't use at all.
Dojo is a great library for writing web applications; however, never having written a game, I'm not sure if it is well suited for that sort of application. I must warn you though that the Dojo documentation is crap. Absolute crap. On the other hand, things like dojo.hitch, dojo.require, and dojo.partial are absolute joys.
I would try to avoid using cross-cutting libraries (like Dojo+jQuery) as much as possible. There's not really a good reason to do it and will create bloat and confusion in your application from day one.
That said, using multiple, non-overlapping libraries does make sense for a project like this. You might want to look into using Processing.js for visual needs and either Dojo or jQuery for your core.
Some other things to consider. Targeting IE, even IE8, for JavaScript game development is a bit ridiculous because of its slow performance and lack of canvas support. Also, according to John Resig, developing games in JavaScript is hard.
Have you considered being a pioneer (wink) and trying something out in 03D?
I need to find if there are any tools targeting both Visual Studio 2005 and JavaScript. I'm interested in plugins which will increase the quality of work done in VS2005 with JavaScript oriented development.
I think you'll be hard pressed to find anything specific for VS2005, since it is a dev environment and JS is a client technology. However, a couple of ideas you might want to consider:
jQuery. The recent availability of Intellisense for jQuery (although I think it is only for VS2008) helps your quality of work in the sense that you don't have to spend so much time looking back and forth at documentation, although I would say that is the best way to really become familiar with it anyway. There are several other good JS libraries out there, but (a) I don't think that was the point of your question, and (b) jQuery is the only one "semi-officially" supported in VS that I'm aware of.
Script#. Although I haven't used it, it looks interesting... basically you program in C#, and it gets translated to JS at runtime.
If you could afford it, I'll recommend upgrading to Visual Studio 2008. You can open .NET 2.0 application without converting them. It comes with much better Javascript Intellisense.
(source: scottgu.com)
One of the other JavaScript features in VS 2008 is the much-improved support for JavaScript debugging.
These features are enabled in both the free Visual Web Developer 2008 Express edition as well as in Visual Studio, and makes using JavaScript and building AJAX applications significantly easier.
If you are using jQuery in your applications, then you could install jQuery Intellisense in VS 2008.
Well, if you want something that will help you write better Javascript in Visual Studio then you can give JSLint a try. It's a plugin that will verify your Javascript code, spot errors, and help you debug it.
Beware, JSLint can hurt feelings.