News for hackers. Stuff that matters.
Re:OO is not Computing, Newer is not More modern by 16s on Monday April 30, 2012 @08:06AM (#3908856)
That's why I like C++ so much. It doesn't force OO down your throat. It lets you program using whatever style is best suited for the job.
Re:OO is not Computing, Newer is not More modern by udp on Monday April 30, 2012 @08:36AM (#3908941)
I also take or leave C++ language features as required, and I wish more people shared your point of view.

Among the C++ crowd (particularly over at Stack Overflow) there's this infuriating attitude that any code that doesn't use std::string, std::vector or boost::magic_super_auto_ptr is language sacrilege and the developer should be burned with fire because it's not C++ it's C and malloc is deprecated and arrays are deprecated, and, and...

Re:OO is not Computing, Newer is not More modern by UK-AL on Monday April 30, 2012 @08:42AM (#3908960)
That's because without using these things, people can end up accidently shooting themselves foot quite easily. Like accidentally removing the end character from a char* string...

Normal malloc, and dealloc can get stupidly complicated when lots of other objects reference one memory location, which is why these referencing auto pointers come in, with built bounds checking etc

Using those things is defensive programming.

Re:OO is not Computing, Newer is not More modern by v0cab on Monday April 30, 2012 @09:27AM (#3909122)
Did you mean to respond to my post?

I agree with what you said. I tried hard to use C++ language features (especially STL) in a previous job and it was more hassle than it was worth, honestly.

Re:OO is not Computing, Newer is not More modern by v0cab on Monday April 30, 2012 @08:14AM (#3908881)
That's why I like C so much.
Re:OO is not Computing, Newer is not More modern by UK-AL on Monday April 30, 2012 @08:29AM (#3908919)
Yeah, but in C you end up creating your own data structures from scratch every time. You can use data structure libraries, but without generics or something similar, it makes it difficult....

Then sometimes actually getting a external c libary to build(If it's not in the package manager) is sometimes trouble. ./configure ./make usually ends up in some obsercure error or depedency... C++ usually makes the errors even more unreadable...

Re:OO is not Computing, Newer is not More modern by v0cab on Monday April 30, 2012 @09:24AM (#3909109)
> in C you end up creating your own data structures from scratch every time. You can use data structure libraries, but without generics or something similar, it makes it difficult....

Hmm... I never ran into too many problems with this myself, but it could just be outside of my experience. Can't TYPEDEFs help with this?

Also, better to have the code to step through, rather than decrypting STL/template compiler errors, no?

And what's the harm in a bit of repetition of code structures?

> Then sometimes actually getting a external c libary to build(If it's not in the package manager) is sometimes trouble. ./configure ./make usually ends up in some obsercure error or depedency... C++ usually makes the errors even more unreadable...

C++ is the main thing I'm comparing C to. Yes, sorting out dependencies isn't fun.

Re:OO is not Computing, Newer is not More modern by xyzzyz on Monday April 30, 2012 @10:45AM (#3909448)
Array is good enough data structure for most uses, and

Yeah, but in C you end up creating your own data structures from scratch every time.

is not true.

Re:OO is not Computing, Newer is not More modern by UK-AL on Monday April 30, 2012 @06:33PM (#3911916)
It is true, unless you do some preproccesor hacking(Type arguments can have no * or spaces), or use void* at which point types become useless.
Re:OO is not Computing, Newer is not More modern by v0cab on Wednesday May 02, 2012 @04:53AM (#3918132)
You don't have to create them from scratch though -- you can reuse old code, even copy-and-paste it.