• Introduction
As I begin my journey in learning Python to grow in cybersecurity, I came across something called the Zen of Python. To be honest, the night we had our onboarding mentees’ meeting with Mr. Uba Joseph Ugochukwu and his team in the “From Zero to Hero” python class, was my first time of hearing “The Zen of Python”. I had to do my research before I understood what it means. In a nutshell, it’s a list of 19 short rules that help Python programmers write better codes. These rules were written by Tim Peters, and they are easy to understand but full of wisdom.
Here are 4 of those rules that really speak to me, and why I think they are important in my journey:
Simple is Better Than Complex.
I’ve always admired simplicity in every work I do. I studied Electrical/Electronic Engineering and currently working in a renewable energy company. In my experience so far, making my solar PV strings, electrical wiring and designs simple is always better than making them look complex. This makes it easier for another Engineer to work on. In like manner, by the end of this program, I aspire to write codes for security, that are simple, easier to read, test, and fix. This is because, if a script is too complicated, it may have hidden bugs.Readability Counts.
After I graduated from the University, I found myself teaching science and technology subjects in secondary schools. There, I discovered how haphazardly some students could write. I struggled with reading a lot of handwritings while marking scripts. Trust me, it was not easy trying to put those writings together and figuring out what the students wrote. Readability always counts because recently in my tech journey, I’ve discovered how important it is for me to write codes that are easy to read, not just for me, but for others too. Before this program is over, I’m looking forward to equipping myself using python for cybersecurity because I may need to read other people’s code to find out what it does. If the code is clear, I’ll understand it faster, find mistakes and fix problems quickly.Errors Should Never Pass Silently.
While doing my electrical works, I found out that any loophole in my work will end up hunting me in the long run. It’s either a cable is overloaded which causes excess current to flow. Hence, burning that cable, or there was an untight connection in my cable terminations which can cause fire outbreak later. Because of this, I’ve learnt not to ignore errors in my work. Now, coming to learn python and seeing this principle gave me that feeling of, “wow, so I’m going to be a good fit in cybersecurity after learning python”. This means that if something goes wrong in my program, I shouldn’t just ignore it. It’s better to show an error or fix it right away. So, by the end of this program, I’ll learn to write python codes without letting errors pass silently, as well as getting me ready for cyber jobs.There Should Be One — And Preferably Only One — Obvious Way to Do It.
Some people use the popular saying, “there are many ways to kill a rat”. Yes, but there’s still that one preferable way that’s very obvious to kill a rat, depending on the situation on ground. This means it’s better to have one clear way to do a task in Python. Too many ways can be confusing. I can’t wait to work in teams or on security tools and apply this principle after this program. One clear method is better than many confusing ones.
Conclusion
The Zen of Python has helped me think better as I learn to write codes. These 4 rules will guide me to write security codes that are clean, safe, and easy to understand.
I must not fail to express my gratitude to Black Python Dev for their partnership and support for making this mentorship possible. Now, let the journey begin!