How to coorperate with C programmers?

I am a student of EE who is doing a research about video processing.Most of my classmates, including my seniors, they deem they know c++ but always treat c++ as something ".c with pp"

They refuse to see the existence of template, STL, even
the iostream, they would rather create their double linked list
than using the container from the stl(the worst is I have to manage the memory they allocated);
they prefer to use macro rather than template.
They would laugh at you when you use std::cout rather than printf.

They always like to say something like
"c++ is just like c, why are you bother to use so many unreasonable, complicated features of c++?"
"macro are fine, for a normal people, char is much more easier to
understand than std::string, you should not use string, char is good enough"
"We don't need stl, it is difficult to comprehand and can't beat handcrafted c code"
"Who cares about uing object to manage resources?
free is fine as long as you remember when to release them
(the worst thing is I have to manage their memory)"

Their conclusion is :"stop using those unnecessary features, c is far
more better to read rather than those unreadable code write by your ugly c++ style"

1
2
3
4
5
6
7
8
9
std::vector<std::string> names;
names.reserve(10);
std::string temp;
for(size_t i = 0; i < 10; ++i)
{
  std::cin>>temp;
  names.push_back(temp);
}
std::copy(names.begin(), names.end(), std::ostream_iterator<std::string>(std::cout, "\n"));


They say this kind of code is crap(just an example), I should use malloc rather than vector
using for plus printf rather than std::copy and better don't mess up with string

If you are me, what would you do?Or the code like that is really ugly?
Last edited on
I wouldn't say I am good at c++ or know c++
I am just a novice who is trying to grasp c++ and programming
But I think it is meaningless to use c++ like c
No matter what kind of language(tool) I use
I should try my best to make a good use of them
even that means I have to spent my times to study

I can write c, but it is just too, well, verbose
Last edited on
I, personally, prefer C over C++ because I feel more comfortable with it. But those people are idiots. I only write C code because if I use C++ I feel compelled to use OOP, which I feel overcomplicates matters (although I'm really enjoying playing with C# with Mono and GTK#).
Now I only want to know how to cooperate with them if I don't want to
mess up with many low level features of c
How could I cooperative with something like
void example(float ***matOne, float****matTwo)
I have to know the way they allocated the memory before I could use them
I even have to fight with the memory leak cause by it as the old time(i can't change the interface)
Is it possible to make the code between c and c++ interface independent without paying the price of performance penalty?

I feel compelled to use OOP

Exactly, I never feel compelled to use OOP after I know oop is not everything of c++
Because I find out that I don't need to design everything by the way of oop
Maybe after I become a mature programmer I would like to use it a lot
But for now I am only like to use stl, adt, procedural programming, generic programming
and sometimes cooperate with the composition relationship(has a relationship) of the oop

I make a lot of faults by using those features of c++
But I would not give up on using them and learning how to make a good use of them
Fire could cause fire accidents but it is also very useful






Last edited on
Well, they don't know c++ then.

A good software engineer would present the benefits of C++ by way of examples and show why C++ is as efficient as C (again with examples). But, if they don't bite, then you're stuck with C.

My guess is that they won't bite, since everything you mentioned they said is indicative of close-minded individuals who are scared of C++ because they in fact don't understand it and are simply hiding behind any reason they can find online as to why C is better than C++, even if the reason is completely invalid.

Topic archived. No new replies allowed.