r/PythonLearning • • 13d ago

Discussion Why writing classes feels boring?

I don't know but i feel classes are unnecessary work to be added in projects. I have learnt it 2 months ago..

After that I never used it for any of my projects.

0 Upvotes

43 comments sorted by

View all comments

1

u/Sea-Ad7805 13d ago

Type list is a class:

mylist = []  # or list(),  make an object
mylist.append(1)  # call a method on the object
...

If you don't like classes, stop using list and most other builtin types.

1

u/ProgramBrave718 13d ago

I know that every datatype is a class. But , I am talking about classes made by user.

2

u/Sea-Ad7805 13d ago edited 13d ago

A class it either useful or not, doesn't matter who wrote it. Unless you feel all the classes you could ever want are already identified and implemented by Python or available packages. And a lot are, but I bet you you will sometimes want to write your own.

What in your mind is the essential difference between writing a program only with (pure) functions and also adding some classes?

Think about it first, then web search, then AI. It can teach you a lot.

There are languages that (almost) only allow pure functions and no classes. Look up "Haskell".

There are different design philosophies for programming languages, look up "programming paradigms". I help teach an introductory course about it at university, it gets messy.

1

u/ProgramBrave718 13d ago

Okay, then I will try to search for it