Programmers: Whats your perference: OOP vs Procedural - page 2

 
Isn't it worth learning OOP in MQL4/5 for a novice? I am just trying to understand OOP although I m not a programmer.
 
belido:
Isn't it worth learning OOP in MQL4/5 for a novice? I am just trying to understand OOP although I m not a programmer.
It's always worth to learn.
 

I own one of the EA builders for MQL4/MQL5 and I don't use objects at all, there are only functions. Now that MQL4 supports OOP I will probably move to OOP, because I need some global structure, but for small projects I don't see why objects are needed. OOP is only needed above some point of complexity and normal EA is not so complex to deserve OOP.

That EA builder works on PHP and it became a big project by itself. In the beginning I started without functions and things quickly turned into mess. Then I started using functions - a little bit better, but still mess. Now I'm moving to objects to organize things more.

In my opinion, OOP requires experience of planning and making structure of the whole thing. If one does not have a global idea of what should be done, he is not even thinking about using objects. The biggest positive of using objects for me is that I am much more careful of what I am doing within a single object, which is normally within a single file. I still like functions more, but with objects I'm forced to create better structure of the whole project.

 
MQL5 is an over-engineered nightmare. Someone got the Martin Fowler book from the library and decided to abandon all common sense and reincarnate a dead language. The reason MQL4 is/was successful is because it's simple to use, just like the old VB6. Nobody wants to learn Win32 style bloated C++ with memory management and structures who's enumerations require a degree in witchcraft to figure out. Seriously, if it wasn't for the debugging features that MT5 offers, I wouldn't touch MQL5. Sorry, if you want to do OOP right, look at C# 5.0 and the .NET Framework, not VC++6.0
 

procedural

Very small number of cases to use OOP on mql4. 

 
MQL4/5 are scripting languages. So Procedural Style Programming fit them. OOP makes the life a complicated.
 

1) If you look at here you can see OOP languages lose continuously their attraction (after the initial hipe?) and C++ is way below C!

2) OOP to me means a lot more code to write (a novel instead of a poem;)!

3) Java means to me searching 60% of the time in the manuals: Does already exist a function that does what I need, how is it working, what does it need -  or do I have to write it my own anyway.

4) Have you ever tried to understand the inner program logic of an OOP trading program? The main program has only a few lines with functions of objects from elsewhere using other functions of other object from elsewhere - or it is written in mq4 style.

 
Depends on the job you want accomplished. I agree, procedural is a hell of a lot quicker and easier and does the job just fine most of the time when writing indis and EAs.  But there are occassions when using a little OOP actually makes the job easier (but not often :)
Reason: