Quantcast

About MiscFunctions.js

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

About MiscFunctions.js

Rafael Chacón
Hi,

Recently, I updated the file MiscFunctions.js. I added comments and improve the format. Now it is more easy to understand the code.

But it has a big disadvantage: Each html page generated by the webERP loads that file through ~/includes/header.inc. That is: if we add comments and reformat the code to make it very easy to understand, we increase the traffic of that file to about 239% (more comments and spaces in formatting code).

Someone say me that he prefers a minimum file size to prioritise the principle "low footprint" (absolutely minimal network traffic) over to "easily readable", because this file is modified infrequently. That is: to have a MiscFunctions.js without comments (explanations) and put them in the manual. Also, to remove the spacing for easy reading.

I agree. But, if we are strict, that "minimising" principle should apply to all JavaScript, CSS and HTML code.

Comments? Opinions?

Best regards, Rafael.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About MiscFunctions.js

phildaintree

There is a bit of a double standard there I agree ... I think Tim even used single letter variable names etc to minimise the overhead.

I also like readable and there is a compromise position ... you decide where that is Rafael.

Phil

Phil Daintree
Logic Works Ltd - +64 (0)275 567890
http://www.logicworks.co.nz
On 19/10/16 07:09, Rafael Chacón wrote:
Hi,

Recently, I updated the file MiscFunctions.js. I added comments and improve the format. Now it is more easy to understand the code.
l
But it has a big disadvantage: Each html page generated by the webERP loads that file through ~/includes/header.inc. That is: if we add comments and reformat the code to make it very easy to understand, we increase the traffic of that file to about 239% (more comments and spaces in formatting code).

Someone say me that he prefers a minimum file size to prioritise the principle "low footprint" (absolutely minimal network traffic) over to "easily readable", because this file is modified infrequently. That is: to have a MiscFunctions.js without comments (explanations) and put them in the manual. Also, to remove the spacing for easy reading.

I agree. But, if we are strict, that "minimising" principle should apply to all JavaScript, CSS and HTML code.

Comments? Opinions?

Best regards, Rafael.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
If anyone is wondering about the persistently nasty comments made by Tim Schofield and wants the full story please see: http://timschofield.blogspot.com/ Hell hath no fury like a woman (or Tim) scorned
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About MiscFunctions.js

Andrew Galuski

I vote no added comments but spaces in code if that isn’t too much overhead.

 

 

From: Phil Daintree [mailto:[hidden email]]
Sent: Tuesday, October 18, 2016 2:23 PM
To: webERP Developers
Subject: Re: [WebERP-developers] About MiscFunctions.js

 

There is a bit of a double standard there I agree ... I think Tim even used single letter variable names etc to minimise the overhead.

I also like readable and there is a compromise position ... you decide where that is Rafael.

Phil
 
Phil Daintree
Logic Works Ltd - +64 (0)275 567890
http://www.logicworks.co.nz

On 19/10/16 07:09, Rafael Chacón wrote:

Hi,

 

Recently, I updated the file MiscFunctions.js. I added comments and improve the format. Now it is more easy to understand the code.

l

But it has a big disadvantage: Each html page generated by the webERP loads that file through ~/includes/header.inc. That is: if we add comments and reformat the code to make it very easy to understand, we increase the traffic of that file to about 239% (more comments and spaces in formatting code).

 

Someone say me that he prefers a minimum file size to prioritise the principle "low footprint" (absolutely minimal network traffic) over to "easily readable", because this file is modified infrequently. That is: to have a MiscFunctions.js without comments (explanations) and put them in the manual. Also, to remove the spacing for easy reading.

 

I agree. But, if we are strict, that "minimising" principle should apply to all JavaScript, CSS and HTML code.

 

Comments? Opinions?

 

Best regards, Rafael.




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot




_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About MiscFunctions.js

gsavix
In reply to this post by Rafael Chacón

+1 from me to min javascripts. documentation must be inside manuals. see refs about  on javadocs that is large used. restructured text like sphinx could be used to build php python java c++ or any other language. see that current texts inside weberp sources already can be handled for this.
it is like .pot and .mo files for translations.
uml diagrams  could enhance docs  for devellopment.
regards.


Em 18/10/2016 16:15, "Rafael Chacón" <[hidden email]> escreveu:
Hi,

Recently, I updated the file MiscFunctions.js. I added comments and improve the format. Now it is more easy to understand the code.

But it has a big disadvantage: Each html page generated by the webERP loads that file through ~/includes/header.inc. That is: if we add comments and reformat the code to make it very easy to understand, we increase the traffic of that file to about 239% (more comments and spaces in formatting code).

Someone say me that he prefers a minimum file size to prioritise the principle "low footprint" (absolutely minimal network traffic) over to "easily readable", because this file is modified infrequently. That is: to have a MiscFunctions.js without comments (explanations) and put them in the manual. Also, to remove the spacing for easy reading.

I agree. But, if we are strict, that "minimising" principle should apply to all JavaScript, CSS and HTML code.

Comments? Opinions?

Best regards, Rafael.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About MiscFunctions.js

Girish Nair

I would suggest to keep the code beautifully formatted and adding as much comments needed which will be helpful to developers.

Generally the practice is to minify the js/css files and generate filename-min.js/filename-min.css, this can be committed along with the original one for every build, Also, there should be an  easy way to switch between the non-minified/minified version.

Some useful tools to minify:
https://github.com/tedious/JShrink
https://github.com/mishoo/UglifyJS2
http://yui.github.io/yuicompressor/
http://www.crockford.com/javascript/jsmin.html
There are many more...


On a production server these optimizations can be used:
Enabling gzip compression on the webserver(Apache/nginx) etc will reduce the overall download size for all files: js, css, html etc.
http://howtounix.info/howto/Apache-gzip-compression-with-mod_deflate

Configure the pagespeed module (by Google)
https://developers.google.com/speed/pagespeed/module/


Compression results from the JShrink doc:
    Raw - 586,990
    Gzip - 151,301
    JShrink - 371,982
    JShrink and Gzip - 93,507


hope this info is useful.

Girish,
InfraStack-Labs.com


On Wed, Oct 19, 2016 at 3:29 AM, gilberto dos santos alves <[hidden email]> wrote:

+1 from me to min javascripts. documentation must be inside manuals. see refs about  on javadocs that is large used. restructured text like sphinx could be used to build php python java c++ or any other language. see that current texts inside weberp sources already can be handled for this.
it is like .pot and .mo files for translations.
uml diagrams  could enhance docs  for devellopment.
regards.


Em 18/10/2016 16:15, "Rafael Chacón" <[hidden email]> escreveu:
Hi,

Recently, I updated the file MiscFunctions.js. I added comments and improve the format. Now it is more easy to understand the code.

But it has a big disadvantage: Each html page generated by the webERP loads that file through ~/includes/header.inc. That is: if we add comments and reformat the code to make it very easy to understand, we increase the traffic of that file to about 239% (more comments and spaces in formatting code).

Someone say me that he prefers a minimum file size to prioritise the principle "low footprint" (absolutely minimal network traffic) over to "easily readable", because this file is modified infrequently. That is: to have a MiscFunctions.js without comments (explanations) and put them in the manual. Also, to remove the spacing for easy reading.

I agree. But, if we are strict, that "minimising" principle should apply to all JavaScript, CSS and HTML code.

Comments? Opinions?

Best regards, Rafael.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About MiscFunctions.js

Jon R

If the headers are setup right each of the supporting files can be cached client side so there would actually be less overhead...


On 19 Oct 2016 6:58 am, "Girish Nair" <[hidden email]> wrote:

I would suggest to keep the code beautifully formatted and adding as much comments needed which will be helpful to developers.

Generally the practice is to minify the js/css files and generate filename-min.js/filename-min.css, this can be committed along with the original one for every build, Also, there should be an  easy way to switch between the non-minified/minified version.

Some useful tools to minify:
https://github.com/tedious/JShrink
https://github.com/mishoo/UglifyJS2
http://yui.github.io/yuicompressor/
http://www.crockford.com/javascript/jsmin.html
There are many more...


On a production server these optimizations can be used:
Enabling gzip compression on the webserver(Apache/nginx) etc will reduce the overall download size for all files: js, css, html etc.
http://howtounix.info/howto/Apache-gzip-compression-with-mod_deflate

Configure the pagespeed module (by Google)
https://developers.google.com/speed/pagespeed/module/


Compression results from the JShrink doc:
    Raw - 586,990
    Gzip - 151,301
    JShrink - 371,982
    JShrink and Gzip - 93,507


hope this info is useful.

Girish,
InfraStack-Labs.com


On Wed, Oct 19, 2016 at 3:29 AM, gilberto dos santos alves <[hidden email]> wrote:

+1 from me to min javascripts. documentation must be inside manuals. see refs about  on javadocs that is large used. restructured text like sphinx could be used to build php python java c++ or any other language. see that current texts inside weberp sources already can be handled for this.
it is like .pot and .mo files for translations.
uml diagrams  could enhance docs  for devellopment.
regards.


Em 18/10/2016 16:15, "Rafael Chacón" <[hidden email]> escreveu:
Hi,

Recently, I updated the file MiscFunctions.js. I added comments and improve the format. Now it is more easy to understand the code.

But it has a big disadvantage: Each html page generated by the webERP loads that file through ~/includes/header.inc. That is: if we add comments and reformat the code to make it very easy to understand, we increase the traffic of that file to about 239% (more comments and spaces in formatting code).

Someone say me that he prefers a minimum file size to prioritise the principle "low footprint" (absolutely minimal network traffic) over to "easily readable", because this file is modified infrequently. That is: to have a MiscFunctions.js without comments (explanations) and put them in the manual. Also, to remove the spacing for easy reading.

I agree. But, if we are strict, that "minimising" principle should apply to all JavaScript, CSS and HTML code.

Comments? Opinions?

Best regards, Rafael.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
Loading...