[Mapbender-dev] Code Conventions (first summary)

Marc Jansen jansen.marc at gmx.de
Fri Feb 2 09:24:25 EST 2007

Hey list,

Christoph Baudson (WhereGroup) schrieb:
> Hello again,
>> jep, PHP-Doc style is a good proposal, so we can use some tools to 
>> extract the documentation - although I think that the wiki is the 
>> better alternative for the documentation. There are two advantages: 
>> we've one format (wiki) for all purposes and we have a history.
>> But maybe we could use both and extract the php-doc-style comments 
>> into the wiki?
> As far as I know all developers are now in favor of php-doc. Marc 
> Jansen, as you proposed the idea, could you please add it to the wiki?
> http://www.mapbender.org/index.php/Code_conventions
> If you don't have time or if you cannot access the wiki for some 
> reason please let us know, and I will try to find time to do so.

It would be kind, if you could start describing that topic in the wiki. 
I'm writing my diploma-thesis at the moment - so I actually do not have 
the time to add something to the wiki. I'll have more time after 
february, 28th

>>> * Marc introduced the packing algorithm used by jQuery: 
>>> http://dean.edwards.name/packer/usage/
>>> Using this packing algorithm would result in additional rules:
>>> - "terminate every statement by a semicolon (even functions!)" 
>>> (although I don't understand why the if-statement in the sample is 
>>> not terminated..any ideas? 
>>> http://dean.edwards.name/packer/usage/sample.html)
>> that's not very consequent and stringent. And the terminating 
>> semicolon behind the bracket of the function-body is seriously ugly! 
>> I've never seen that before.

As I understand it: In JavaScript (nearly) everything is an object, even 
functions. So

function foo() { alert('bar'); }

...is simply a shortcut for:

window.foo = function() { alert('bar'); };

...where in the second example you cannot leave out the terminating 
semicolon. Please correct me if I'm wrong on this.

> I guess we have come to no conclusion here. I suggest we keep this in 
> mind and discuss it later (I will add a paragraph to the wiki site). 
> If there are any objections please let us know.

I sometimes see code successfully being packed although it does not 
follow these instructions. Perhaps it's best to try and see. If the 
packed Javscript  does not work we have at least some common things to 


 Marc Jansen

  Reuterstraße 112
  53129 Bonn
  0228 / 2438694

  Schwalbenweg 2
  53947 Nett./Engelgau
  02486 / 7644

  jansen.marc at gmx.de


More information about the Mapbender_dev mailing list