+ 2
Disadvantages of using OOP in C instead of C++
I'm trying to implement an OO project in C, and I hear a lot that having no object support is one of the downsides of C, but for me structs translate quite literally to objects. So what's the catch?
9 odpowiedzi
+ 8
Class allow you polymorphism and encapsulation, which is available in classes and obeject means c++ only.
Let's take it easy , if you have a set of data of salary and you want to calculate ta,da pfa , basic pay and all , then in c++ you can perform it inside a class as it allows functions and for same purpose in c you need a structure and then a separate function, and then if you want to calculate these data for 500 person of a company means , you will be in mess, in case of c but in c++ it will be easy and just simple ........
I hope you can understand......
+ 3
Your welcome buddy, sure you must do it , keep learn.........
👍👍👍👍👍👍👍👍👍👍👍
+ 2
This is very different from people who
think in terms of "I have input, I take a
bunch of steps, then I arrive at my
results." For people who think that way,
procedural programming, 00P is just
hard. It makes everything seem chopped
up and out of order. Even if you try to help
out a procedural programmer by putting
methods down by order in which they are
generally first called, anyone trying to read
the code ultimately always has to skip
around between several source files,
sometimes even for a simple program.
+ 1
Thanks, Raj Kalash Tiwari. I think ill do it in Cpp, then, since I'm already familiar with C syntax and I know they're not that different.
+ 1
0OP's main disadvantage is also its main
advantage.
It forces you to think in terms of distinct
sections of code (nouns) that are
collaborating (verbs.)
This is very different from people who
think in terms of "output is defined by
input, storage, and processing." For
people who think that way, functional
programming, 0OP is just hard. It inserts
a kind of 'speaker, a 'thing which must be
operated upon' when what is wanted is
an output state as defined by an input
state.
0
Thanks for the contribution, Coder Kitten. I wanted to explore OOP as an exercise solely, also it suits the way I approach projects mainly because I'm an economist. I decided to learn C exactly because of that: the more you get into high level languages (I started with Python at the beggining of college, 3/4 years ago), the more obscure lower level topics get, like pointers, memory and related concepts. Again, thanks.
0
Thanks, ~ swim ~.