NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Auto-filter out comments when uploading


Joined: 03 Jul 2008
Posts: 4
Reply with quote
I would like all comments (everything after "//" + blocks surrounded by "/*" & "*/" ) in my php souce code to be automatically removed when uploaded to the server, any chance you will implement such a feature?
View user's profileFind all posts by Andreas2Send private message


Joined: 03 Jul 2008
Posts: 4
Reply with quote
Is anyone actually reading this? Sad
View user's profileFind all posts by Andreas2Send private message
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
I am sure many people are reading your post Smile The dev team would probably not respond unless there are a many people that support your suggestion. I for one, did not particularly agree with you suggestion, and hence did not comment.

_________________
Smile
View user's profileFind all posts by annoSend private messageVisit poster's website


Joined: 03 Jul 2008
Posts: 4
Reply with quote
Thank you for your reply but sorry I don't follow, what is it that you don't agree with?

1) My code is heavily commented and I wish to keep the comments to myself. Yes I know that people will understand the code anyway but why make it easier than necessary?

2) No comments = faster upload & execution. Yes the performance gain is marginal but with everything else optimized why shouldn´t this also be optimized?

3) It would be very easy to implement this feature.

Just because there aren't many people supporting the request here does not mean it isn't needed, only a small fraction of all PhpED users are active on this forum.
View user's profileFind all posts by Andreas2Send private message
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
My reply was meant to set your mind at peace that Nusphere staff do read this forum, rather than criticize your suggestion Wink But since you asked why I do not agree:
1) My code is also heavily commented, and I do not with to keep them to myself. It is essential that my colleagues will be able to understand how and why I did things. Simple code is not the same as simple business logic.
2) It would be interesting to know the cold hard facts of the performance loss when leaving comments in place. You say "marginal". I suspect "unnoticeable" is closer to the truth. If you are really concerned about performance, you should be using Nu-Coder.
3) Easy to implement the feature? Perhaps, but that's not for me to decide.

This post is the 5th in the thread. I think the dev team will notice it now Wink

_________________
Smile
View user's profileFind all posts by annoSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
lines with // and blocks surrounded with /* */ are not always comments.
Without appropriate parsing we can't be sure what we see on a particular line.
Indeed, is the line below a comment or not?
// this a comment

What's about the code below?
$a = '
// this a comment
';

and now more content to think of:
/*
$a = '
// this a comment
';
*/

and even more:
$a = <<<EOB
/*
$a = '
// this a comment
';
*/
EOB;

In other words, it is not simple. Without correct parsing you can't consider a partiucular construct as a comment.

If you care of performance and diskspace and do not want the other people to see and understand you code, why not to use encoder (nucoder)? It will strip off all the comments and make the code unreadable. Moreoever, the resulting files won't contain any sources in any form (just like exe file does not contain any C sources it's compiled from), and performance gain is far from marginal Wink

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Auto-filter out comments when uploading
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic