In the last few years, I have interviewed more than 50 engineers for back-end positions. What I have learned is that hiring the right person is hard. There is not enough time and data to objectively test if the candidate is a good fit, but a decision has to be made right after the interview. …
Bash: Read File Line by Line
Problem Let’s say we have a file named in.txt with the following content: $ cat in.txt # comment * and we want to read it line by line and do something with each one of them. The following could be a solution: #!/bin/bash for line in $(cat in.txt); do echo “line:$line” done Let’s see if …
Exceptions: The Right Way
Are exceptions evil? Many developers don’t like them, because they’re not easy and some times they have to spend hours on discussions about which of them should they use, how they should handle them, etc. This post isn’t about how good or bad exceptions are or if you should use them. Instead, we’ll focus on …
How to write bug reports
Have you ever got a “It doesn’t work” bug report? Yeah, I know what you’re thinking. I’ve been there, too 🙂 We agree that’s not the right way to report a bug, but what a good bug report looks like? Well, it must have the following information or at least most of them: Bug Report …
Introduction to Bloom Filters
A Bloom filter is a probabilistic, space-efficient, data structure that is used to test whether an element is in a set. False negative matches are not possible, so if we search for an element and get negative response, we are 100% percent sure that it doesn’t exist in the set. On the other hand, false …
Dependency Injection in PHP
Dependency is an object, a class needs to function. For example, if your class needs to log something using a logger object, that means it has a dependency on that object. Now, let’s see what Dependency Injection is. Many years ago, Martin Fowler wrote an article¹ that introduced the term Dependency Injection. It’s a technique, …
PHP coding standards in practice
Coding standards are guidelines about programming style and practices developers should follow when writing code. They usually cover indentation, white space, comments, naming conventions, etc. Moreover, coding standards are very important for producing consistent, readable and maintainable code, especially if you are part of a team. Remember the countless argues about tabs vs spaces? Well, …