Tag Archives: php

Silly but This Is a WordPress Blog Running on Kubernetes

You probably think it’s overkill to use Kubernetes for a WordPress blog with less than a thousand monthly visitors. While this may be true, it’s totally worth using Kubernetes for the bragging rights. This is a WordPress blog running on Kubernetes!

Kubernetes running WordPress and MariaDB
Sources: https://pixabay.com/images/id-5718352/ and https://www.freepik.com/free-vector/cargo-freight-container_3795063.htm
Continue reading Silly but This Is a WordPress Blog Running on Kubernetes

PHP Dos and Don’ts aka Programmers I Don’t Like

I will find you meme - Taken (2008)

I am sure every PHP developer has a colleague they hate because he/she coded the application they started maintaining. This is mostly because the code is old. New standards become common, they learn what they used to do was inefficient, unreadable, or complicated. As PHP is a language that changed significantly over the years, code written a few years ago will certainly look outdated.

That being said, this post is not about the old PHP code. This post shows how to be a bad programmer even when following standards. Please don’t be this person.

  1. Too many nested if statements
  2. Extra brackets and braces
  3. Unnecessary casting
  4. Useless checks
  5. Slow PHP built-in functions
  6. Long functions
  7. Too many function arguments
  8. Long lines
  9. Long if-else blocks
  10. Wrong function / class name casing
  11. Lack of coding standards

Too many nested if statements

This is probably the one I hate the most. It also makes the lines too long because of the indentation caused by each of the nested if statements.

Continue reading PHP Dos and Don’ts aka Programmers I Don’t Like