PHP (A few questions) OO, refactoring, eclipse

Posted by jax on Stack Overflow See other posts from Stack Overflow or by jax
Published on 2010-06-09T14:13:39Z Indexed on 2010/06/13 13:42 UTC
Read the original article Hit count: 395

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about php

Related posts about eclipse