Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 834271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:38:52+00:00 2026-05-15T04:38:52+00:00

I am using PHP in eclipse. It works ok, I can connect to my

  • 0

I am using PHP in eclipse. It works ok, I can connect to my remote site, there is colour coding of code elements and some code hints.

I realise this may be too long to answer all questions, if you have a good answer for one part, answering just that is ok.

Firstly General Coding

  1. I have found that it is easy to
    loose track of included files and
    their variables. For example if
    there was a database $cursor it is
    difficult to remember or even know
    that it was declared in the included
    file (this becomes much worse the
    more files you include). How are
    people dealing with this?

  2. How are people documenting their
    code – in particular the required
    GET and POST data?

Secondly OO Development:

  1. Should I be going full OO in my
    development. Currently I have a
    functions library which I can
    include and have separated each
    “task” into a separate file. It is a
    bit nasty but it works.

  2. If I go OO how do I structure the
    directories in PHP, java uses
    packages – what about php?

  3. How should I name my files, should I
    use all lower case with _ for spaces
    “hello_world.php”? Should I name
    classes with Uppercase like Java
    “HelloWorld.php”? Is there a
    different naming convention for
    Classes and regular function files?

Thirdly Refactoring

  1. I must say this is a real pain. If
    I change the name of a variable in
    one place I have to go through whole
    document and each file that included
    this file and change the name their
    too. Of course, errors everywhere
    is what results. How are people
    dealing with this problem? In Java
    if you change the name in one place
    it changes everywhere.

  2. Are there any plugins to improve php
    refactoring? I am using the
    official PHP version of Eclipse from
    their website.

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:38:52+00:00Added an answer on May 15, 2026 at 4:38 am

    Firstly General Coding

    1) OO can help you with that. As you encapsulate variables and functionality, they don’t go out and mess with the namespaces. Assumind I understand right what problem you hint at, using an OO approach helps alleviating conflicts that can arise when you are inadvertedly redeclaring varables. (Note: Alleviate. Not completely prevent on its own. ;))
    Otherwise a practise i have encounterd is prepending variable names with something like a ‘package name’ — which merely shifts the problem one level up and isn’t exactely beautiful either. 😐

    2) “However suits their purpose”. PHPdoc is a good start; will help to create API documentation.

    Secondly OO Development:

    3) As said before — “it depends”. Do it when needed. You don’t have to go full OO for “hello world”. But you can. Weigh the costs and benefits of either route and choose wisely. Though I personally want to suggest when in doubt favour OOP over ‘unstructured’ approaches. Basically, know your tools and when to use them — then you can make that call on your own easily. 🙂

    4) As far as I can see, the directories “are structured like packages”. Mind you, “directories” and “like”. Having said that, various frameworks have solved that problem for theirselves; cf; th eother answers.

    5) Again, however you please. There is not a definitive way You Have To Do It Or Else. Just stick to it once you chose your path ;3
    Aside of that certain frameworks etc. have their own naming conventions. Symfony, e.g., uses CamelCase like Java.

    Thirdly Refactoring

    I must say this is a real pain.

    yes :3 But it pays off.

    If I change the name of a variable in one place I have to go through whole
    document and each file that included this file and change the name their too.
    Of course, errors everywhere is what results. How are people dealing with
    this problem? In Java if you change the name in one place it changes everywhere.

    No, it doesn’t. If you get yourself a tool with support you only have to use the refactoring tool once; but if you rename a class property in java, there is no magic bot that walks through the internet and automagically makes sure everyone on the planet uses the new name. 😉

    But as for how to prevent it — be smart. Honour program contracts, i.e. use interfaces. Do not use functions / members you shouldn’t use directly. Watch the hierarchies. Use a reasonable division of code and respect this division’s boundaries.

    But how people deal with that problem? Well, search and replace I suppose 😉

    As for the Eclipse-Plugin — The dynamic nature of PHP makes it more difficult to automagically refactor code; we can’t always use static type hinting etc., and divination of argument and return types is impossible more often than not. So, to the extent of my knowledge, ‘automatic refactoring’ is not as well-supported by tools as in the Java world. Though I am sure for the doable cases, there should be plugins. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 458k
  • Answers 458k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Emacs uses the /usr/sbin/sendmail command (specified by the sendmail-program variable)… May 15, 2026 at 11:04 pm
  • Editorial Team
    Editorial Team added an answer Possibly there's a single statement that can do it but… May 15, 2026 at 11:04 pm
  • Editorial Team
    Editorial Team added an answer Ben Gottlieb pointed out yesterday that if you use blocks… May 15, 2026 at 11:04 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.