0

Possible Duplicate:
Will PHP be slower if we add too many comments in code files?

I am making adjustments in my php script to improve performance, thus i plan to strip out all but the bare neccessites; I do not want to delete it as i may reintroduce it back again/ or use for archival purposes. my questions are, will commenting the code vs deleting the code have any significant performance differences? and will commenting the code have any security risks involved in it?

also how much of an performance boost will commenting the code vs leaving it there entail?

Thanks

Community
  • 1
  • 1
Frank Ly
  • 631
  • 2
  • 5
  • 17

2 Answers2

1

No, I don't believe comments pose a security threat to you, nor should they slow down your execution by a significant amount. But if you're really worried about wanting to go back to older code, I suggest looking into a version control system like git. Comments are mainly used to give information about the code, i.e. what a function does, or what a class is for.

Jeremy Rodi
  • 2,485
  • 2
  • 21
  • 40
0

I don't think that commenting the code instead of deleting it will create major performance issues.

In addition, because PHP is run and the code is not viewable (unless you plan on distributing the source) the commented code should not present a security issue.

citruspi
  • 6,709
  • 4
  • 27
  • 43