3 PHP Tips For Product Developers 3 PHP suggerimenti per sviluppatori di prodotti
Three lessons I learned the hard way while developing a PHP based product, Tre lezioni che ho imparato il senso duro, mentre lo sviluppo di un prodotto a base di PHP, Translator Plugin Pro for WordPress Traduttore per il plugin per WordPress . Let me know if you find them useful. Fammi sapere se li trovate utili.
1. PHP is no Java. PHP non è Java.
I don’t intend to be sarcastic. Non ho intenzione di essere sarcastico. In reality I sorely miss the comfort of Java in more ways than one. In realtà ho dolorosamente perdere la comodità di Java in più modi diversi.
PHP lacks several built-in checks of Java to ensure defect free coding; features like strong typing, checked exceptions (by default), and lack of variant types (variable which can take on any data types). PHP manca di più built-in Java di controlli per garantire la libera difetto di codifica; caratteristiche come una tipizzazione forte, controllati eccezioni (per impostazione predefinita), e la mancanza di variante tipi (variabile che può assumere qualsiasi tipi di dati). So you have to be extra careful in PHP to write high quality code. Quindi dovete essere attenti extra in PHP per scrivere codice di alta qualità. Also PHP is not as platform independent as Java. Anche di PHP non è così come indipendente dalla piattaforma Java. What I mean is that PHP has several platform dependent capabilities or lack thereof which makes it harder to make it work across platforms. Quello che voglio dire è che il PHP ha più dipendenti dalla piattaforma o la mancanza di capacità, che rende più difficile farlo funzionare su piattaforme diverse.
2. You best friend for PHP development is: Si migliore amico per lo sviluppo di PHP è:
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
This little piece of code thrown in at the top of your file is arguably the best PHP debugging tool you can find. Questo piccolo pezzo di codice gettati in nella parte superiore del file è probabilmente il miglior strumento di debug di PHP è possibile trovare. All your errors, warnings and even notices are displayed on your browser for you to correct. Tutti i vostri errori, avvertenze e avvisi anche se vengono visualizzati sul browser per voi a correggere.
3. Use file based logging instead of logging on browser. Uso del file di registrazione basato invece di accesso browser. Logging on browser messes up your page layout and can even cause additional problems thereby obscuring your true defect. Accesso browser messes il tuo layout di pagina e può anche causare ulteriori problemi in tal modo offuscare il suo vero difetto. The best and unobtrusive way to log is to a file. Il miglior modo discreto e per l'accesso è a un file. You can try my technique for simple Si può provare la mia tecnica per la semplice php logging PHP disboscamento . Use logging for easy debugging of your code. Utilizzare l'accesso facile per il debug del codice.
Filed under Elencato sotto Headline News Headline News , How To Come , Open Source Software Software open source , PHP , Pro Blogging Pro Blogging , Tech Note Nota tech , Web | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |




