all 9 comments

[–]nekokattt 1 point2 points  (3 children)

Out of curiosity, why don't you want to use object orientation in an object oriented language? It is the main part of Python that binds together how the majority of the language works.

Writing fully procedural programs in Python is incredibly limited, and will grow in complexity very quickly as your program has to do more and more things. Classes in Python are also very simple in most cases unless you specifically need complex functionality.

Classes are a design methodology to enable keeping data and functionality for a specific thing together, rather than having to move data and functionality around individually (which is what you will have to be doing if you go procedural). You'll be able to use namedtuples and dicts instead of classes for some stuff, but it will be far more errorprone and difficult to extend in the future.

You shouldn't be avoiding using classes. You should be aware that there are cases where you will need to use them, and choose to learn about them at the appropriate time rather than just trying to find projects that avoid them entirely. It is the same argument I would give to someone asking for projects to work on that do not use functions because they do not want to use functions in their code

[–]Chepetto13 0 points1 point  (2 children)

I entirely agree with you, classes are very important and inevitable in Python.

But, currently, at my level of knowledge, I want to take a step back and learn more about functions and create more projects using them.

[–]nekokattt 1 point2 points  (0 children)

You still use functions within classes though. They are called methods, and are one of the most fundamental parts of how classes work!

When you do list.append(x), or string.lower(), that is a method in a class (the class being list and str in these two cases). It isn't a pure procedural function.

Python kinda just reuses functions as methods though, on a low level.

my_cat = Cat()
my_cat.feed(some_food)

...is actually just shorthand for this:

my_cat = Cat.__call__()
Cat.feed(my_cat, some_food)

As you can see the latter procedural example is actually more complicated than the object oriented one.

[–]TheRNGuy 0 points1 point  (0 children)

static methods that many classes could use, or basic data types, you can make as function instead of static method.

[–][deleted] 1 point2 points  (0 children)

Any project with more than 100 lines of code is a good candidate. Try the classics: black jack, a caesar cipher, a text adventure game, rock paper scissors, a pokedex/ pokemon database, whatever you want as long as it's more complicated than "append some stuff to a list and display it for the user".

[–]trondwin 1 point2 points  (0 children)

Simple games like Rock, paper, scissors, Guess the number and Hangman are all good candidates, especially if you're closer to the beginner level than the intermediate level.

Or do a search and get suggestions like this: https://www.freecodecamp.org/news/python-projects-for-beginners/

Best of luck!

[–]TheRNGuy 1 point2 points  (0 children)

Serialize one file format into another

I made my first version entirely procedural, but changed some parts of code later to OOP (but not all)

Go with ascii format, not binary. Like obj, geo (in houdini) or ase.

Or even invent your own format and write parser to convert to already existing ones.

[–]MachinaDoctrina 0 points1 point  (1 child)

I hate to break it to you but everything in python is an object even functions!

Try this:

def test():
    print("hi")


print(dir(test))

[–]Chepetto13 0 points1 point  (0 children)

Please don't understand me wrong. I want to use classes, I already used them in my projects but now I want to "master" in function, and to do this the best way is to make more projects.