Tim Webb
Joined: March 12, 2019
Last Seen: October 20, 2019

Comments by Tim Webb

Be The Noise said on August 4, 2019

Hi Tim,

I'm going to be following your videos. I have programmed professionally in other languages and on a different platform but I also like Python a lot and have dabbled with it even for work related projects.

Good luck with this new project!

Thank you very much! I think you're going to have a lot of fun!

Be The Noise said on August 18, 2019

Hi Tim, I was wondering when you programmed your website if you went full on OOP or not.

There are elements to all Python programming that can be considered OOP. I'm using the whole swath here! I guess the most OPP parts are Class Models, but really it is all OOP all the way down.

Now that I come to think of it, the only code that isn't OOP would be the JavaScript. I didn't need classes or inheritence there.

Oh, yeah. That's just something you do as needed.

The structure of websites tends to be very different from other programs. The code is basically just sitting there waiting for you to hit it, and then it needs to figure out what page to return.

This Event Driven approach is unique, but it gets even weirder because it is also Stateless. The code doesn't actually remember who you are or who I am. It just reacts to events. In fact if you try to give it a state, like saving a user-specific variable, it will probably break. The backend for this site is being run by four different "Workers". Each time you visit the site you get one of these random workers that runs the code. That worker probably wouldn't have any user-specific variable that was saved on only one of the four workers.

So designing the backend to a site is all about using events and a limited amount of information to try to figure out WTF is going on. Deciding what you should, or should not, be showing the site's visitor for the specifically requested URL. This necessitates a code structure that is entirely unlike any other common code pattern.

But yes, that does include making classes when you need bespoke or complex objects.