This meeting was about improving code efficiency to retrieve sports statistics from various specific sports paths. The main idea discussed was to clean up the complex function for each sport to make the code more streamlined.
Key topics discussed were: - Ways to implement "set conditionals" for different sports statistics - Strategies to find a simpler solution using cleaner code triggered off of a switch depending on the sport input - The challenges faced with the current code, mainly dealing with different data paths per each sport (NFL, NBA, NHL) - The need to restructure the current code to avoid blank outputs and to properly access 'totals' and 'statistics' for each sport. A suggestion was made to replace the complex, tall function stack with smaller, simpler functions. This separated the concern, making the code easier to understand. It was recommended to blow it out into different lines to have better control over it. The use of "switches" in Xano was discussed, which could be achieved through a stack of "if-else" statements. It was further advised to focus on transforming the input data (the 'T' in ETL - Extract, Transform, Load) instead of obsessing over the API call (the 'E' in ETL). This could be achieved by creating a function that extracts the teams as input. This would stop and debug the 'totals' for different sports, copy them into notepads, and test the transformation. Overall, this meeting provided insight into efficient data manipulation, conditional variables, and the creation of more efficient functions. It achieves better code management, easier troubleshooting, and more streamlined data retrieval from various sports paths.
(Source: Office Hours 11/10 )
Join State Change Risk-Free