Python — No 1!

Cybersecurity, Cloud, Machine Learning, Automation, IoT … you name it, Python does it!

Python — No 1!

Cybersecurity, Cloud, Machine Learning, Data Science, Automation, IoT … you name it, Python does it!

Preface

I set a cryptography lab that used Python this week, and I observed that each student was implementing and running the coding in their own way. Some used Repl.it, while others dropped to the command line console in Kali, and others ran their code using Anaconda. Not one student had a problem with running the code. And, there were no fancy GUIs and extensive development environments on show. It all seemed so natural and just part of interfacing and communicating with machines. As I was using cryptography, there are often big integers involved, but Python didn’t care, it just let the student get on with learning, and forgetting about having to cast to Big Integers.

And so, Python …

Why we don’t teach every child at school to program with Python is beyond me. To me, using Python is similar to using a pocket calculator, and still, we hold back in creating a generation that can naturally code. In Maths, Biology, Physics, and so many subjects, Python coding could make a massive difference in understanding core methods, and where coding could easily replace the pocket calculator.

Within a few lines of code, we can bring data alive topics with graphs in any format that you want, or in investigating how IoT devices really work. But still, we have the approach that doing coding is only for those whose main job is to develop code in a structured way. To me, we should be teaching coding to the masses, and applying it wherever we can. The learning of the language, unfortunately, can be the most boring part of the learning process, but the learning of the principles will drive interest. In my job, the last thing I want to do it to teach the syntax of programming languages — I did that for a few years, and really didn’t like doing it — but want to bring concepts alive with practical examples.

But why Python? It’s not the most beautiful of languages, and it doesn’t have a nice structure. It is also a bit sloppy in places, but it has so many great libraries and matched to a command line, it doesn’t really care where and how it is run. In Cybersecurity, it is the go-to language for scripting in the Cloud, in data analysis, for encryption, and general automation. On my Web site — asecuritysite.com — I now have over 1,500 Python coding examples running in real-time, and also available for anyone to try themselves (using Repl.it).

No 1

So after years of dominance of the naughty child who refuses to go away — the C programming language — and from the back-end King — Java — Python has pushed its way to the top:

Figure 1: TIOBE current raking of languages [here]

This data comes from the TIOBE programming community and is based on the number of skilled engineers using specific languages. The rise of Python over the years has seen it gradually move into the Top 25 at the start of the 21st Century, while languages such as Pascal, Ada and Lisp have moved backwards in their popularity:

Figure 2: TIOBE ranking of languages over the years [here]

With Python, after a slow start, the last three years have seen it accelerate:

But what about the GUI?

For me? I have a love/dislike relationship with it. I know there are better languages around for specific things. Golang and C are superfast as they are compiled languages, but Golang suffers from not having the depth of libraries that Python has. And C? Well it is responsible for so many security problems, and just lets the developer do whatever they want. Rust is super secure but is horrible to program with. C# is just perfect in most ways, and when matched with ASP.NET provides a Web infrastructure that scales well.

But none of these languages were ever that good at the user interface, and even Microsoft’s attempt at using an XML approach (XAML) failed to take on. But, JavaScript came along. It is truly one of the worst programming languages, but it works, and it had a trump card: it worked in the browser. And so, many of the woes of building a GUI (Graphical User Interface) have gone the way of JavaScript, and which has left us with the middleware and the backend. For this Python has proven to be a trusted friend, with its script-based approach to segmenting tasks up. And for the middleware? Just pick your platform … PHP, ASP.NET, or whatever you want?

And for me?

It is my go-to language. To explain a method to students, I would always turn to Python to find the library or the code to implement it. It is a great scratchpad, and I try not to have code that is too long. For the subject I teach — cryptography — it is irreplaceable. For this I can now teach complex methods using simple code, and where a mathematical subject can become alive. For many, the practice is where the theory becomes alive — and real!

Conclusions

The world of data has moved on, and Python will play an increasing role. It’s not for the purest, but who cares? It gets the job done! For some reason, we created a whole generation who were switched off programming, and we are in danger of doing it again. We now need to show our next generation that coding should be as natural as using a spreadsheet, and that coding is not just for software engineers, it is for all. They will be scientists, medical professionals, cybersecurity analysts, data scientists …

I believe that the world has changed, and the demand for coding skills increases by the day. But often we can only look to the current time. Our future economy must be digitally focused, which means that we need to create a generation who can use data for change. We need a generation who understand technology, and not just use it. We need a generation who can innovate, and can use the Cloud to its maximum potential. Otherwise, we will stick with our 20th Century ways.

If you want to do some cryptography and Python, here’s a great library that implements all of the main methods:

https://asecuritysite.com/hazmat

Subscribe: https://billatnapier.medium.com/subscribe