Hi!
It's been a long time since the last article, lots of things happened recently and I will probably need more than one post to tell you more about this.
In any case, and to make a long story short, I recently moved to a new company (and a new country) in order to practice some JavaScript skills on a promising software and my first phase consisted in discovering the tools they put in place to assist the developments.
Among them, one has been really annoying at first glance but - as I progress with it - I realize how much time this tools is saving. Indeed, one of the requirement is to make sure that all common 'mistakes' are eliminated from the source code before checking it in in the source control software. Because of the JavaScript language, the tool JSHint is applied.
I won't detail all the features of the tool (that are deeply explained in the documentation page) but I'll rather highlight the benefits I see:
- It identifies undeclared variables / unused parameters. For instance, when you mistyped a variable name, your JavaScript file will be executed until this variable is used (and replaced with undefined). Hence, the sooner you detect the issue, the better. Note that, in some cases, the variable name might be implicit (such as document or window in a browser): the tool can also be dynamically configured with comments in the source code.
- It uses documented validation rules: forbids the use of eval, group var declarations, check code complexity...
- It makes sure the code is 'formatted' properly: we all have our coding habits. However, when it comes to code review, it is better to have everybody format the code the same way...
This being said, I decided to adopt JSLint to my own developments.
I have developped some interesting ideas I would like to post in the blog in the near future:
- An algorithm for computer-craft that fills one layer of blocks
- A SUDOKU solver (what a big deal...)
- Portability over browsers, operating systems & JavaScript hosts
So stay tuned!
No comments:
Post a Comment