PHP (birkaç soru) OO, yeniden düzenleme, tutulma

0 Cevap php

Ben Tutulma PHP kullanıyorum. Tamam çalışır, benim uzak siteye bağlanabilirsiniz, kod unsurları ve bazı kod ipuçları renk kodlaması var.

Ben sadece o ok cevaplarken, bir kısmı için iyi bir cevap varsa, bu, tüm soruları cevaplamak için çok uzun olabilir biliyoruz.

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.

teşekkürler

0 Cevap