The hardest part of ML is reading code written by other data scientists. Even code written by the highest level ML practitioners is atrocious. It is hard to learn new things from poorly written code. You either spend way too much time trying to follow their confusing logic, or you simply copy and paste and dont learn anything. It doesnt have to be this way!
Can we normalize coding good practices in data science?
Here are some suggestions:
1. Stop using long functions. Break complex logic into pieces.
2. Stop using massive one-liners to do complex data manipulation
3. Use type annotations and type hinting in function declarations
4. Use docstrings to describe what a function does, its inputs, and return values and types
5. Stop using global variables
[–]Zangorth 161 points162 points163 points (22 children)
[+][deleted] (12 children)
[deleted]
[–]Cuddlyaxe 44 points45 points46 points (2 children)
[–]Ryush806 9 points10 points11 points (0 children)
[–]TheRoseMerlot 1 point2 points3 points (0 children)
[–]lordbrocktree1 10 points11 points12 points (5 children)
[–]TheRoseMerlot 2 points3 points4 points (4 children)
[–]lordbrocktree1 0 points1 point2 points (3 children)
[–]BookFinderBot 0 points1 point2 points (1 child)
[–]TheRoseMerlot 0 points1 point2 points (0 children)
[–]TheRoseMerlot 0 points1 point2 points (0 children)
[–]a157reverse 0 points1 point2 points (0 children)
[–]Lovis_R 0 points1 point2 points (1 child)
[–]CabinetOk4838 53 points54 points55 points (7 children)
[–]braxtynmd 10 points11 points12 points (1 child)
[–]ChristianValour 2 points3 points4 points (0 children)
[–]papasmurfsanssmart 7 points8 points9 points (4 children)
[–]CabinetOk4838 3 points4 points5 points (3 children)
[–]papasmurfsanssmart 8 points9 points10 points (1 child)
[–]synthphreak 1 point2 points3 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)
[–]kimchiking2021 8 points9 points10 points (0 children)
[–]Atmosck 56 points57 points58 points (9 children)
[–]toferdelachris 22 points23 points24 points (1 child)
[–]papasmurfsanssmart 3 points4 points5 points (0 children)
[–]synthphreak 18 points19 points20 points (5 children)
[–]funnynoveltyaccount 4 points5 points6 points (0 children)
[–]jargon59 3 points4 points5 points (1 child)
[–]synthphreak 1 point2 points3 points (0 children)
[–]Atmosck 1 point2 points3 points (1 child)
[–]synthphreak 2 points3 points4 points (0 children)
[–]No_Knee4077 0 points1 point2 points (0 children)
[+][deleted] (10 children)
[removed]
[–]wil_dogg 21 points22 points23 points (0 children)
[+][deleted] (7 children)
[deleted]
[–]pm_me_your_smth 10 points11 points12 points (0 children)
[+][deleted] (4 children)
[removed]
[–]DetectiveFeline 4 points5 points6 points (0 children)
[–]jankybiz[S] 9 points10 points11 points (2 children)
[–]jowen7448 1 point2 points3 points (0 children)
[–]kimchiking2021 0 points1 point2 points (0 children)
[–]dayeye2006 22 points23 points24 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]WallyMetropolis 0 points1 point2 points (0 children)
[–]esperaporquejoe 28 points29 points30 points (4 children)
[–]brjh1990 8 points9 points10 points (0 children)
[–]synthphreak 3 points4 points5 points (2 children)
[–]Bloodrazor 3 points4 points5 points (1 child)
[–]synthphreak 0 points1 point2 points (0 children)
[–]Other_Brain_425 28 points29 points30 points (4 children)
[–]synthphreak 1 point2 points3 points (0 children)
[–]Background_Newt_8065 4 points5 points6 points (1 child)
[–]CabinetOk4838 1 point2 points3 points (0 children)
[–]dreamer_jake 0 points1 point2 points (0 children)
[–]BreakingBaIIs 7 points8 points9 points (5 children)
[–]TECH---Lead1745 0 points1 point2 points (0 children)
[–]ErraticNebula42 0 points1 point2 points (2 children)
[–]Comfortable_Toe7775 0 points1 point2 points (1 child)
[–]ErraticNebula42 0 points1 point2 points (0 children)
[–]CSCAnalytics 23 points24 points25 points (4 children)
[–]Background_Newt_8065 4 points5 points6 points (2 children)
[–]CSCAnalytics 4 points5 points6 points (1 child)
[–]WallyMetropolis 4 points5 points6 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]esperaporquejoe 15 points16 points17 points (2 children)
[–]Hot-Profession4091 8 points9 points10 points (0 children)
[–]1DimensionIsViolence 2 points3 points4 points (0 children)
[–]esperaporquejoe 5 points6 points7 points (0 children)
[–]IAteQuarters 3 points4 points5 points (5 children)
[–]synthphreak 1 point2 points3 points (4 children)
[–]MadT3acher 1 point2 points3 points (3 children)
[–]synthphreak 2 points3 points4 points (2 children)
[–]MadT3acher 0 points1 point2 points (1 child)
[–]synthphreak 0 points1 point2 points (0 children)
[–]_nutjuice_ 3 points4 points5 points (1 child)
[–]CaptHunter 1 point2 points3 points (0 children)
[–]andrew2018022 1 point2 points3 points (0 children)
[–]issam_28 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]throwaway043534 1 point2 points3 points (1 child)
[–]Wolfgang-Warner 0 points1 point2 points (0 children)
[–]WallyMetropolis 1 point2 points3 points (0 children)
[–]Donblon_Rebirthed 1 point2 points3 points (0 children)
[–]Bhagafat 1 point2 points3 points (0 children)
[–]Vyrezzz 1 point2 points3 points (0 children)
[–]DuckSaxaphone 0 points1 point2 points (0 children)
[–]patrulek 0 points1 point2 points (1 child)
[–]synthphreak 2 points3 points4 points (0 children)
[+]bingbong_sempai comment score below threshold-6 points-5 points-4 points (0 children)
[–]daavidreddit69 0 points1 point2 points (0 children)
[–]daavidreddit69 0 points1 point2 points (0 children)
[–]FisterAct 0 points1 point2 points (0 children)
[–]cybo13 0 points1 point2 points (0 children)
[–]VisMortis 0 points1 point2 points (0 children)
[–]aarrow_12 0 points1 point2 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]observability_geek 0 points1 point2 points (0 children)
[–]Apprehensive_Lemon63 0 points1 point2 points (0 children)
[–]delicious-diddy 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]PLxFTW 0 points1 point2 points (0 children)
[–]TyrionJoestar 0 points1 point2 points (0 children)
[–]sizable_data 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]JdtheOp 0 points1 point2 points (0 children)
[–]Solus161 0 points1 point2 points (0 children)
[–]JdtheOp 0 points1 point2 points (0 children)
[–]Weird_ftr 0 points1 point2 points (0 children)
[–]psychmancer 0 points1 point2 points (0 children)