Don’t use properties and methods from outside the interface

It may sound obvious or even weird for people who programming in statically typed or compiled languages. In my work, I use PHP which is a dynamically typed language with optional strict typing introduced in version 7. At the beginning of my journey with PHP, I didn’t care so much about typing. I had a trivial cause — they didn’t exist yet.

I used to write a code without thinking about types. It was convenient and fast. Furthermore, it allowed writing proxy functions which recognize parameters type and it runs the proper function. Yes, overriding doesn’t exist in PHP.

But things changed when I discovered polymorphism. The magic keyword Interface that allows us to define the mandatory set of features in the object. The picture of writing a code without worrying about missing methods was incredible. I still didn’t understand one thing yet. How interfaces help me since I can pass everything on the function call?

This question lied a long time in my head until I discovered I can define the required type of passed object. Since that time, I changed completely the way how I write the code.

Read more →

Why I removed my old accounts and why you should too

Whenever people say about New Year’s changes they, mainly think about resolutions, plans and set up goals. But this is also a great time to small retrospective both your personal and digital life.

Let’s talk about the digital once.

Do you realize how many registrations have you performed over the last year? Or over the last 5 years? Who did you give your email, personal data, photos, documents or other files to? Too often, it’s too much to know about all this.

Think about each website, application or service which you used and you didn’t use it for a long long time. Social profiles, cloud storage, dedicated tools and the other software. In each of them, you probably left some data. Maybe it’s not relevant and doesn’t have any value for you, but this information is about you.

What if one day, someone will get access to all of these data you left in the Internet?

Read more →