AW: [Mapbender-dev] Reminder: Code Conventions

Michael Schulz mschulz at webgis.de
Mon Jan 22 17:28:14 EST 2007


Hi Melchior,

the packing routines Marc pointed out are also capable of
renaming/shortening variable names.

@Christoph: That's true, for specially designed applications it can be
very valuable.

Greetings, Michael


2007/1/22, Melchior Moos <nimix at gmx.net>:
> Hi,
> talking about compressed JS code I think it's interesting to have a look
> at google maps code:
> http://maps.google.com/mapfiles/maps2.72.js
> they compress the code by dropping comments and linebeakes but they also
> shorten their function and variable names.
> Does anybody now a nice packing programm which does this (hopefully also
> within PHP-scripts) ??
>
> regards,
> melchior
>
> Marc Jansen schrieb:
> > Michael Schulz schrieb:
> >> Hi,
> >>
> >> I think the conventions Christoph has set up, make perfectly sense.
> >> Even if it is a lot to follow ;-) but in the long run and with a
> >> growing number of developers it is necessary.
> >>
> > We will all be rewarded. We will much faster understand how code is
> > working (or why it isn't working the desired way). I think that with
> > commenting our code we will attract even more people to help coding. I
> > - personally - really like to look at other people's code: Very often
> > I can learn something. But if it isn't documented it isn't only hard
> > to understand, sometimes you don't get the idea, if there isn't
> > someone pointing you the right direction.
> >> I am a little bit confused about the discussion on compressed JS Code.
> > There is one pro:
> > - faster loading of JS-files possibly resulting in a quicker startup
> > of the full animation
> >
> > there is at least one con:
> > - you can not read the code any more
> >
> > More opinions?
> >> If I understand it correctly, this would mean there is a "source" or
> >> raw JS code following the conventions of the packing routine (with
> >> comments inline, correct semi-colons) that lives e.g. in the
> >> repository, but a released version would use the compressed JS  (or
> >> the JS is compressed on the fly). Is that the case?
> >>
> >
> > Yes, it might be the way you described it. Normally within a release,
> > there is no need for all comments within JS so a packed version might
> > be ok, too. While browsing the repository one may check what the code
> > looks like and how it is working.
> > I think we might run into problems with the PHP generated javascript
> > files as we cannot simply compress them once. As said befor On-the_fly
> > compression is possible baut would work only for PHP 5-Users and would
> > seriously slow down the MB. This is not a real option.
>
>
>
> >
> >> Cheers, Michael
> >>
> >>
> >>
> >>
> > Bye,
> >
> > -- Marc
> > _______________________________________________
> > Mapbender_dev mailing list
> > Mapbender_dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapbender_dev
> >
>
> _______________________________________________
> Mapbender_dev mailing list
> Mapbender_dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>


-- 
-----------------------------------------------------------
Michael Schulz
mschulz at webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

In den Weihermatten 66
79108 Freiburg

Tel  +49 (0)761 556959-5
Fax +49 (0)761 556959-6

http://www.webgis.de / http://www.zopecms.de
-----------------------------------------------------------


More information about the Mapbender_dev mailing list