Contact: Web / Voice / Email / Tips
Simple Thoughts Blog - Java and Web Technologies

Simple solutions for complex problems.

 

3 PHP Tips For Product Developers

August 23rd, 2006 by Angsuman Chakraborty

Three lessons I learned the hard way while developing a PHP based product, Translator Plugin Pro for WordPress. Let me know if you find them useful.

1. PHP is no Java.
I don’t intend to be sarcastic. In reality I sorely miss the comfort of Java in more ways than one.
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). So you have to be extra careful in PHP to write high quality code. Also PHP is not as platform independent as 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.

2. You best friend for PHP development is:
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. All your errors, warnings and even notices are displayed on your browser for you to correct.

3. Use file based logging instead of logging on browser. Logging on browser messes up your page layout and can even cause additional problems thereby obscuring your true defect. The best and unobtrusive way to log is to a file. You can try my technique for simple php logging. Use logging for easy debugging of your code.


Filed under Headline News, How To, Open Source Software, PHP, Pro Blogging, Tech Note, Web | | RSS 2.0 | Trackback this Article | Email this Article

Looking forward to hear your thoughts.



Please enter the code shown below ( to verify that you are human ) before you click Submit Comment.

No. 1 method to ethically increase your blog traffic and reach.

Translate

Translate to EnglishÜbersetzen Sie zum Deutsch/GermanPřeložit do Čech/CzechOversætte hen til Dansk/DanishKääntää jotta Finnish/FinnishLefordít -hoz Magyar/HungarianÞýða til Íslenska/IcelandicTraducir a Latinoamericano Español/Latin American Spanishtagapagsalin sa Filipino/FilipinoTłumaczyć wobec Polski/PolishA traduce la spre Român/RomanianPrevesti za Srpski/Serbiantolmačiti v slovenski/SlovenianÖversätta till Svensk/SwedishChyfieitha at Cymraeg/Welshtercüme etmek -e doğru Türk/TurkishPrevesti to Hrvatski/CroatianПревеждам към Българин/BulgarianTraduzca al Español/SpanishTraduisez au Français/FrenchTraduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplifiedترجمة الى العربية/ArabicVertaal aan het Nederlands/DutchΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/Norwegian中文翻译/Chinese TraditionalTraduzir a Língua portuguesa brasileira/Brazilian PortugueseReddo ut Latin/Latin

Taragana Network

»Ctrl-S
»Enterprise Blog
»Free Book on Eye Care by Natural Therapy
»Health Care Blog
»Hot Computer Jobs Blog
»Pet Care & Grooming News and Tips
»Phil Law Blog
»Taragana - Software Outsourcing
»The Angsuman Chakraborty Blog
»The Diabetes Cure Blog
»The Eye Treatment Blog
»The Stem Cell Blog
»Weblog Hosting Blog
"A human being is a part of a whole, called by us _universe_, a part limited in time and space. He experiences himself, his thoughts and feelings as something separated from the rest... a kind of optical delusion of his consciousness. This delusion is a kind of prison for us, restricting us to our personal desires and to affection for a few persons nearest to us. Our task must be to free ourselves from this prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty." - Albert Einstein