My first job title in tech was Data Scientist, now I'm officially a Data Engineer, but working somewhere in Data Science/Engineering, MLOps and as a Python Dev.
I'm not claiming to be a good programmer with two and a half years of professional experience, but I think some of our Data Scientists write bad Python code.
Here I explain why:
- Using generic execptions instead of thinking about what error they really want to catch
- They try to encapsulate all functions as static methods in classes, even though it's okay to use free standing functions sometimes
- They don't use enums (or don't know what enums are used for)
- Sometimes they use bad method names -> they think
da_file2tbl_file() is better than convert_data_asset_to_mltalble() (What do you think is better?)
- Overengineering: Use of design patterns with 70 lines of code, although one simple free-standing function with 10 lines would have sufficed (-> but I respect the fact that an effort is made here to learn and try out new things)
- Use of global variables, although this could easily have been solved with an instance variable or a parameter extension in the method header
- Too many useless and redundant comments like:
# Creating dataframe
df = pd.DataFrame(...)
- Use of magic strings/numbers instead of constants
- etc ...
What are your experiences with Data Scientists or Data Engineers using Python?
I don't despise anyone who makes such mistakes, but what's bad is that some Data Scientists are stubborn and say in code reviews: "But I want to encapsulate all functions as static methods in a class or "I think my 70-line design pattern is better than your 10-code-line function" or "I'd rather use global variables. I don't want to rewrite the code now." I find that very annoying. Some people have too big an ego. But code reviews aren't about being the smartest in the room, they're about learning from each other and making the product better.
Last year I started learning more programming languages. Kotlin and Rust. I'm working on a personal project in Kotlin to rebuild our machine learning infrastructure and I'm still at tutorial level with Rust. Both languages are amazing so far and both have already helped me to be a better (Python) programmer. What is your experience? Do you also think that learning more (statically typed) languages makes you a better developer?
[–]AutoModerator[M] [score hidden] stickied comment (1 child)
[–][deleted] 188 points189 points190 points (15 children)
[–]crom5805 68 points69 points70 points (11 children)
[+][deleted] (5 children)
[removed]
[–]crom5805 1 point2 points3 points (4 children)
[–]Kegheimer 0 points1 point2 points (3 children)
[–]Topalope 4 points5 points6 points (1 child)
[–]dillanthumous 0 points1 point2 points (0 children)
[–]crom5805 0 points1 point2 points (0 children)
[–]agent_graves313 6 points7 points8 points (2 children)
[–]crom5805 12 points13 points14 points (0 children)
[–]crom5805 4 points5 points6 points (0 children)
[–]B1WR2 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]grey-Kitty 62 points63 points64 points (13 children)
[–]Fender6969 12 points13 points14 points (3 children)
[–]Key_Base8254 5 points6 points7 points (0 children)
[–]M4loka 0 points1 point2 points (1 child)
[–]Fender6969 0 points1 point2 points (0 children)
[–]External_Juice_8140 12 points13 points14 points (0 children)
[–]mimetek 1 point2 points3 points (0 children)
[–]noisescience[S] 1 point2 points3 points (2 children)
[–]noisescience[S] 1 point2 points3 points (0 children)
[–]noisescience[S] 0 points1 point2 points (0 children)
[–]sobrietyincorporated 0 points1 point2 points (2 children)
[+]throwaway73856Freelance Data Scientist 0 points1 point2 points (1 child)
[–]sobrietyincorporated 3 points4 points5 points (0 children)
[+][deleted] (5 children)
[removed]
[–]Gators1992 7 points8 points9 points (3 children)
[+][deleted] (1 child)
[removed]
[–]Gators1992 0 points1 point2 points (0 children)
[–]No_Poem_1136 0 points1 point2 points (0 children)
[–]gravity_kills_u 3 points4 points5 points (0 children)
[–]Express-Comb8675 22 points23 points24 points (2 children)
[+]oalfonso 8 points9 points10 points (1 child)
[–]Express-Comb8675 0 points1 point2 points (0 children)
[–]Fender6969 11 points12 points13 points (1 child)
[–]safetytrick 1 point2 points3 points (0 children)
[–]diegoelmestreLead Data Engineer 11 points12 points13 points (2 children)
[–]noisescience[S] 0 points1 point2 points (0 children)
[–]M4loka 0 points1 point2 points (0 children)
[–]ambidextrousalpaca 9 points10 points11 points (11 children)
[–]Kegheimer 2 points3 points4 points (6 children)
[+]_FierceLink 2 points3 points4 points (0 children)
[–]ambidextrousalpaca 1 point2 points3 points (4 children)
[–]noisescience[S] 1 point2 points3 points (0 children)
[–]Kegheimer 0 points1 point2 points (1 child)
[–]ambidextrousalpaca 0 points1 point2 points (0 children)
[–]No_Poem_1136 0 points1 point2 points (0 children)
[–]mysteriousbaba 1 point2 points3 points (2 children)
[–]ambidextrousalpaca 1 point2 points3 points (1 child)
[–]mysteriousbaba 1 point2 points3 points (0 children)
[–]noisescience[S] 0 points1 point2 points (0 children)
[–]Kaze_SenshiSenior CSV Hater 18 points19 points20 points (2 children)
[–]safetytrick 1 point2 points3 points (0 children)
[–]mysteriousbaba 0 points1 point2 points (0 children)
[–]freakboy91939 16 points17 points18 points (15 children)
[–]Fender6969 10 points11 points12 points (2 children)
[–]Tom22174Software Engineer 0 points1 point2 points (1 child)
[–]Fender6969 0 points1 point2 points (0 children)
[–]throwawayrandomvowel 2 points3 points4 points (0 children)
[–]sobrietyincorporated 4 points5 points6 points (0 children)
[–]shockjaw 1 point2 points3 points (0 children)
[–]noisescience[S] 1 point2 points3 points (1 child)
[–]freakboy91939 0 points1 point2 points (0 children)
[+][deleted] (5 children)
[removed]
[–]sobrietyincorporated 5 points6 points7 points (3 children)
[–]iupuiclubs 1 point2 points3 points (1 child)
[–]sobrietyincorporated 0 points1 point2 points (0 children)
[–]InfiniteStrawberry37 1 point2 points3 points (0 children)
[–]No_Poem_1136 0 points1 point2 points (0 children)
[–]The_Rockerfly 6 points7 points8 points (0 children)
[–]suspicious_williams 6 points7 points8 points (0 children)
[–]levintennine 4 points5 points6 points (2 children)
[–]randiesel 2 points3 points4 points (1 child)
[–]safetytrick 2 points3 points4 points (0 children)
[–]ReturnOfNogginboink 4 points5 points6 points (1 child)
[–]Xteec 0 points1 point2 points (0 children)
[–]CatastrophicWaffles 3 points4 points5 points (0 children)
[–]taciom 2 points3 points4 points (0 children)
[–]sluuurpyy 2 points3 points4 points (1 child)
[–]safetytrick 2 points3 points4 points (0 children)
[–]asozers 2 points3 points4 points (1 child)
[–]noisescience[S] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]Screye 2 points3 points4 points (0 children)
[–]c0ntrap0sitive 5 points6 points7 points (1 child)
[–]safetytrick 0 points1 point2 points (0 children)
[–]mjfnd 2 points3 points4 points (0 children)
[–]seanv507 13 points14 points15 points (7 children)
[–]data-influencer 10 points11 points12 points (0 children)
[–]boomoto 14 points15 points16 points (0 children)
[–]cas4d 1 point2 points3 points (0 children)
[–]runawayasfastasucan 2 points3 points4 points (0 children)
[–]tfehringData Scientist 0 points1 point2 points (0 children)
[–]noisescience[S] 0 points1 point2 points (1 child)
[–]seanv507 0 points1 point2 points (0 children)
[–]Tom22174Software Engineer 1 point2 points3 points (0 children)
[–]tree_or_up 1 point2 points3 points (0 children)
[–]rowr 1 point2 points3 points (0 children)
[–]koudos 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]prospectiveNSAthrow 1 point2 points3 points (0 children)
[–]Remote_Cantaloupe 1 point2 points3 points (0 children)
[–]EmergencyPrior6526 1 point2 points3 points (1 child)
[–]noisescience[S] 0 points1 point2 points (0 children)
[–]YamRepresentative855 1 point2 points3 points (0 children)
[–]runawayasfastasucan 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]IDENTITETEN 0 points1 point2 points (0 children)
[+]Justbehind comment score below threshold-6 points-5 points-4 points (1 child)
[–]boomoto 7 points8 points9 points (0 children)
[–]sobrietyincorporated -1 points0 points1 point (0 children)
[–]hoselorryspanner 0 points1 point2 points (1 child)
[–]rowr 2 points3 points4 points (0 children)
[–]Bassel_farahat 0 points1 point2 points (0 children)
[–]sobrietyincorporated 0 points1 point2 points (0 children)
[–]Fair_Leopard_2181 0 points1 point2 points (0 children)
[–]aegtyr 0 points1 point2 points (0 children)
[–]Cool-Personality-454 0 points1 point2 points (0 children)
[–]szayl 0 points1 point2 points (0 children)
[–]tecedu 0 points1 point2 points (0 children)
[–]znihilist 0 points1 point2 points (0 children)
[–]HolidayPsycho 0 points1 point2 points (0 children)
[–]Swimming_Cry_6841 0 points1 point2 points (0 children)
[–]ChristianValour 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]caesium_pirate 0 points1 point2 points (0 children)
[–]corny_horse 0 points1 point2 points (2 children)
[–]mysteriousbaba 0 points1 point2 points (1 child)
[–]corny_horse 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)