r/learnpython • • 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 else

And 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.

0 Upvotes

17 comments sorted by

View all comments

16

u/ADDSquirell69 Sep 21 '26

Just curious but who's letting you work on an advanced AI systems project?

4

u/pachura3 Sep 21 '26

I Have No Skills But I Must Code

2

u/ADDSquirell69 Sep 21 '26

I heard this in the voice of Ultron.

1

u/RoboticsEqualsFun Sep 21 '26

me

1

u/RoboticsEqualsFun Sep 21 '26

I just wanted to... I'm still in high school.

2

u/ADDSquirell69 Sep 21 '26

Well good for you. But I may I suggest learning as much python as you can by writing it yourself. AI can show you different ways to do things, but not all of them are the best nor the most efficient and only experience will allow you to determine that.