Developer's blog
Why should your objects be immutable?
Objects are divided into mutable and immutable depending on the possibility to change. Objects that don’t change their internal state after creating are immutable. Otherwise, they are mutable. Why should we think about it? This is an incomplete list of advantages for immutability: easier support in the future immutable objects are simpler to use immutable objects are simpler to test truly immutable objects side-effects free they are much easier to…
Friday’s adventure with Backward Compatibility
If you work with open source, in the environment world, these are public plugins, and you have a lot of users, but backward compatibility is tedious. But today, there was a hilarious case when it was not an obvious situation. Let’s deep into it. The problem I have a class that I’ve decided to mark as deprecated and write a new code that more readable (I think in such a…
ACID databases as guarantee data safety
ACID (atomicity, consistency, isolation, durability) is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps. Wikipedia The transaction is a sequence of database operations such as select, insert, delete, or update as one single work unit. Atomicity Atomicity guarantees that each transaction is treated as a single “unit”, which either succeeds completely or fails completely: if any of the statements constituting…
Take responsibility into your control with GRASP principles
General Responsibility Assignment Software Patterns (or Principles), abbreviated GRASP, consist of guidelines for assigning responsibility to classes and objects in object-oriented design. Wikipedia I want to start with the fact that, strangely, GRASP is in the shadow of SOLID patterns, although it seems to me that it has more specific examples and is easier to understand. The importance of these patterns can’t be overstated in modern development. Generally, nine rules…
SOLID principles in simple words
SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible, and maintainable. The principles are a subset of many principles promoted by American software engineer and instructor Robert C. Martin. Wikipedia Generally, I don’t want to show a deep analysis of each principle. It’s just a review in simple words which in my opinion must have to know for OOP languages as for example…
Automated testing is a way to improve product quality
Testing – checking the correspondence between the real and expected program behavior. Some smart person Adding new functionality, you need to check how these changes affected the entire application. You should check how the new feature works and whether the previously written features work the same way. The larger your application, the more time it takes to test it. I’ve participated in teams where each developer had two or three…