Services in DDD finally explained
I’ve noticed that there is always a challenge of understanding what services are in a context of Domain-Driven Development and what is the difference between a service in an application, domain, and infrastructure layer. Domain-driven design made a lot of cleanup in the IT environment and conquered the hearts of programmers. Eric Evans is one of the most famous people who promote this not so a new way of developing software.
What I've learned on a hackathon
Recently, I took part in a hackathon. That was an excellent experience. Working 24 hours on a project you came up with the day before is very exciting. After that event, I realized something that I think I felt earlier – development is the easiest part of building a piece of software. It may sound weird but it’s true. In this article, I’ll tell you about my thoughts and conclusions that I have drawn.
Indexing in MySQL
Why do we use indexes? Searching through a row in a sorted file with N length takes O(log2N) comparisons and the same number of reads from a filesystem which is heavy itself. However, tables in databases are not sorted which complicates the operation, Especially, if you have a lot of reads, updates and deletions on them. Writing the sorted version of the file (table) would dramatically slow the database down. There is one more thing which makes it even more complicated: every table may be sorted in more than one order.
History of WWW
The history of the WWW wasn’t simple and still isn’t. In the beginning, it was a complete mess. Every browser tried to meet developers halfway without any standards or cooperation with other web browser’s developers. It all started with Memex – a theoretical machine created by Vannevar Bush with the ability to create links between documents and books and add comments to them. Until early 90’ Memex was derided and described as unreal because we had no tools to implement this idea.
How to name exceptions? It’s not so obvious...
Naming things is one of the most difficult things in our job. Naming exceptions are even more complicated because exceptions are not regular classes. In this article, I’ll tell you a bit about naming conventions I’ve found and tell pros and cons of them. The ‘Exception’ suffix. To add or not to add There are two schools to add the suffix or not to add it. Let’s take a look a bit closer to see main pros and cons of both points of view.
Mutational tests
When you have a very simple application it’s not so important to test every edge case but in a project, in the very complex domain, the priority of it will increase. The more high-quality the tests, the more high-quality the code. Mutational tests will help you with making sure you did not miss some a variant of the flow in your code. How it works Mutational testing is a test which runs other test several times but with a bit changed production code in every iteration.
An agony of trying to do the job
I’ll tell you a story of Igor. Igor is a web developer. He’s a young man with a girlfriend and some ambitious plan in the future. Igor sit at his desk because he has some work to do. In front of him is a PC. He turns it on and sees some system updates. 30 minutes have passed, and he can see his desktop with a beautiful wallpaper. Funny cats always make his day better.