Download - PHP não é coisa de moleque - FISL Edition
![Page 2: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/2.jpg)
Felipe Ribeiro
•Graduando (concluinte) em Ciência da Computação na UFCG
•Zend Certified Engineer
•Desenvolvedor Web há 7 anos, atualmente trabalhando para a startup Shoprizer.com
•Experiência em grids computacionais e sistemas distribuídos
•Membro fundador do grupo PHP-PB
•Contribuidor do PHP no Google Summer ofCode 2009
![Page 3: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/3.jpg)
Text
Enquanto .NET e Java brigam, fazendo muito
barulho...
![Page 4: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/4.jpg)
PHP se mantém como
a tecnologia número 1 da
Web.
![Page 5: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/5.jpg)
Mesmo assim, alguns dizem que PHP é
“coisa de moleque”
![Page 6: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/6.jpg)
E por que o PHP carrega
essa má fama?
![Page 7: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/7.jpg)
Por causa dos profissionais
desqualificados...
![Page 8: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/8.jpg)
dos mitos...
![Page 9: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/9.jpg)
E pela falta de propaganda...
![Page 10: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/10.jpg)
Esse cenário pode mudar, só depende da comunidade
![Page 11: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/11.jpg)
Qualificação de profissionais
•PHP é fácil de aprender e sua flexibilidade permite que seja utilizado das mais diversas maneiras (boas ou ruins)
•Programadores Java normalmente precisam de uma formação mais sólida (orientação a objeto, padrões de projeto, eficiência de algoritmos, estruturas de dados, e etc.)
•BONS programadores PHP também precisam!!!
![Page 12: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/12.jpg)
Marketing
•PHP não é produto de nenhum big player do mercado enterprise
•Mas já despertou o interesse de:
•IBM
•Oracle
•Yahoo!
•Microsoft
•entre outros...
![Page 13: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/13.jpg)
Marketing
•PHP está presente em mais de 25 milhões de sites
•Com tudo isso, pra que propaganda? A propaganda somos nós e tudo o que nós fazemos!
![Page 14: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/14.jpg)
E que tal esclarecermos
os mitos?
![Page 15: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/15.jpg)
Mito #1 PHP é uma linguagem
para Web, e por isso é muito limitada
![Page 16: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/16.jpg)
Nunca subestime a
Web!
![Page 17: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/17.jpg)
Nunca subestime a
Web!
É a plataforma dominante da nossa geração
![Page 18: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/18.jpg)
Cloud computing SaaS
Web Services
![Page 19: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/19.jpg)
Algoritmos de alta complexidade
![Page 20: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/20.jpg)
Algoritmos de alta complexidade
Indexação e buscaRecomendação de produtos (Amazon) e músicas (Last.fm)Folksonomia e ranking (Delicious e Flickr)Teoria dos Grafos (redes sociais)
![Page 21: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/21.jpg)
Além das infraestruturas sofisticadas
![Page 22: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/22.jpg)
Além das infraestruturas sofisticadas
Sistemas distribuídos
Balanceamento de carga
Escalar horizontalmente
![Page 23: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/23.jpg)
Sistemas Web não são mais tão simples quanto eram há 10 anos
![Page 24: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/24.jpg)
Mito #2 CódigosPHP são sujos
![Page 25: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/25.jpg)
"PHP is not about purity in CS principles or architecture; it is about solving the ugly web
problem with an admittedly ugly, but extremely functional and convenient solution. If you are
looking for purity, you are in the wrong boat. Get out now before you get hit by a wet cat!" -
Rasmus Lerdorf
![Page 26: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/26.jpg)
interface Printer { void print(Message message);}
class Message { private String message;
public Message(String message) { this.message = message; }
public void print(Printer printer) { printer.print(this); }
public String toString() { return message; }}
abstract class AbstractPrinterFactory { public static AbstractPrinterFactory getFactory() { return new SystemOutPrinterFactory(); }
public abstract Printer getPrinter();}
class SystemOutPrinterFactory extends AbstractPrinterFactory {
public Printer getPrinter() { return new SystemOutPrinter(); }
}
class SystemOutPrinter implements Printer { public void print(Message message) {
System.out.println(message);
}
}
public class HelloWorld {
public static void main(String[] args) { Message message = new Message("Hello, World!"); AbstractPrinterFactory factory = AbstractPrinterFactory.getFactory(); Printer printer = factory.getPrinter(); message.print(printer); }
}
Hello W
orld em
JAVA!
e sua burocracia
![Page 27: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/27.jpg)
Quem determina a qualidade do código é o programador!
![Page 28: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/28.jpg)
Mito #3 PHP só serve para sistemas
pequenos
![Page 29: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/29.jpg)
Isso é .NET!
E a estabilidade caracterís
tica dos
produtos Microsoft
P.S.: O orkut foi reescrito em Java, mas esse shot é dos velhos tempos de .NET
![Page 30: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/30.jpg)
![Page 31: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/31.jpg)
![Page 32: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/32.jpg)
![Page 33: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/33.jpg)
![Page 34: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/34.jpg)
![Page 35: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/35.jpg)
![Page 36: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/36.jpg)
![Page 37: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/37.jpg)
Então PHP escala?
![Page 38: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/38.jpg)
Então PHP escala?
Linguagens de programação não
escalam
Arquiteturas escalam
![Page 39: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/39.jpg)
E a arquitetura
share-nothing do PHP
simplifica a escalabilidade
![Page 40: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/40.jpg)
OOP
Mito #4 PHP não implementa OO
“de verdade”
![Page 41: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/41.jpg)
OOP
• PHP5 trouxe:
• Níveis de visibilidade
• Exceptions
• Interfaces
• Type hinting
• SPL - Standard PHP Library
![Page 42: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/42.jpg)
OOP
• Frameworks MVC
• Zend Framework
• Symfony
• CakePHP
• Code Igniter
• Prado, etc...
![Page 43: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/43.jpg)
Mito #5 Não existem pacotes
reutilizáveis e de qualidade em PHP
![Page 44: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/44.jpg)
PEAR
![Page 45: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/45.jpg)
Mito #6 Existem poucas ferramentas para
desenvolvimento em PHP
![Page 46: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/46.jpg)
![Page 47: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/47.jpg)
![Page 48: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/48.jpg)
![Page 49: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/49.jpg)
![Page 50: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/50.jpg)
![Page 51: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/51.jpg)
PHPSpec
![Page 52: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/52.jpg)
![Page 53: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/53.jpg)
![Page 54: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/54.jpg)
Mito #7 PHP é inseguro
![Page 55: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/55.jpg)
Free/Open/NetBSD são seguros?
MS Windows® é seguro?
![Page 56: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/56.jpg)
São todos escritos principalmente em
C
![Page 57: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/57.jpg)
A linguagem de programação não é
o fator determinante na
segurança de um sistema
![Page 58: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/58.jpg)
Mito #8 PHP não estápronto para aplicações
“enterprise”
![Page 59: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/59.jpg)
XML
![Page 60: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/60.jpg)
![Page 61: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/61.jpg)
SOAP
![Page 62: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/62.jpg)
![Page 63: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/63.jpg)
REST
![Page 64: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/64.jpg)
![Page 65: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/65.jpg)
E o que podemos esperar para o futuro?
![Page 66: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/66.jpg)
PHP 5.3
•Namespaces
namespace Yahoo\News; class Dir { ... }
Definição Uso// diretamente $foo = new Yahoo\News\Dir;
// importando o namespace use Yahoo\News; $foo = new News\Dir;
// renomeando a classeuse Yahoo\News\Dir as YND; $foo = new YND;
![Page 67: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/67.jpg)
PHP 5.3
•Lambdas e closures
$lambda = function () { echo "Hello World!\n"; }; $lambda();
![Page 68: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/68.jpg)
PHP 5.3
•Lambdas e closuresfunction getSomador($x) { return function ($y) use ($x) { return $x + $y; }; } $somador = getSomador(10);
echo $somador(5); //15echo $somador(32); //42
![Page 69: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/69.jpg)
PHP 5.3
•SPL Datastructures
•LinkedList / DoubleLinkedList
•Stack
•Queue / Priority Queue
•Heap
![Page 70: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/70.jpg)
PHP 5.3
•PHAR - PHP Archive
•Garbage collection
•Late static binding
•Outros refatoramentos e debugs
![Page 71: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/71.jpg)
PHP 6 = PHP 5.3 + Unicode
![Page 72: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/72.jpg)
![Page 74: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/74.jpg)
Referências
•PHP for Grown-upsAndrei Zmievski - http://gravitonic.com/talks
•Myths DefusedDerick Rethans - http://talks.php.net/show/myths-ffm2008
•Programming Collective Inteligence - Toby Segaran - O’Reilly
http://www.flickr.com/photos/nullalux/2261949240
![Page 75: PHP não é coisa de moleque - FISL Edition](https://reader033.vdocuments.mx/reader033/viewer/2022061120/546be5d7b4af9f612c8b4e25/html5/thumbnails/75.jpg)
http://elephpantgettingsome.files.wordpress.com/2008/02/elephpant1web.jpghttp://jjanaya.100webspace.net/wp-content/uploads/2008/08/king-kong-vs-godzilla.jpghttp://www.flickr.com/photos/bobbyuggles/232446009http://www.flickr.com/photos/emagic/56206868http://www.flickr.com/photos/andycastro/835453399/http://www.flickr.com/photos/enigmatic/2901093490/http://www.flickr.com/photos/kky/704056791/http://www.flickr.com/photos/mscolly/145052885http://flickr.com/photos/ripizzo/2310929170/http://flickr.com/photos/zach_manchester/2302683790/http://www.flickr.com/photos/docman/6107473http://www.flickr.com/photos/mamabarns/747588843http://flickr.com/photos/willpate/63814657/http://flickr.com/photos/estherase/128983854/http://www.flickr.com/photos/j_m_c/3406217735/http://www.flickr.com/photos/oberazzi/318947873http://www.flickr.com/photos/jaredchapman/482538719http://www.flickr.com/photos/skeet-skeet/222026728/http://www.flickr.com/photos/practicalowl/392894653/