English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

What is your opinion on php, javascript source code with excessive comments. Since it works on server and web browser, does it make slower? I saw some code with compressed version like without comments, line breaks and indents. It is like only machine-readable.

2007-03-07 09:59:13 · 4 answers · asked by The WWW owner 1 in Computers & Internet Programming & Design

4 answers

comments in a compiled language are breezed over.
comments in an interpreted language (perl or php) are skipped over nicely.

comments in javascript are downloaded to every user who hits your page! then they are skipped over nicely.

Nobody but your future programmers see your php comments.... write comments for them!

Put comments in your big javascripts then pack them down!

http://dean.edwards.name/packer/ is the best darn javacript packer available (written in java) !!! and there are ports of his code to many other languages!

2007-03-07 10:21:15 · answer #1 · answered by jake cigar™ is retired 7 · 1 0

Comments in any programming code are totally ignored by the machine running the code, it's has absolutely no impact on performance at all and you can put as many comments in as you like with no problems.

2007-03-07 18:07:17 · answer #2 · answered by Bamba 5 · 1 2

Since these are "Comments". These will be ignored by the server. So it does not mean if the file has more comments it will be slow.

2007-03-08 04:25:33 · answer #3 · answered by Atif Majid 3 · 0 0

it makes the script a little longer, so it will have more Kb, however it has little impact.

2007-03-07 18:09:33 · answer #4 · answered by Peter pan 6 · 0 1

fedest.com, questions and answers