Slides from a presentation that David Lopez (@lopezator) and me made for the students of the University of the Basque Country (UPV/EHU) where we talk about current technologies and methodologies used in professional web development.
CSS3, jQuery, Composer, MVC, Clean Code, Git, etc. are different items we talked about.
Some examples shown in the presentation available at:
http://ojoven.es/labs/ehu2014/
26. Composer
“Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries
your project needs and it will install them in your project for you.”
http://getcomposer.org
27. Apache VirtualHosts
The term Virtual Host refers to the practice of running more than one web site (such as company1.
example.com and company2.example.com) on a single machine.
30. Y bien, ¿cómo realizamos una
consulta a MySQL desde PHP5?
31. Fácil, concatenamos la consulta con su condición en un string.
$result = mysql_query("SELECT LUKE FROM PADRES WHERE PADRE =". $darth_vader);
32.
33. Una consulta debe estar siempre parametrizada.
* Por legibilidad
* Por limpieza del código.
* Y lo mas importante, evitar ataques SQL Injection.
$stmt = $pdo->prepare("DELETE FROM SINGERS WHERE NAME = :name AND SURNAME = :surname”);
$stmt->prepare(array(“name” => “Justin”, “surname” => “Bieber”);
34. Para NOTA: USA ORMS
Diferentes opciones:
* Doctrine
* Propel
* RedBean
38. MVC: Modelo / Vista / Controlador
http://librosweb.es/jobeet_1_4/capitulo_4/la_arquitectura_mvc.html
http://students.com/students/get?studentId=123
/** Students Controller **/
public function get() {
// Get student id from request
$studentId = $this->request->query['studentId'];
// We call Student Model to retrieve Student
$student = $this->Student->getStudent($studentId);
// Set result to the view
$this->set('student', $student);
}
43. Git
* Trabajar en equipo de forma, rápida, segura y prácticamente
transparente.
* Histórico de commits, posibilidad de rollbacks, recuperación de
codigo antiguo, etc.
* Compares (Otra herramienta de debugging)
*Continuous deployment (No more FTP)
44. Manos a la obra!
git clone https://github.com/lopezator/thumbNailGenerator.git
45. GitHub
* Posibilidad de trabajo colaborativo, ofrece un servidor de
código github, que puede ser público o privado.
* Almacén de código para poder descargarlo desde cualquier
lugar.
* Muy relacionado al mundo del software libre.
* Geekster.
52. TEST
describe("Player", function() {
var player;
var song;
beforeEach(function() {
player = new Player();
song = new Song();
});
it("should be able to play a Song", function() {
player.play(song);
//demonstrates use of custom matcher
expect(player).toBePlaying(song);
});
});
54. ● No te limites a Infojobs/echar CVs, adáptate a la situación actual.
● Conexión con la realidad/comunidad local. (LinkedIn, Twitter, eventos (networking),
comunidades locales, github, etc…
● Blogging, investigación.
● Toy projects/diferénciate del resto.
● Especialización en tecnologías en liza, autoaprendizaje, actualización constante.
● Teletrabajo (USA/EUROPA).
● Start-ups.
● Emprendizaje.