$30 off During Our Annual Pro Sale. View Details »

The MicroPHP Manifesto

The MicroPHP Manifesto

Slides from talk given at tek12; May 23, 2012

funkatron

May 23, 2012
Tweet

More Decks by funkatron

Other Decks in Programming

Transcript

  1. The MicroPHP Manifesto Ed Finkler Fictive Kin @funkatron Wednesday, May

    23, 12
  2. 1. I am a PHP Programmer Wednesday, May 23, 12

    I like PHP, and I like making things in PHP.
  3. Not a framework X/Y/Z developer Wednesday, May 23, 12 Learning

    most big stack frameworks is as complex as learning a new programming language. - New nomenclature, new approaches
  4. PHP is complicated enough Wednesday, May 23, 12 PHP itself

    is riddled with pitfalls and quirks. - Inconsistent naming, param order, behavior - Trapping Errors & Exceptions; - Incomplete implementations - functional code; namespaces & functions - Complex boilerplate for OOP - Behavior of isset() and empty()
  5. 2. I like building small things Wednesday, May 23, 12

    Small stuff is good. It’s easier to understand. It’s harder to screw up.
  6. Small things with simple purposes Wednesday, May 23, 12 Don’t

    make a single “module”/piece try to do too much
  7. Solve single problems Wednesday, May 23, 12 Self-contained pieces to

    solve individual problems
  8. Work together & solve big problems Wednesday, May 23, 12

    Each piece should work with other pieces to accomplish bigger things - Fixing bugs is easier because you can look at an individual piece and see what its doing
  9. 3. I want less code, not more Wednesday, May 23,

    12 More code, more problems
  10. Manage less code Wednesday, May 23, 12 Bigger codebases get

    harder to manage. GREPs get slower. - Navigating through complex file structures takes longer - Tracing execution through dozens of files is hard - Keeping it all straight in your brain gets challenging - Bigger libraries & longer code can overflow the brain buffer - “Unwieldy over 200 lines”
  11. Support less code Wednesday, May 23, 12 If your app

    is using it, you have to support it. every line of code. - bugs - security Imagine explaining how your code works to another dev who’s never seen it: how long would it take? How hard would it be?
  12. Justify every line Wednesday, May 23, 12 Each line matters.

    Treat it as such.
  13. 4. I like simple, readable code Wednesday, May 23, 12

  14. I want code that is easy to understand Wednesday, May

    23, 12 Understanding things quickly means getting stuff done faster - time to productivity is shortened - time to fix bugs is shortened You don’t need a Certified Developer – you need smart, adaptive people who love learning and building things
  15. I want code that is easy to verify Wednesday, May

    23, 12 Code should be testable! Simpler code is more testable!
  16. So where is web dev going? Wednesday, May 23, 12

    - presentation/UI handled by client - clients powerful enough to do this - do as little regarding server - PHP really is glue now - Connect clients to backends
  17. Stuff to look at: https://github.com/funkatron/FUnit https://github.com/fictivekin/Resty.php Wednesday, May 23, 12

  18. Fin microphp.org·fictivekin.com·gimmebar.com·devhell.info Wednesday, May 23, 12