Why Program Object Oriented Instead Of Procedural?

Why program object oriented instead of procedural?

Are there any advantages or is just a personal preference?

I feel more comfortable writing proceduraly in Eric with pyQt,then object oriented with clases and initializations and bla bla.

Cheers

Ok guys here is what i read in a tutorial for pyqt :

The previous example was coded in a procedural style. Python programming language supports both procedural and object oriented programming styles. Programming in PyQt4 means programming in OOP.


Questions :

  1. Why not write proceduraly with pyQt when it is so much simpler and more fun?

  2. Why "Programming in PyQt4 means programming in OOP" ? Both are suported,why pyqt4 programming means object oriented?

please help folks

QUOTE
1. Why not write proceduraly with pyQt when it is so much simpler and more fun?

hehe. well, unfortunately, simplicity and fun are not the primary requirements for programmers trying to get a job done.

the answer to both of your questions is really the same. object oriented programming is waaay too big of a topic to get into here, but suffice it to say, you must use oop with PyQt because every ui element is represented and used as an object in PyQt.

really, if you think about it, you'd have to go out of your way to not use oop in python. you might not create any of your own classes, but you're always using classes.

CODE
s = 'this is a string'
buf = s.split()
print buf
['this', 'is', 'a', 'string']

there, you've just used oop by using the split method of the str class. go read some books on python and classes. i think that you might find them even more fun than plain ole' procedural coding. i know i do.

-chad

So I don't have to create my own classes at all while writing in pyQt4?

Yeah babyyy,that is so much easier.

Anyways how do you make your pyqt interfaces?

Do you use Eric IDE,Eclipse? Do you write the interfaces or you use the QT Form Designer and then translate that into python code?

Once you have the python code for the interface do you go into maya and continue from there with python in maya to add comands to that interface?