Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP Myths

PHP Myths

There are lot of myths about PHP. Some are correct and some are myths. This presentation try to go through those myths and understand them.

Kapil Sharma

April 13, 2014
Tweet

More Decks by Kapil Sharma

Other Decks in Technology

Transcript

  1. Let me introduce myself PHP Reboot PHPReboot.com 3 Name: Kapil

    Sharma (Not comedian) Working in web technologies since 2004. Current: Tech lead at Ansh Systems. Hobbies: Programming, Dreaming. Vision: …
  2. PHP Myth What is Myth? PHP Reboot PHPReboot.com 4 A

    traditional story, especially one concerning the early history of a people or explaining a natural or social phenomenon, and typically involving supernatural beings or events. A widely held but false belief or idea.
  3. PHP Myth Common PHP Myths PHP Reboot PHPReboot.com 5 

    PHP is crappy and there are lot of crappy PHP Programs.  PHP is good only for web development.  PHP is interpreted language so it is slow.  PHP mix business and presentation logic.  PHP is insecure.  Development in PHP is slow.  You can’t scale PHP applications well.  You need to buy from Zend to make PHP work best.  PHP is not good at OOPs.  PHP is not good/sufficient for serious programmers.
  4. Why explanation PHP Reboot PHPReboot.com 6  As PHP developer,

    we ideally do not need to give any explanation.  However a student learning PHP or new developers might feel bad about them. Explanation is needed for them that they did not made any mistake by selecting PHP.  Explanation is needed to those stake holders who selected PHP as language for their product.  Explanation is needed to experienced PHP developers/ architects to remind them some of the possible mistakes that might be possible in PHP.
  5. What is Programming Language? And who we are? PHP Reboot

    PHPReboot.com 7  A programming language is just a tool to fulfill business requirements.  As programmer (regardless of programming language) your task is to solve business problem.  As programmer, we solve business problems by using tool (programming language) that fit best to solve problem.  If other language fit best to solve a specific problem, I recommend to go ahead and use that language.  So as programmer, defend PHP on valid points but do not offend any other language.
  6. PHP is crappy and there are lot of crappy PHP

    Programs PHP Reboot PHPReboot.com 8  Before we answer this myth, we must know PHP History.  Development started in 1994 by Rasmus Lerdorf for his Personal Home Page Tools.  1995: Open Sourced  April 1996: PHP FI (or PHP 2)  1997: Zeev Surakshi and Andi Gutmans begin rewrite.  1998: PHP 3. Renamed to ‘PHP: Hypertext Preprocessor’  1999: PHP 4 with Zend Engine.  July 2004: PHP 5  June 2009: PHP 5.3  March 2012: PHP 5.4  June 2013 PHP 5.5
  7. PHP is crappy and there are lot of crappy PHP

    Programs PHP Reboot PHPReboot.com 9  Disadvantages of being old language.  Lot of old books and old tutorial available on internet.  That old tutorial was correct at the time of writing but not now. However students and new developers are still learning from outdated tutorial.  This is the biggest concern for world wide PHP community. Our new members are learning wrong things.  Phptherightway.com  Phpmentoring.org  Blogs phpdeveloper.org  PHP-FIG  PHPReboot.com (Pune local PHP Community)
  8. PHP is crappy and there are lot of crappy PHP

    Programs PHP Reboot PHPReboot.com 9  Lets divide this myth in two parts: 1. Is PHP Crappy?  Depends on what is your definitions of Crappy.  Most of myths we discuss, falls under category of crappy.  To answer if PHP is crappy or not, lets go through remaining myths. 2. Is there lot of crappy PHP Programs?
  9. Is there lot of crappy PHP Programs? PHP Reboot PHPReboot.com

    9  Unfortunately Yes. Reasons:  PHP is very simple and easy to learn.  That means; There are lot of amateur programmers.  Small companies, freelancer. (Lack of experience) Solution:  Conferences at global levels.  Free resources on internet.  Technical blogs, Twitter, Linked In.  Local meetups.
  10. PHP is good only for web development. PHP Reboot PHPReboot.com

    9  This is fact but when PHP claimed otherwise.  PHP first full-form was ‘Personal Home Page’.  Is it a negative point? Not for me.  PHP does what it is supposed to do.  If you need desktop or mobile or embedded app or anything else, PHP is not for you.
  11. PHP is interpreted language so slow. PHP Reboot PHPReboot.com 9

     Fact: PHP is interpreted language and interpreted language are slower then compiled language.  Myth: PHP is slow.  PHP was designed to be fast. With advanced technologies, execution time gap is reducing.  Again execution speed (difference of few milliseconds) matters for enterprise apps.  For enterprise apps, when you really need speed, PHP have many solutions to scale up your application.
  12. PHP mix business and presentation logic PHP Reboot PHPReboot.com 9

     Myth  Yes it is possible to mix business and presentation logic in PHP but it is possible in other languages too.  Even though it is possible, PHP do not recommend that. PHP fully support MVC architecture and recommend to use MVC architecture.  So finally it depends on Programmer if he/she mix business logic and presentation logic. Solution:  We need to educate students and new programmers about it and PHP community is doing that frequently.
  13. PHP is insecure PHP Reboot PHPReboot.com 9  This is

    one of the biggest myth about PHP.  First understand, no thing is 100% secure on internet, regardless of programming language.  PHP provide all the tools to write secure web applications; as secure as possible in any other language.  So why there is security myth about PHP?  PHP did some mistakes in the past, which is not valid today.  One of biggest mistake of PHP was ‘register globals’.  Again this was not security vulnerability at PHP’s end but a potential risk which allow developers to write insecure program.
  14. PHP is insecure PHP Reboot PHPReboot.com 9 If ( isAdminUser()

    ) { $admin = true; } if ($admin ) { //load admin panel } Consider following code
  15. PHP is insecure PHP Reboot PHPReboot.com 9 If ( isAdminUser()

    ) { $admin = true; } if ($admin ) { //load admin panel } Consider following code Is there any issue with this code? NEVER TAKE ANY DECISION BASED ON VARIABLE WHICH MIGHT NOT BE INITIALIZED. http://domain.com/page.php?admin=1
  16. Development in PHP is slow PHP Reboot PHPReboot.com 9 Myth

    I say that myth but don’t know the source. Just a guess: Ruby on Rails or DJango (Framework in Python). Is that a fair comparison? Do not compare framework with programming language. PHP too have many frameworks, compare with them. One of the PHP strength is, you can develop applications in PHP very fast. Obviously you need experienced developers.
  17. Need to buy from Zend PHP Reboot PHPReboot.com 9 Myth

    Zend is a company behind PHP. Like any open source company, they provide few solution to earn. Some major Zend offerings are: OP Code Cache. Support IDE (Zend Studio) Zend Guard (Obfuscation) Zend have products but they do not dominate market.
  18. Not good at OOPs PHP Reboot PHPReboot.com 9 Myth OOPs

    was introduced in PHP with PHP 5.0 in 2004 Yes OOPs support in PHP was not good at that time. By PHP 5.3, PHP developed very good OOPs support PHP 5.4 support traits, not still supported in many OOPs languages.
  19. Not good for serious programmers PHP Reboot PHPReboot.com 9 Myth

    PHP contributed maximum number of web based open source projects. Some of them are dominating in their respective fileds like: Joomla, Wordpress, Media wiki, Megento, SugarCRM (Just to name few) In my office, I work with many serious PHP programmers and communicate with many over internet. This is not a myth but rubbish.
  20. Is everything right with PHP? PHP Reboot PHPReboot.com 9 Do

    not shy, answer is ‘NO’ No thing is perfect in the world. Not do PHP. Yes there are quite a few issues with PHP. But what is most important PHP do what it is supposed to do and do it very well.
  21. How to become better programmer? PHP Reboot PHPReboot.com 9 Learning,

    study and most important; code. Share knowledge. Contribute to Open Source. Communicate with other developers. Read blogs. Remain updated with technology. Use twitter more then facebook.
  22. PHP Reboot PHP Reboot PHPReboot.com 9 PHP Reboot is an

    attempt to share news and new features of PHP and related technologies. My idea of doing this by regular meet-up like this one. Problem: We cant hold/attend regular meetups. Another way: share articles, news and tutorials through free PHP Reboot Magazine and blogs.
  23. Thank you PHP Reboot PHPReboot.com 9 Contact information Website: Phpreboot.com

    Twitter: @phpreboot Facebook: www.facebook.com/phreboot Email: [email protected] Mailing list: [email protected]