one large, or many small files?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marco.avidano@gmail.com

    one large, or many small files?

    I'm asking: for the PHP parser, it's better to create one large file
    with all the code inside or a lot of small files?
    Can a large file slow down the execution of the script?

  • Kim André Akerø

    #2
    Re: one large, or many small files?

    marco.avidano@g mail.com wrote:
    [color=blue]
    > I'm asking: for the PHP parser, it's better to create one large file
    > with all the code inside or a lot of small files?
    > Can a large file slow down the execution of the script?[/color]

    One large file doesn't necessarily slow down the execution of the
    script, that comes all down to what the code inside it does.

    However, a lot of smaller files does have the advantage that the whole
    solution is easier to maintain, and you're able to re-use code in other
    scripts without having to insert the same code segment inside every
    main script.

    Also, uploading a large script creates downtime in the time period
    you're uploading the script, depending on the file size of the single
    script and your own upload speed.

    --
    Kim André Akerø
    - kimandre@NOSPAM betadome.com
    (remove NOSPAM to contact me directly)

    Comment

    • JDS

      #3
      Re: one large, or many small files?

      On Tue, 04 Oct 2005 04:04:11 -0700, marco.avidano wrote:
      [color=blue]
      > I'm asking: for the PHP parser, it's better to create one large file
      > with all the code inside or a lot of small files?
      > Can a large file slow down the execution of the script?[/color]

      Don't worry about it. Speed differences will be negligible.

      From a programming practice point of view, though, multiple include()ed
      files often make a large project easier to build and maintain. All of
      your functions in one file, an HMTL header and footer in others,
      business logic in still others...

      Programming practices Haiku

      Keep style consistent
      Use comments, annotation
      Remember to reuse code


      later...
      --
      JDS | jeffrey@example .invalid
      | http://www.newtnotes.com
      DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

      Comment

      Working...