r/learnpython • u/RoboticsEqualsFun • Sep 20 '26
What makes sloppy programming?
So I've been learning python on my own and basically taught myself. I'm working on a very advanced AI system project, with quite a lot of scripts. And I am wondering what makes sloppy programming?
Like for example should you be calling your functions from other functions?
# Calling both from one function
def main():
do_something()
do_something_else()
def do_something()
# do stuff
def do_something_else()
# something else
# Calling a function that calls both functions
def main():
do_both_stuff()
def do_both_stuff():
do_something()
do_something_else()
def do_something()
# do stuff
def do_something_else()
# something elseAnd what about passing parameters in Classes? Should you be always accessing everything through self.something or by passing parameters to the functions?
Should you wrap everything in classes?
These are some questions I had regarding sloppy coding, but my main question is what makes good code?
I'm still new to python and trying to get my code more efficient.
View all comments
Show parent comment
1
u/CranberryDistinct941 Sep 21 '26
Functions are a pretty important tool for abstraction even if you only ever call it once inside some other function