There are 104 articles categorized as "Programming"

Dealing with bit rot in a side project

on December 14, 2020. in Programming, Development. A 3 minute read.

As I wrote earlier, I’m “reviving” a personal project that I didn’t touch for a year. The development environment is dockerized, so the first task I need to do is to run the application it see what happens. As it turns out not much happens, as a mild case of “bit rot” set in.

Reviving the ForThisWeek project

on December 12, 2020. in Programming, Development. A 4 minute read.

Way back in the summer of 2018 I’ve started a project called “ForThisWeek”. It’s nothing more than a glorified to-do application. I’ve used it mainly to learn more about some of the Domain-Driven Design concepts. Looking at the commit history, I’ve worked on it in the summer of 2018, then from November 2018 till May 2019, and then again from November 2019 till mid December 2019. Apparently I’ve put a decent amount of work in it, so if I want to have a side project live, this one’s a good candidate.

Continue reading Reviving the ForThisWeek project...

Turn a new leaf on a legacy project

on November 12, 2020. in Legacy, Software, Programming. A 4 minute read.

Working on a legacy project can be a chore. Fighting the same old problems over and over again, adding new features takes ages, seems like every time we fix one bug, we uncover three others. Sounds like wishful thinking, but I know it can be better.

A refactoring example

on January 13, 2020. in Programming, Development. A 5 minute read.

I’m working on a small side project to gather stats about my blog. Posts published, words written, number of code examples. Good for practicing TDD. I want to share how I made one part of it better.

Continue reading A refactoring example...

From time to time I come across a mistake in unit tests that makes them useless. The mistake is that we use the class and method that we are testing to create the expected result of the test:

Unit tests in legacy code

on November 22, 2019. in Programming, Development. A 3 minute read.

Legacy code has many definitions. It is code without tests. It is code written by someone else. It is code written X time ago. It is obsolete code that is difficult to replace with newer code. It is code that has no documentation. It is all of these things.

Continue reading Unit tests in legacy code...

Vue.js reusable components

on February 04, 2019. in Programming, Development. A 5 minute read.

A while ago I started learning bits and pieces about Vue.js by creating a single page application for one of my pet projects that I use to explore Domain-Driven Design. In general I know my way around a Javascript file, but wouldn’t call myself an expert with it. In the past I mostly used jquery, some mootools, and even Dojo. Ah, good old Zend Framework 1 times.

Continue reading Vue.js reusable components...

Accessing Symfony private services in Behat

on February 01, 2019. in Programming, Development. A 2 minute read.

Since Symfony 3.4 the services in the service container are private by default. While this decision made us write better production code by making us use Dependency Injection more and rely on the service container less, using these services in a test environment proved to be a challenge.

Testing Symfony commands with Behat

on January 18, 2019. in Programming, Development. A 5 minute read.

The other day I was creating a Symfony command that will be periodically executed by a cronjob. I decided to write a Behat test for it, to see what a test like that would look like. Plus, just because it is executed by the system from a command line, doesn’t mean we can skimp on the business requirements.

Legacy code is 3rd party code

on July 19, 2018. in Programming, Development, Blablabla. A 6 minute read.

Within the TDD community there’s an advice saying that we shouldn’t mock types we don’t own. I believe it is good advice and do my best to follow it. Of course, there are people who say that we shouldn’t mock in the first place. Whichever TDD camp you’re in I think this “don’t mock what you don’t own” advice has an even better advice hidden in it. An advice that people often overlook because they see the word “mock” in it and go full berserk.

Continue reading Legacy code is 3rd party code...