[xquery-talk] Is there any tool/plugin to verify the xquery coding standards?

Christian Grün christian.gruen at gmail.com
Wed May 29 04:42:33 PDT 2013


Personally, I am more than happy to have some coding style conventions
for languages such as Java. I would love to also have them in XQuery,
but I fear that the flexibility of that language makes it difficult to
find solutions which are strict, consistent and nice to read at the
same time: we have strings that may extend over multiple lines, XML
snippets with whitespaces that can’t be simply reindented... I
frequently catch myself reinventing my own conventions, and I haven’t
found a style yet that I’d like to fix for all the time coming.

After all, the best thing would probably be to have some formatting
and checkstyle-like templates in Eclipse, Cloud9 etc., which can then
be adapted by everyone.

> If you really want a single style, here's my solution: Write more code than
> anyone else, and become the de-facto standard ;-).

I like this one..
Christian
___________________________

On Wed, May 29, 2013 at 12:56 PM, John Snelson
<john.snelson at marklogic.com> wrote:
> I'm extremely dubious - coding style is a religion, and you won't get
> general agreement. I've found if you write good code it's readable, whatever
> the style. And if you write useful (bug free) code, no-one will comment on
> the style.
>
> If you really want a single style, here's my solution: Write more code than
> anyone else, and become the de-facto standard ;-).
>
> John
>
>
> On 29/05/13 10:35, Adam Retter wrote:
>>
>> I think it could be valuable for us (W3C WG?) to come up with a coding
>> standards for XQuery, so that when we look at XQuery code its all
>> formatted the same.
>>
>> i.e. Where should braces go?
>>
>> declare local:function($a, $b) {
>>    ()
>> };
>>
>> or
>>
>> declare local:function($a, $b)
>> {
>>    ()
>> };
>>
>> i.e. Where should return statements go?
>>
>> let $x = $y return
>>    $x
>>
>> or
>>
>> let $x = $y
>> return
>>    $x
>>
>>
>> I think you get the idea...
>>
>> On 29 May 2013 07:10, Liam R E Quin <liam at w3.org> wrote:
>>>
>>> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am looking for some tools/plugins which provides xquery coding style
>>>> check and suggest the xquery coding standards if not followed properly.
>>>>
>>>> Just like Eclipse has plugins like “CheckStyle“ which gives warning if
>>>>   Java coding standards are not followed.
>>>
>>>
>>> Sorry to post a 2nd time - there are eclipse plugins for XQuery, and
>>> some editors have support for syntax checking in XQuery (e.g. OxygenXML,
>>> and the GUI part of BaseX, to name a couple), in case that's what you
>>> meant.
>>>
>>> Liam
>
>
> --
> John Snelson, Lead Engineer                    http://twitter.com/jpcs
> MarkLogic Corporation                         http://www.marklogic.com
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk



More information about the talk mailing list