Serving the Quantitative Finance Community

 
User avatar
gc
Posts: 10
Joined: September 21st, 2002, 10:08 pm

C vs C++ ...

November 10th, 2011, 2:57 pm

QuoteOO language has to mainly be concerned about Objects. C++ is focused on classes, types etc. you can't do proper OO in C++. it's like MMA vs Judo. C++ is messy messIs this the beginning of a sophistic discussion on the terms "class" and "object", or are you joking?Would you care to provide your definition for "class" and for "object" and even of "OO"?I may be old school, but the definition I studied is that a class is the construct that is used as a blueprint to create instances of itself and the "object" is an instance of a class. In terms of what is OO, I remember hearing very boring discussions 15 years ago on the difference between OO languages and Object Based languages. I don't think anyone ever got any wiser as result, but maybe there are new developments in software engeneering that make the classification useful?
 
User avatar
Cuchulainn
Posts: 22927
Joined: July 16th, 2004, 7:38 am

C vs C++ ...

November 10th, 2011, 3:31 pm

gc,Just ignore him, he is wasting your time. Remember @javabean? Same person. You will never get a straight answer.
Last edited by Cuchulainn on November 9th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
gc
Posts: 10
Joined: September 21st, 2002, 10:08 pm

C vs C++ ...

November 10th, 2011, 3:37 pm

QuoteOriginally posted by: Cuchulainngc,Just ignore him, he is wasting your time. Remember @javabean? Same person. You will never get a straight answer.Oh... not another one of them, please! Thanks for the heads-up!
 
User avatar
renorm
Posts: 1
Joined: February 11th, 2010, 10:20 pm

C vs C++ ...

November 10th, 2011, 7:38 pm

Linus is a kernel guru. Maybe he doesn't need C++ to get things done, but most people can't write kernels. It makes no sense to ask them to code everything in C.Now, since somebody already mentioned Java...I think Java is less OO than C++ by any measurable standard. And here is why.1) C++ supports all OO abstraction available in Java and much more.2) In Java object lifetime isn't well defined. RAII isn't possible. This requires lot's try-catches in anything but toy projects. On the contrary, very often you can write exception safe code in C++ without a single try-catch statement, because cleanup routines can be encapsulated into destructors. C++ objects know how to die gracefully. Java objects don't. 3) Java objects are handled by reference. This messes up copy constructor and assignment - arguably the most important concepts in OOP. C++ compiler will generate suitable copy constructor and assignment for you under most of the circumstances. In Java it the opposite - you need to implement copy control most of the time, because anything but primitive types don't know how clone themselves.4) Objects should own their internal variables. Internal variables should be destroyed before their owner is destroyed. In Java everything is owned by garbage collector. You never know who else owns your object, because everything is accessed by reference.
 
User avatar
DevonFangs
Posts: 0
Joined: November 9th, 2009, 1:49 pm

C vs C++ ...

November 10th, 2011, 7:45 pm

Great renorm as usual but pls pls pls not again the c++ v java turf (c++ wins). I invoke a corollary of Godwin's law.
 
User avatar
DevonFangs
Posts: 0
Joined: November 9th, 2009, 1:49 pm

C vs C++ ...

November 10th, 2011, 7:48 pm

QuoteOriginally posted by: renormLinus is a kernel guru. Maybe he doesn't need C++ to get things done, but most people can't write kernels. It makes no sense to ask them to code everything in C.That's exactly my point and why I say he's an ass.
 
User avatar
rmax
Posts: 374
Joined: December 8th, 2005, 9:31 am

C vs C++ ...

November 11th, 2011, 8:33 am

I do not harbour any feelings towards my power drill (although one with a battery might be easier), or which screwdriver I use.However I do find then I tend to go for a ratchet screwdriver and I like my claw hammer. But usually this is becasue (i) they are easy to get to in garage (ii) I have used them a lot and hence find them easier to use rather than getting used to a new tool.There are some things that I would not consider using: trying to hammer in a nail with a screwdriver is not ideal, but I have hammered in little bits of dowel into wood using the end of the screwdriver to save me having to find a hammer. Lazy I know, but you know what, the outcome is the same. The only problem is that sometimes you end up trying to hammer a piece of dowel in, and infact after 15th attempt it would have been quicker to have gone and got the hammer in the first place.
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

C vs C++ ...

November 13th, 2011, 3:46 pm

As far as rants go, I found this one a lot more more entertaining:Mike Acton's "Typical C++ B.S."...have to admit though these did make me smile (the second one could make a nice poster ;])::-)
Last edited by Polter on November 12th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
rmax
Posts: 374
Joined: December 8th, 2005, 9:31 am

C vs C++ ...

November 15th, 2011, 11:45 am

It is a good format for a talk actually. Better than a PPT.
 
User avatar
Cuchulainn
Posts: 22927
Joined: July 16th, 2004, 7:38 am

C vs C++ ...

November 16th, 2011, 9:41 am

I can't get this to work..
Last edited by Cuchulainn on November 15th, 2011, 11:00 pm, edited 1 time in total.