You code sucks, let's fix it

How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.

Slides

comments powered by Disqus

Related Posts

php|tek09: Dia #1

php|tek09: Dia #1

  • May 20, 2009

Dia de tutoriais na php|tek! O dia começou com um café da manha regado a PHP onde pude falar com muitas pessoas do dia anterior e conhecer o Matthew Weier O’Phinney. Depois um rápido registro e la vamos nós para os tutoriais.

Read More
2009: Um ano do PHP no Brasil e no mundo

2009: Um ano do PHP no Brasil e no mundo

  • December 15, 2009

Enquanto sento aqui em frente ao Wordpress e lendo meu post sobre 2008 eu vejo que este ano realmente foi um ano de muita mudança e sucesso. 2008 foi um ano de muito crescimento pessoal/profissional para mim, e 2009 acabou por seguir a mesma linha, mas trilhando por um caminho inesperado.

Read More
PHPT: Writing tests for PHP

PHPT: Writing tests for PHP

  • August 23, 2009

This year the PHP Community promoted the PHPTestFest in various places around the globe and it was a success. I participated in the event promoted by the PHPSP UG which ended up as the team with the most committed tests, after participating in the event I kept on going and have since obtained a SVN account and karma to be a official test commiter to PHP. So if you did not get the chance to learn how to write tests in your local TestFest I will now go over the steps taken so you can be ready for next year.

PHPT is a extremely simple test framework designed to test PHP. Its atomic nature and independent test execution make it perfect for the kind of tests needed, so tests can be really focused and test specific function and/or bugs.

What do I need to know?

The beauty about PHPT is that you need to know very little other than writing PHP code. A little knowledge into the inner workings of PHP will of course help you in finding areas of code that need testing, and how best to test them, but just knowing PHP is enough to start.

I have divided this post into 5 parts so we can get started:

  1. Preparing the Environment
  2. Choosing what to test
  3. Writing a test
  4. Executing a test
  5. Submitting a test to PHP

Read More