No, no, I don't seeanysealarrogantyetalready, but I'm surethathewillsee a littlebitlater.
Sothisisjustifyou'renotfamiliar.
SuperSmashBrothersis a Nintendofightinggameon, andthere's a verystrongcompetitivescene, andtherearemultiplegamesthathavevaryingdegreesofrelevance, sortof.
Inthatscene, Meleeisprobablythemostpopularone.
Sothisis a gamethatcommandosin 1000 JewsandSmashBrothersmeleeveryfamousiterationofthefranchise.
Andthisapplicationhereiskindofjust a tournamentdataanalyzer.
Somaybeyouwanttopullupthe C S V filehereashoreon 18 issue H.
Nazi s V.
Sothisisjustkindofsome.
Nowalloftheseontheleftareessentiallyinthetop.
It's basically a matrixoftournamentdata, and I haven't analyzedthisdeeplytoknowexactlywhatthenumbersmeanbutessentiallygotfromreadingtheRepo.
Lookingattheothermodulesthatit's sortofwhat I caninfer, winsandlossesagainstotherplayers.
Thisisnice, becausehonestly, thefirstthing I wasgonnaaskiswhatarewelookingathere?
MalaydotpiecontainsthefunctiontoquerytheCSBfile.
APIdaPies, Themainflaskappcleanedup, I clears, cleansthedata, andthenwe'lltrytodecreasetheamountofmaterialchangesandaddthem.
Sothatfeelsmoretodothan a no.
So I feellike I wouldfirstbeinclinedtotake a lookatrequirementsthattextjusttowrapmymindaroundwhatthisisusingandthenmaybestartwith a p i dotpieandmakessensebecausethat's alsothatlookslikethat's theflaskappitself.
Andifyouwanttofixtheversionof a pitpythonpackageyou'reusing, youjustdowhatassaultEricdidherewiththeequalsequalsspecificversionnumber.
Allright, so a fewoftheselookfamiliarflaskJinjamarkupsafeisprobablyHTMLrelated.
I'veusedIt's dangerous.
I don't rememberwhatfunctionshaveusedtheirandbutwe'llseewhatwe'reusingthemfor.
Inlibraryname.
I haven't usedthatone.
SaltEricfeelfreetochimeinatanypointcauseyouknowthecodeandwe'remakingitupasweOh, soherewego a p i dotpie.
Nice.
Allright, sowepositionthis, I think, isanopportunitytocommentoncode.
Sohowdoyouwanttoproceedhere?
I'llsaywhatmyoriginalinclinationis.
And I thinkthisis a commonthemethroughout a lotofthereportsthatweseeisthere's therenocommentsinthisparticularmodule, andthatmayormaynotbeimportantforthisexample, becauseit's kindofsmall, but I mean, rightoffthebat, I'm alreadykindofforcingmyselftogointoreadthecodeandnotreallyget a programorhighlevelunderstandingofwhat I'm lookingat, S o.
I thinkdefinitelyhavingatleast a smalldockstring, ifnotjust a singlelineheaderoveralloftheseroutescanatleastyouknow, Seo, thisroutedoes.
Itservesthisinformationfromhere.
Isthatourdocksduring?
Whatdoyoumeanbythat?
SoDocStringis a commentlike a blocklevelcommentthatgoesover a functionthatspecifiesyourinputsandoutputstoyourfunctiongivesyou a senseof, umyouknowwhatdate I canfeedthefunction.
What I'm expectingbackandwithouthavingtonecessarilygetintothenittygrittydetails.
Especiallyforlookingat a reallylong, gargantuanfunctionthatwehavenoideawhatitmeans.
Lincolnimmediatelykindofatleasthighat a highlevel.
Understandthecodethatandactually, canwetalk?
Goovertoyourmainscreen.
Letmejustgoaheadandloginhererealquick.
Sure.
So I'm gonnagoaheadandLogginswithanaccountherejustsothatwetheoreticallycouldsubmitsomepullrequestshere.
Justletmeknowwhenyouwanttodo.
Itwouldberightback.
Justtypinginmysupersecurepassword.
Inthemeantime, remotesayswaitwindows.
Yeah.
Nowwe'reswitchingtowindowstoday.
Um, SemPerera.
Lee, herewego.
Allright, letmegoaheadandloginhere.
Givemeonesecond.
Yeah, it's a reallynicepieceofhardwareand a 3000 butsomethingPixelstwo, we'regoingdowntojust 10 80 feettonight, sowescaleddownjust a littlebit.
Sohaving a singlespacethere, itturnsoutthatPepalsosays, eventhough I findthisone a littleannoying, youshouldhavetoblanklinesinbetweenfunctionsandabovethefirstfunction.
Soyou'llnoticethatwehave a deafhellofunctionhere.
SoPython's gonnayellatus.
Ourpepisgoingtoyellatusifwetrytohaveanyfewerthanjusttwolinesthereandgettingaheadofmyself, it's gonnawanttolinesthere, andmaybe I thinkbelowthisoneaswell, though I don't recall 100% onthatoneinteresting.
I don't think I typicallydothetwolinesaftereachfunction, butitmakessense.
It's okay.
It's a littleexcessive.
I'm okaywithone, butsobeit.
Sostylistically, I thinkifyouifthisisproductioncodeoriftheapplicationisnearingtheendofitsdevelopment, youshoulddefinitelyjustremovestuffthatdoesn't needtobethere.
Youshouldinstead, accordingtoflasksondocumentation, useflask, runandnotevenhave a mainroutine, andyourflatsokindofinjectsitdoesn't likeinject a mainroutineorsomethinglikethatunderneaththehoodorthisyear.
I don't knowyetwhatprintplayerdoes, but I'lladmit I'm a littleuncomfortablewiththefactthatthefunctionscalledPrintPlayerthevariablescalled H two h statsandyoumightknowbetterwiththatsignifies.
I saythatwithoutknowingwhatthefunctiondoesyet, but I'm notseeinganyrelationshipamongthesethreestrings.
Andso I'd liketoseethiscleanedup.
But I don't knowoffhandhowbesttodothat.
Yeah, I think I think, like I said, withthedoctoring, havinglike, kindof a mappingbetweenwhatishohstatsmeanorwiththatshortforforsomebodycomingintothecode.
Butbeforewedothat, letmegobacktothereadonlyversionofthis, whichiswherewestartedand I justGoogledearlierbecauseyoucouldrunstyle 50 onyourownMacorPCondinfact, oryoucouldyousee a 50 i d.
Butitturnsoutsomeoneonlinemade a websitecalledPepeightonlinedotcom, whereyoucanpasteyourpythoncodeclickcheckcodeandthenthiswebsitewilllintit, sotospeak, analyzeit, staticallytoptobottomlefttorightandprovideyouwithfeedback.
ButifSaltEricwantstotake a lookatthistoyou, couldseeonlinefiveandnineand 13 and 16 aretheirsuggestionsforhowtoalignthiscodewithPep.
Eightsaysnothingaboutcorrectness.
Nothingaboutdesignbutdoessaysomethingaboutstyle.
There's a sadontothat a lotofmoderntexteditorstohavethesehavepluginsystems.
Yeah, V s codeAdamsublimeandwithinthosepluginecosystemsisusuallyverysomeonebig, reallygoodlynchingpluginthatyoucaninstallforpythonandmanyotherlanguages, buttheyusuallydefer, ultimatelyto a commandlineto a callpilot.
Ifnot, I mean, wedohavecommentsherealongtherighthandside, buttheproblemwiththecommentsalong, youknow, beinghereontherighthandside, Especiallywhenyouhavelineslike 21 here.
ThelinethatstartswithJasonhere.
Itmightbe a littlesmallintheerenhance a littlebit.
That's aboutasbigasitdidn't looklikeyougotanylargerand, Well, itwillin a fewseconds.
Allright.
I'm sorry.
Lookingpast, I thoughtitwaslookingatourcurrentviewlookingatlookingatourlifeSeemgreat.
Uh, bringthisuphere.
Okay.
That's gonnabebetter.
Um, soonline.
21 here, whichis a reallylongline.
Ifyou'remixingthatwiththesecommentsthatareinlinecomments, notonlywillthoselinestheverylargeinyourtexteditorthererequiringyoutosortofzoomout, butititgets a kindofmixandmatchyouractualcodewithwhereyourcommentsarejust a littlebithardtoreadon a littlebittoo.
Uh, what's theword?
I'm lookingfor a jampackedlookingforward.
Greeceofwords 100 clutter, clutter.
Allright, sowhatelsecouldwecommentonAppearSomatchupdataandJason, I don't reallyknowwhatthosearegonnabe.
Youcancatchthoseandprovidemuchmoreuserfriendlymessageslike 2018 h 28 dot c S v notfoundinheretothisisgenerallyfrownedupondesignwise, toohardcode.
Somethinglikethis.
Stringthisfilenameintoyourcodethatshouldprobablybefactoredoutto a constantor a globalvariablesomewherethat's configurable.
Maybein a filecalledconfigdotpiein a Jasonfileor a yamOhfileoreven a CIAfileofvariablesfortheprogramorjusttakeitinasaninputtothefunction.
And I wouldgosofarastosayit's okaytosignthatthedefaultvalueto a parameter, butallowthecallertooverrideitsothatwhenyou'replaying, maybeyouwanttotestitwith a supersmallCST.
Youdon't havetogochangingyouractualcodetotestitwith a differentfiles, a goodpointforscalability.
Sohereitlookslikewe'rejustfilteringoutalloftheemptyelementsofthatlist, and I'm okaywiththat.
Althoughstylistically, thereshouldbe a spacebetweenthehashsignandthefirstcharacter, AccordingtoPep.
Therewas a casethatwasmadetomeas I wasdoingsomedocumentationaboutolderpythonmodulesthatlikere, forexample, I thinkitwasoroneofthoseothermodulesitmighthavebeen.
Underscoretypesomethingmove, types, types I wouldlike.
Yeah, absolutely.
Anotherthingthat I wishwehad.
And I wishmorereposdid.
Thisishavingthedocstring.
Andifwehaveenoughtime, I mightgetto a coupleofexamplesthathavegreatdocStringisusedinthem.
Butthisonedoesn't havedocstrings.
Sogamewe'renotsurewhatittakes.
Whatitreturns, whatitdoes.
Justthatweseethatitsaysgameplayandresult.
Butthat's waytoogeneralofahstatement.
Itdoesn't sortofencapsulatetheflowofthefunction.
I don't know.
Youknowwhatthestartmiddleandendis, youknow, andit's a longfunction.
Thisfunctionisbasicallytheentireentirescripthere.
I think I thinkso.
Infact, I'd kindofproposewepausebecause I don't knowwhatthegamefunctionis.
Weshouldprobablyscrolldownandseewhat's goingon.
Sure.
Soheseeanotherfunctionhere.
Computer.
SeePlayer, Seeandmain.
Sofunnyenough, I wouldarguethatthewholepointofMaineistobe, indeedthemainfunctionandthevalueofgivingit a nameisgenerallytoputitwayuptopbecauseyoualreadymadeusthinkyoumademescrollthroughallofyourcode.
Andyetall I careabouthismaneandironically, gameisthefirstfunctioncalled.
Sothat's a goodthingwecouldgobackup.
Butifyou'regoingthroughthesehoopsandpythonofactuallycheckingwhetherthenameofthefileisunderscore, underscoremadeandyou'redefendingdefining a mainfunction.
I don't rememberthenameofthefunctionoffhand, theveryfirstfunction.
Butnowweknowthatweshouldindeedworkourwaybackwardsandlook a gamefirst.
Gettingoverallencompassingviewoftheapplication.
Indeed, and I wouldcommenttothesekindsofcommentswhileinthespiritofcommentingrigorouslyarenotthathelpfulbecauseMaineis, byconvention, themainpartofyourprogram.
Soit's notreallyaddedanything.
Andso, honestly, I'vestruggledwiththisbecause I commentallofmyfunctionsonewritingcode.
But I neverreallyknowwhattowriteforMaine, and I justsettledonwritingnothingforMainewhenatleastit's obviousthatthat's themainpointoftheprogram.