Page 1 of 2
This ever happen to you?
Posted: Wed Jul 18, 2007 5:20 pm
by Twitch
It seems like every time I go to a C\C++ forum other than this site all the C++ programmers act like It's sin that I'm using C instead of C++ and it going to ruin my thinking if I ever go to a OOP language in the future.I think C++ is a great language just I have always seemed I like C better when I tried to learn them.
Posted: Wed Jul 18, 2007 5:52 pm
by Alboin
One of my favorite quotes:
[quote="Edsger Dijkstra"]
“Object-oriented programming is an exceptionally bad idea which could only have originated in California.â€
Posted: Wed Jul 18, 2007 6:37 pm
by Solidus117
OP: Try C#.
Posted: Wed Jul 18, 2007 6:48 pm
by Twitch
I guess my problems with C++ were when I first started programming I just couldn't understand OPP and was just coding C in C++.Now I have started to read C++ books and I understand it better now but I just seem to like C and understand C a lot more.
Posted: Wed Jul 18, 2007 6:52 pm
by AndrewAPrice
Why not claim it's written in C++ but don't use classes?
Posted: Wed Jul 18, 2007 11:05 pm
by Colonel Kernel
Solidus117 wrote:OP: Try C#.
OP: Try Objective-C.
Posted: Thu Jul 19, 2007 1:10 am
by AndrewAPrice
Colonel Kernel wrote:Solidus117 wrote:OP: Try C#.
OP: Try Objective-C.
Objective-C++
Wikipedia wrote:Objective-C++ is a front-end to the GNU Compiler Collection that can compile source files that use a combination of C++ and Objective-C syntax.
Posted: Thu Jul 19, 2007 5:36 am
by AJ
Hi,
I guess the most desirable thing would be to understand C and C++ as 2 separate entities and pick the most appropriate for each programming problem. For example, while C++ is probably wonderfully suited to programming a window manager, you MMU is probably going to be "C-style" whichever flavour of compiler you use.
The downful of this approach is that you have to be able to completely switch from one programming mindset to the other each time you start a new program
Cheers,
Adam
Re: This ever happen to you?
Posted: Thu Jul 19, 2007 12:35 pm
by Candy
Twitch wrote:It seems like every time I go to a C\C++ forum other than this site all the C++ programmers act like It's sin that I'm using C instead of C++ and it going to ruin my thinking if I ever go to a OOP language in the future.I think C++ is a great language just I have always seemed I like C better when I tried to learn them.
Nearly all C++ programmers haven't a clue what C++ can do but know that the C compiler they used to use now doesn't accept their code anymore. They then conclude (correct but only up to a limit) that they're using C++. They still don't use classes, encapsulation, templates and so on because they're mostly afraid that they'll lose control of what the compiler will do.
Just today somebody came up to me and explained that he wasn't using much of C++ "because it can just call malloc at about any time, even without you using it in your code". I of course took out my Stroustrup and marked the pages for him to read that that's really not true.
If you use classes, encapsulation, templates, libraries and supportive classes & thought methods properly, your code will be 50% smaller and more efficient (assuming you have a project of at least 10-100k lines). Most of all, it'll be clearer, more maintainable and more logical. If you abuse them, your code will be horrendous. Look at C++ as tools that enable you to do what you need to do. If you use tools for what they're for (flyswatter for a fly, screwdriver for a screw, hammer for a nail) they'll do very well. If you abuse tools (hammer for a fly, screwdriver for a nail, flyswatter for a screw) you'll have an incredibly hard time and nobody'll even want to think about maintaining your code. Explain to people that logic and you might get them convinced. Most are too encrusted in their way of thinking to change mindsets enough to be able to use the tools, so the only thing they'll be able to do with them is abuse them.
Re: This ever happen to you?
Posted: Fri Jul 20, 2007 4:22 am
by AJ
Candy wrote:If you abuse tools (hammer for a fly, screwdriver for a nail, flyswatter for a screw) you'll have an incredibly hard time...
You can use a hammer for a screw though - I don't know if the expression is more widespread, but here in England, a hammer can be known as a
Birmingham Screwdriver.
Re: This ever happen to you?
Posted: Fri Jul 20, 2007 10:23 am
by Candy
AJ wrote:Candy wrote:If you abuse tools (hammer for a fly, screwdriver for a nail, flyswatter for a screw) you'll have an incredibly hard time...
You can use a hammer for a screw though - I don't know if the expression is more widespread, but here in England, a hammer can be known as a
Birmingham Screwdriver.
You can use templates for doing functional programming too, so yes, the analogy holds
.
Posted: Sat Jul 21, 2007 3:14 pm
by piranha
[quote]One of my favorite quotes:
Edsger Dijkstra wrote:
“Object-oriented programming is an exceptionally bad idea which could only have originated in California.â€
Posted: Sat Jul 21, 2007 3:21 pm
by Alboin
[quote="piranha"][quote]One of my favorite quotes:
Edsger Dijkstra wrote:
“Object-oriented programming is an exceptionally bad idea which could only have originated in California.â€
Posted: Sat Jul 21, 2007 3:37 pm
by piranha
No, thats OK, I was being bored. And I don't want to yell at anyone who is dead.
Posted: Sun Jul 22, 2007 2:55 am
by Candy
[quote="Alboin"]One of my favorite quotes:
Edsger Dijkstra wrote:
“Object-oriented programming is an exceptionally bad idea which could only have originated in California.â€