Public vs Private Variables
When I was still at the beginning of my coding journey, I had already achieved to produce some useful scripts in VBA and Python, and I didn’t quite know what to study next.
I was lucky I had a few Senior Software Developer co-workers that I could go and ask for guidance. One of these Senior Developers recommended me to read this book by Matt Weisfeld.
So I started reading it, and from time to time I would have discussions about it with another friend who was on the same journey. One of the things that I noticed quickly was that the concept of private vs public was a new thing for me at that time. I had been coding in Python for a while and I was trying to make sense of what the book said, in Python terms. And then one of the Senior Developers told me that, as per the python docs, ““Private” instance variables that cannot be accessed except from inside an object don’t exist in Python”.
I finished reading the book, took a lot of notes, and applied the main concepts I gained from it with the language I was using the most at the time, Python. I knew that eventually, I would have to work with a language where the code looks more like the code examples of the book.
And it eventually happened: today is almost a year since I code in C#, and all the concepts of the book I read a few years ago are applied in a more straightforward way.
I feel grateful I had the opportunity to work with two languages that manage private (or non-public) variables differently. There is always a lot more to learn.