Mixing procedural and object-oriented programming

So, a long time ago, I first programmed procedurally first Basic on my first B-model B, and then a small amount of Pascal at the university, as well as an assembly along the way.

Then came OO, which seemed much more reasonable, and that was all I used with C ++, Perl, Java, Ruby .....

Returning to non-web programming after a break of about 8 years or so on the iPhone, I found Objective-C to be very easy to pick up, but from time to time I have to drop Objective-C and revert to plain old C for low-level stuff and where it goes again returns to procedural programming.

What I need is a good reference on how to mix Object Orientated and procedural styles, how to manage memory, wrap procedural parts in an object, etc. etc.

Also a good guide to a good procedural style for C would be helpful, since I can't even think about procedural terms anymore.

+3
source share
4 answers

My recommendation would be to use object-oriented programming as the highest level of organization and procedural programming to implement. OO is best suited for defining interfaces, contracts between components, breaking code into consecutive chunks, etc.

, , , . , , , . , , , , , .

+4

, / . , . , , , .

. , . iPhone, / .

+1

, - - , , .
++ Ojective-C , , .

C OO.
googling "C - ".

+1

. . objective-c ++.

0

Source: https://habr.com/ru/post/1708257/


All Articles