Sign in

An Engineer with curiosity for days. With a taste for photography, writing, and software.

This is the third piece of my series on how to start a Software Development career. I recommend giving that a quick read if you haven’t already.

Ahh JavaScript. What an interesting language you’ve been to understand. I remember being thrown into the proverbial fire when asked to make a code change involving you and JQuery. Some light Googling taught me just enough to complete my task. And from then on, it’s been a learning on the job type of ordeal.

My relationship with JavaScript has been mostly pleasant. That doesn’t mean there weren’t some challenges to overcome. All-in-all I’m…


There is an order of operations when it comes to MySQL’s ORDER BY and GROUP BY functions. It’s something that is intrinsically understood but often difficult to know how and when to correctly apply it. In this article I’ll attempt to explain by examples.

Transactional-style Tables

I identify these tables as those in which there are multiple rows representing similar or duplicate data with an auto-incrementing primary key being used to distinguish them. Some examples are where every user’s ID that views an article is recorded; another is recording movie tickets and quantities sold. …


This is the second piece of my series on how to start a Software Development career. I recommend giving that a quick read if you haven’t already.

I’ve been writing PHP since 2011. Despite having years of experience under my belt, I still don’t feel like an expert. A big part of that is because the language continues evolving, so there’s always something new to learn. Even from my point of view, figuring out what’s new and how it could be applied practically can be a daunting task.

Suppose though if I were to bring my 2011 self to today…


The first thing you should realize is that there isn’t just one proper way of doing it! Sure, you have your coding bootcamp’s and your college degree’s, but the main thing those require (in most cases) is money! The internet has most, if not all, of the resources you need to be able to learn the basic and advanced aspects required to perform the job. I’d like to share some basic tips that got me started on mine.

Some time ago, I was in a well-paying job at a notable institution, living and working in one of the best cities…


If you’ve ever done OOP in PHP you are fully aware of the __construct method and the role it plays in setting up class properties, among other tasks. But have you ever given any thought on using the opposite of this function: the __destruct method? Were you aware that such a function existed? Keep reading to find about some use cases I’ve personally implemented in the past.

Save Errors to File

Over the years, I’ve had to create various import scripts. For example, grabbing data from a CSV file and landing it onto a database table. Sometimes what would happen is that my script…


I love writing (Laravel) artisan commands, basically little scripts that perform some sort of task. But what I love even more, is having those scripts output stuff to the console, so that it can tell me what’s going on! I’m going to show you how to easily enable any PHP class, script, etc to output whatever you want to the console with Symfony.

Some Background Info

If you hate reading, skip ahead to the implementation. Otherwise, we will have to start with the Symfony OutputInterface and StyleInterface. The former handles the actual act of writing to the console screen and how verbose to…


Less is more, really! Increasing the bulk size leads to worse results in MySQL

Recently I’ve been working on a project where I have to insert 1 million+ rows. This is the sort of task that comes around to many a backend engineer every so often. Over the course of time you learn that taking the easiest route, line-by-line inserts, isn’t the best solution if you want to have speed and efficiency.

foreach ($records as $record) {
$record->save();
}

You eventually learn about bulk inserts and how much better suited they are at this type of exercise.

$records->chunk($randomChunkSize)->each(function($chunk){
Model::insert($chunk);
});


So this is my first foray in to TDD (Test Driven Development) at work. The way I was going about it was just running the tests for the specific feature I was building, mostly because I wanted to rerun the tests quickly to keep the momentum going. When I finally decided to run the full test-suite, I noticed that most of the tests I had written were suddenly failing!

Now there are a few good reasons for why the tests, which I made sure were showing green before pushing up, were now failing.

The first problem is that out of…

Eddie Carrasco

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store