Hey JavaScript People.

4 views
Skip to first unread message

Ivan Willig

unread,
Feb 14, 2013, 4:22:28 PM2/14/13
to j...@opengeo.org
Should we do a follow up re last Fridays meeting? Maybe sometime where people in the EU can join us? I was also unable to stay on the meeting so I would love to find out if there where any outcomes. 

There are a couple of things I wanted to talk about and maybe its best to talk about them via email. 

First all of, I wanted to know what standards I should follow. I am starting to do more and more JavaScript and I want to be a good "citizen". Are there articles or documents I should look at? What rules or guidelines should I follow? 

I find in my own work that a linter helps a ton to improve my code quality. For my work flow its really nice to have built into my text editor something that keeps me honest. Right now I am using jslint with the follow options, 

/*jslint browser: true, indent: 4, maxlen: 80 */

Sometimes I include the nomen: true option to allow for leading underscores. _.map(function () {});. I don't really care which linter we use, except that we should be all using the same with the same options. I would suggest jslint as it seems to be the best, but again I would like to just be on the same page with everyone else. I run jslint via flymake in emacs, 

and I would be happy to help people get up and running with flymake. I believe that vim has a very similar tool. 

Also, should we start include 'use strict'; on the top of our JavaScript source files? It seems really nice to have the browser will check that common JavaScript errors throw exceptions. I have started adding use strict to files that I been working on, but want to know what the group thinks about using strict mode. 

Another thing that I think would be great to talk about moving forward are what framework we should use for unit testing. I been using Qunit for some personal projects and on geonode. I really like it, its simple, has a really nice html based test runner and can be run via node or rhino. 

But beyond what ever test framework we use, I think the unit tests should be easy and fun to run. Otherwise people will never run them:). 

I also have spent sometime getting qunit working with rhino and envjs in order to allow us to use Jenkins. It still needs some work but I could see this being a great benefit for GXP/GeoExt. Since these projects are designed to be libraries, it seems really important to make sure they are working as we except.

Anyway, I look forward to chatting with people about how we make the best programming language better at OpenGeo. 

Long live our JavaScript overlords! ;)

--
Ivan Willig
OpenGeo - http://opengeo.org

Rob Marianski

unread,
Feb 15, 2013, 11:07:52 AM2/15/13
to j...@opengeo.org
+1 for linters. I've found that it helps detect obvious errors and speeds up development.

For the console work, we've started using the gclosure linter. And although we don't have many tests just yet (I'm to blame for that), we have a testacular rig set up. I think it integrates well with angular, but otherwise I don't have any opinions on choice of test runner.

Long live our javascript overlords!

Robert



Tim Schaub

unread,
Feb 16, 2013, 11:34:25 PM2/16/13
to j...@opengeo.org
Hey Ivan,

If you find a time that works for all, I'll gladly attend a call.  As Rob mentioned, we're slave to gjslint on the console (and OL3).  Testacular is a great utility for controlling multiple browsers for testing.  Not specific to Angular.  Comes with adapters for Jasmine, Mocha, and more.  Some work required for alt test frameworks.  Using "use strict" at the top of source files doesn't make any sense if you're concatenating (and including other libs).  Function level "use strict" makes more sense but is more painful to type.

Anyway, please schedule a follow-up call.

Tim


--
Tim Schaub
OpenGeo http://opengeo.org/
Expert service straight from the developers.

Ivan Willig

unread,
Feb 26, 2013, 8:33:35 AM2/26/13
to j...@opengeo.org
Hey Tim,

Good point about the use strict mode and concatenation. I guess it does help a little during development, if you catch errors that strict mode throws while developing.

Anyway, let me chat with the js developers and find a time that will work for everyone.

Thanks.
Reply all
Reply to author
Forward
0 new messages