Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am developing a web application primarily using Angular, Gridster, jQuery and few other JavaScript files. The most common error is spelling mistake while typing a particular syntax and these syntax errors are not shown in FireBug or any other developer tools. Any suggestion how to debug this in a structured way and find out the issue(s)?

What I have tried:

I couldn't find any solution using debug of the development tools like Visual Studio or Fire bug etc.,
Posted
Updated 26-Apr-16 17:41pm
Comments
Sergey Alexandrovich Kryukov 26-Apr-16 22:16pm    
Just be a software developer, not a kid needing a nun with spell checker and all that.
—SA
Sergey Alexandrovich Kryukov 26-Apr-16 22:36pm    
By the way, your English spelling seems fine to me. I don't understand why you find JavaScript spelling problematic. I see a good number of seemingly dyslexic members here, by some reasons, and can imagine their problems, but I don't think you should have any significant problems with that. Just don't rush too much and develop some patience. This is the advice additional to Solution 1.
—SA

 
Share this answer
 
Comments
TechMocktail 27-Apr-16 0:33am    
Thanks Karthik. This really helps. Please do let me know if this helps to work with Angular.
Karthik_Mahalingam 27-Apr-16 0:41am    
Cool,
It will work fine with Angular Javascript syntax. but not on the expressions and ng- stuffs in the markup.
TechMocktail 27-Apr-16 0:43am    
Brilliant. This helps a lot. There is intensenes feature for standard mark ups.
Karthik_Mahalingam 27-Apr-16 0:52am    
good.
The problem seems artificial to me. This problem is not harder than the similar problem with all other scripting languages, but is actually much easier, due to a lot of attention paid for JavaScript, due its unique character and high demand.

Use Visual Studio not earlier than 2013 (that is, 2013 or 2015): its Intellisense has been greatly improved; pleasure to work with. If you are using different platforms, try MonoDevelop and/or SharpDevelop; I haven't try them for a while, but check if they also improved Intellisense.

Use the debugger more often than you used to; it will quickly detect random mistakes like related to spelling. Develop code under the try-catch block providing special exception information. Unfortunately, you cannot catch lexical mistakes this way (please see the chapter of my article on this topic: Handling Lexical Errors), but the debugger will. During development, you can do special very detailed dump of all exception information, which you later can modify or remove.

The usual effect of misspelling detected by a debugger is simple. Say, you have the object A and create some property A.MyProperty. If you later try to read this property but misspell it, the object, say, A.MyProperti will be assigned to a special undefined object (primitive value). If a whole variable is misspelled, it will be undefined, too. This is easy to detect. Please see:
undefined — JavaScript | MDN.

You can use Visual Studio debugger, or some other debugger. Visual Studio debugger is the best to my taste, but unfortunately it requires, to best of my knowledge, IE (maybe Edge, too, I'm not sure), which I consider unacceptable and keep disabled most of the time. Therefore, I have to use some other debugger; and I use Chrome. It is, by far, not so comfortable, but still comprehensive. Besides, it performs the debugging under the decent browser. (I don't consider IE a real browser.)

Yes, you cannot reach the convenience in spelling detection as in compiled language, but the methods of work with interpretive languages is approaching the optimum possible for JavaScript.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900