As I was randomly browsing through some site optimization content, I got this suggestion that I should use a “modern” image format such as “webp” to get lower image sizes and implicitly speed up page loading time. I can’t say it made a lot of sense to me that very moment, thus the rabbit hole I have soon found myself going into.
1. Introduction
To sketch out some context, the well-known imge formats such as “jpeg”, “png” or “gif” are with us for 25 years or more; they were put together in a time when both storage and cpu processing power were premiums rather than commodities. That meant accepting compromises and precise product-market fits: “jpeg” became the universal format for everyday pictures, “png” for icons or computer generated images and “gif” was mostly delegated to short animated sequences once the patent covering the corresponding compression algorithm expired in the early 2000s.
Modern Python offers powerful features such as asynchronous programming (using async
and await
) and memory-efficient data processing with generators and iterators. Leveraging these advancements, primarily found in Python 3, can significantly improve your code’s performance and maintainability. This often necessitates migrating existing Python 2 projects. The migration process can vary from a straightforward conversion to a substantial refactoring. To help you navigate this, we’ll discuss some of the crucial differences between the two Python versions.
1. PRINT:
This one is easy – most of the time it’s just about translating code from:
print "abcd";
to:
print("abcd")
Some years ago, back in the country I grew up in, back to an age when I was still watching TV, there was a certain trend: TV stars would move their shows to different stations and find themselves, months later, in a bad position.
Even if they were initially offered better packages and maybe were able to take some of their initial staff with them on the new venture, they ultimately failed to actually move audiences for more than a limited period of time. Some of them ended being thrown out of TV business for good.
Tabloids would sometime chime in and ask questions in the line of “how was that even possible?”, but they would not post answers (not that they had anything meaningful to say). I’m not sure their readers would have had any chance of understanding what was really going on, though.
I wasn’t at that time in any position to understand what was going on either, even if I did have access to smarter opinions in the line of “the shows were actually better before the move” or “some stations have more money to spend on everything and can afford not to cut corners”. That’s actually the visible layer: I had to move jobs myself a couple of times to realize what the success is about. To summarize:
-
it’s not about you having some special talent;
-
it’s not about you pulling the company uphill by yourself;
-
it is about the whole environment that makes you succeed or fail, starting from how clean is the toilet at your work place.