Good stuff, one rule I have is to never use classes unless you have mutable data where you need to track it's state. Even then you may not need a class. It's easier to test, debug, and maintain function vs classes.
@Carberra3 ай бұрын
Thank you! Honestly that's a pretty good rule.
@largewallofbeans98123 ай бұрын
I must disagree with you on this. Using classes means that you can handle a bunch of objects that have predefined operations rather than big if-elif trees with the same operations that may take a while to select. It's hard to explain in writing but in the project I'm working on, it makes performance slightly better.
@epicmoofish37263 ай бұрын
@@largewallofbeans9812if you are worried about performance you are using the wrong language
@justtil67493 ай бұрын
Classes allow for dependency inflection, and therefore better testing
@pythonwithjames3 ай бұрын
I really agree with the idea of splitting up complex functions, makes testing a lot easier too!
@Carberra3 ай бұрын
Oh yeah testing for sure. There is actually something called cyclomatic complexity that can be used to measure the complexity of a piece of code. I intentionally chose to not mention it, but now kinda wish I had. Oh well lmao.
@synchro-dentally19653 ай бұрын
"y" no love?
@ronalddebruijn6133 ай бұрын
Thanks, I like your practicality!
@rivencooler19513 ай бұрын
Good stuff and you got me idea on how to write the clean code. I have a request, can you make a view on your VS code setup/cnfiguration?
@Carberra3 ай бұрын
Thank you! And I already have! There's a link in the description.
@KavyanshKhaitan3 ай бұрын
At 3:16 In my opinion, shifting the return False to the next line makes it less readable, and it should stay in an else block. BUT, the part after that makes it more readable.
@Carberra3 ай бұрын
Yeah it wasn't the best example for that specifically, but I just wanted to show off that's generally how it would work. It would work best where there were multiple negative cases you needed to pick off.
@KavyanshKhaitan3 ай бұрын
@@squishy-tomato yeah thats prob why. Since I never read code in that manner, it looks wierd.