Why are developers so afraid of C++?
-
Well, in many cases they are right. I have seen many cases where people overloaded operators and produced counter intuitive code. But of course, that isn't the fault of the language. Programmers run into problems when they use features of any language just because they are the "in thing" or some Joe wrote a paper 10 years ago that said that "such and such is the way to program" without any proof to backup the claim. Certain elements of STL such as functors are a perfect example of this. Take a simple concept as a for loop and produce 20-30 classes and functions all in the name of simplification and bug free code. I have yet to see any proof of these claims. The most important thing to remember while programming is to use the proper tool to solve a problem. Don't worry about if solution uses operator overloading, C strings, gotos, etc. The most important thing is solving the problem. (And solving a problem is a lot more complicated than write code and then ship.) So, my counter question is why do some people always have to use the new and cool features of languages even when they don't apply? [edit] Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Speed of execution usually ranks low down on the list of important things to look at when solving a problem. If code is too obscure or complex to be maintained, then in many cases it is bad code. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
So, my counter question is why do some people always have to use the new and cool features of languages even when they don't apply? Personally, I think this is a far bigger issue. I often think back to a line spoken by the president of the Federation of Planets in Star Trek 6 : "Let us define progress to mean that just because we can do a thing does not mean we must do that thing." I think this is entirely true in a huge variety of contexts.
-
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETEddie Velasquez wrote: I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. I think it's the syntax that scares a lot people. You gotta admit the pointer-to-member syntax is not pretty. Also, the whole pointer, reference, pointer-to-pointer, pointer-to-reference, pointer-dereference syntax can be confusing at times. In addition, the fact that a lot of people just want to take care of the problem with the least amount of fuss. You (the senior developer) give them a nice class that takes care of their problem and they'll be happy to use it without caring about what less-known C++ features it may use to do its thing. Eddie Velasquez wrote: Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Well, more often than not, the senior programmer opts for a better-paying job somewhere else. So the junior programmer is left to fend for himself. That's when it looks like C++ was the wrong approach -- the junior programmer starts blabbing about how it could have all been done in VB. Regards, Alvaro A priest, a minister and a rabbi walk into a bar. The bartender says, "What is this, a joke?"
-
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETI think some of it has to do with thinking they have learned enough C++ so why should they learn more. I guess that would under the lazy category.
-
Well, in many cases they are right. I have seen many cases where people overloaded operators and produced counter intuitive code. But of course, that isn't the fault of the language. Programmers run into problems when they use features of any language just because they are the "in thing" or some Joe wrote a paper 10 years ago that said that "such and such is the way to program" without any proof to backup the claim. Certain elements of STL such as functors are a perfect example of this. Take a simple concept as a for loop and produce 20-30 classes and functions all in the name of simplification and bug free code. I have yet to see any proof of these claims. The most important thing to remember while programming is to use the proper tool to solve a problem. Don't worry about if solution uses operator overloading, C strings, gotos, etc. The most important thing is solving the problem. (And solving a problem is a lot more complicated than write code and then ship.) So, my counter question is why do some people always have to use the new and cool features of languages even when they don't apply? [edit] Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Speed of execution usually ranks low down on the list of important things to look at when solving a problem. If code is too obscure or complex to be maintained, then in many cases it is bad code. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
Tim Smith wrote: Take a simple concept as a for loop and produce 20-30 classes and functions all in the name of simplification and bug free code. I have yet to see any proof of these claims. Using functors to replace a "simple" for loop is overkill, but when you're writing generic code that can be used with any container of any type (with certain restrictions) for_each, functors and their kind are absolutly necessary. The thing is that sometimes you don't need to write generic code and that when inexperienced screw things up. Tim Smith wrote: Speed of execution usually ranks low down on the list of important things to look at when solving a problem I wasn't using the term "optimal" exclusively in the execution speed sense. Optimal solutions usually give a nice and acceptable balance of speed, ease of maintenance, self explanatory code, etc. Tim Smith wrote: So, my counter question is why do some people always have to use the new and cool features of languages even when they don't apply? Because they're unexperienced.
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NET -
Eddie Velasquez wrote: I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. I think it's the syntax that scares a lot people. You gotta admit the pointer-to-member syntax is not pretty. Also, the whole pointer, reference, pointer-to-pointer, pointer-to-reference, pointer-dereference syntax can be confusing at times. In addition, the fact that a lot of people just want to take care of the problem with the least amount of fuss. You (the senior developer) give them a nice class that takes care of their problem and they'll be happy to use it without caring about what less-known C++ features it may use to do its thing. Eddie Velasquez wrote: Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Well, more often than not, the senior programmer opts for a better-paying job somewhere else. So the junior programmer is left to fend for himself. That's when it looks like C++ was the wrong approach -- the junior programmer starts blabbing about how it could have all been done in VB. Regards, Alvaro A priest, a minister and a rabbi walk into a bar. The bartender says, "What is this, a joke?"
Alvaro Mendez wrote: think it's the syntax that scares a lot people. You gotta admit the pointer-to-member syntax is not pretty. I could almost agree with you on this one, but syntax is just that: syntax. You learn it and it sticks. If I try to read some text written in chinese or arabic I would understand crap. But if I start learning the languages... Alvaro Mendez wrote: Well, more often than not, the senior programmer opts for a better-paying job somewhere else. This is a valid, but exclusivly economic reason. If a company doesn't work hard to keep their top-notch developers, what can you expect of the quality of their sotware even without using C++ to the limit?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NET -
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETI have read a couple C++ books they make pointers and gotos etc as dangerous and it scares people away. Personally as I have used basic C++ more and more I have started using more and more of the advanced stuff. -:suss:Matt Newman:suss: -Sonork ID: 100.11179:BestSnowman Frankly AOL should stick to what it does best: Fooling millions of americans into believing that it, AOL, is the web. -Paul Watson
-
I have read a couple C++ books they make pointers and gotos etc as dangerous and it scares people away. Personally as I have used basic C++ more and more I have started using more and more of the advanced stuff. -:suss:Matt Newman:suss: -Sonork ID: 100.11179:BestSnowman Frankly AOL should stick to what it does best: Fooling millions of americans into believing that it, AOL, is the web. -Paul Watson
Matt Newman wrote: I have read a couple C++ books they make pointers and gotos etc as dangerous and it scares people away Those are the crappy books that follow the Java karma: "You're stupid, you can't understand pointers... You'll never learn... You're stupid, you can't understand pointers... You'll never learn". So lets get rid of pointers! Absurd. :confused:
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NET -
Tim Smith wrote: Take a simple concept as a for loop and produce 20-30 classes and functions all in the name of simplification and bug free code. I have yet to see any proof of these claims. Using functors to replace a "simple" for loop is overkill, but when you're writing generic code that can be used with any container of any type (with certain restrictions) for_each, functors and their kind are absolutly necessary. The thing is that sometimes you don't need to write generic code and that when inexperienced screw things up. Tim Smith wrote: Speed of execution usually ranks low down on the list of important things to look at when solving a problem I wasn't using the term "optimal" exclusively in the execution speed sense. Optimal solutions usually give a nice and acceptable balance of speed, ease of maintenance, self explanatory code, etc. Tim Smith wrote: So, my counter question is why do some people always have to use the new and cool features of languages even when they don't apply? Because they're unexperienced.
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETUsing functors to replace a "simple" for loop is overkill, but when you're writing generic code that can be used with any container of any type (with certain restrictions) for_each, functors and their kind are absolutly necessary. The thing is that sometimes you don't need to write generic code and that when inexperienced screw things up. I would love to see the study of how many of these "generic functors" actually get reused. I once did a once over of my for loops and it was rare I could find instances where a functor would have been reusable. If I have the need for reusable code, it becomes a routine. Also, looking at a lot of the hoops I have seen people jump through to get functors to do what they want, I reject the notion that it is more bug free. ...optimal... This is a case where we agree totally. I am all for the right tool for the right application. Any time you totally reject the old OR the new, you are making a HUGE mistake. (and I don't mean "you" and in you) Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
Matt Newman wrote: I have read a couple C++ books they make pointers and gotos etc as dangerous and it scares people away Those are the crappy books that follow the Java karma: "You're stupid, you can't understand pointers... You'll never learn... You're stupid, you can't understand pointers... You'll never learn". So lets get rid of pointers! Absurd. :confused:
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETDamn straight. :) A new country song, "Don't take my goto away". Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
Matt Newman wrote: I have read a couple C++ books they make pointers and gotos etc as dangerous and it scares people away Those are the crappy books that follow the Java karma: "You're stupid, you can't understand pointers... You'll never learn... You're stupid, you can't understand pointers... You'll never learn". So lets get rid of pointers! Absurd. :confused:
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETEddie Velasquez wrote: "You're stupid, you can't understand pointers... You'll never learn... You're stupid, you can't understand pointers... You'll never learn". That explains why I never finished the book. -:suss:Matt Newman:suss: -Sonork ID: 100.11179:BestSnowman Frankly AOL should stick to what it does best: Fooling millions of americans into believing that it, AOL, is the web. -Paul Watson
-
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETMultiple reasons: 1. C++ is a complex language. Some say it takes 5 years to master. Obviously not every C++ developer is going to know all the features of the language. 2. Sometimes developers are to busy to learn (or lazy) 3. In my experience I often spend more time maintaining code than developing new code. As such it makes more sense to write code that's easy to understand for everyone. Using advanced features can make maintenance more difficult. 4. In order to really learn the more advanced features of a language it helps to have a project where you can apply them on a daily basis. Not every gets to work on such projects. That tends to hinder one's ability to learn the features well.**
Todd Smith
CPUA 0x007 ... shaken not stirred
**
-
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETEddie Velasquez wrote: I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. I don't think it is always a matter of fear, for the most part a C++ programmer should be very cautious about the use of more advanced features. Too many programmers often use advanced features for no good engineering principle but only because they want to use them. All of those features you mention can turn your code into spegetti very quickly. I can understand the mentality of those who promote VB, C#, Java etc as better languages for this very reason. C++ code often becomes far more complex than it needs to be because C++ programmers seem to be incapable of exercising common sense when engineering their code. If you cannot do that then you *should* be programming in VB regardless of how well you think you know C++. "There's a slew of slip 'twixt cup and lip"
-
Some people are just too stupid to use C++, and too comfortable with the subset they know to go on to learn more. I don't get it myself, but there it is. I guess at least these people are not in what would be their ideal environment, adding to the number of VB users. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
Hmmm, now that you COMing hard you will be VBing soon! Best regards, Paul. Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
-
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETWell, having 25 years of programming, with the last 12 of those in C++, I've had to maintain a lot of code. Some of it mine, some of it not. I've seen C++ evolve from C-with-classes to a language that pretty much defines what software development is. I've also taught courses in it for new hires, and trained people on how to work with MFC. I interview people and test them on their coding knowledge and style. So I think that I'm pretty much qualified as knowing C++. I've also had to deal with programmers who insist that macros are the one true path, and point to the MFC message map structure as to why they are godlike. The fact that you cannot debug them properly when something goes horribly wrong (and it does) never bothers them. This is why templates were created. Passing everything as a pointer, and typcasting the living hell out of it is also fine. I know it's a CView that got passed to that CObject fifty functions ago, so I can blindly typecast it back. Sure, always works. No problem. For these people Microsoft has IsKindOf. For the rest of us poor bastards who have to deal with this code we have dynamic_cast, which is portable. Globals are cool. Static globals are even cooler. Putting static global things in with pragmas to force the intializtion order rocks. Never mind it's not portable. Never mind that a new version of the compiler breaks it. Whee! While(1) loops that cover 15 printed pages. In 6 point font. Those are fine. It compiles and runs, right? Ship it! A function that is 9,783 lines long. Even better, I'm a god, who needs a debugger. Every language has "features" that allows you to pull off "wow, cool!" operations. Never mind that nobody other than yourself understands that feature, without looking at it for a while, which means that your geek peerage level rises way up in your current job. Breaking common sense program design is never good. There are books on the subject of coding style. There are linting tools that check for these coding styles. Sadly, nobody seems to read these books or use these tools. They consider using a "feature" of the language a much more "cool" thing than actually writing code that can be mantained without their name being cursed. Software houses spend roughly 30% of their time mantaining old code (this is from my jobs over the years). If code was commented, and strange constructs not used, this could be cut in half. Or more. Instead, we wind up refactoring things like address offsets to class functions that are applied to a reference of a dervied clas
-
Hmmm, now that you COMing hard you will be VBing soon! Best regards, Paul. Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
Paul Selormey wrote: now that you COMing hard you will be VBing soon! Huh? Why? Nish [Signature temporarily down]
-
Paul Selormey wrote: now that you COMing hard you will be VBing soon! Huh? Why? Nish [Signature temporarily down]
Well, the COM consumer world is ruled by VB and Delphi, so you simply cannot afford shipping a product without extensively testing it in VB. I got into VB through the same process :(( But now I like it even though I hate the VB IDE, which makes you feel like you do not know what you are about! You still want to hear more? Best regards, Paul. Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
-
Well, the COM consumer world is ruled by VB and Delphi, so you simply cannot afford shipping a product without extensively testing it in VB. I got into VB through the same process :(( But now I like it even though I hate the VB IDE, which makes you feel like you do not know what you are about! You still want to hear more? Best regards, Paul. Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
Paul Selormey wrote: You still want to hear more? Your comments were interesting to me Paul S. Yesterday I think someone was makin a comment in one of the forums saying that he did not see any performance difference between a COM component developed using ATL and one developed using VB. I'd like to know how true this actually is! Nish [Signature temporarily down]
-
I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. Some argue that some features are so confusing and obscure that they won't use them even if it provides the optimal solution for the problem at hand. Some also argue that the maintenance cost is too big considering that mostly junior developers do maintenance. I can see the point, but a junior developer should always have a senior at hand that can teach him. Sometimes I believe that developers get scared of the C++ myth or are too lazy to try to fully understand the language. What's your opinion?
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETC++ is an incredible throwback. For thirty years we have tried to make languages more readable, logical, and trouble-free. The cost of maintaining code far exceeds the cost of developing it, and one rarely has access to the original developer of a product 5 years after its release. Pascal was the epitome of readable, yet powerful code. C++ takes us back to assembly, but without the clarity and logical structure. Where Pascal screwed up, IMNSHO, was in its failure to adopt the OOP paradigm, and its attempt to ignore the Windows platform. I lay the blame for that on Borland, a company that dropped the ball if ever there was one. Turbo Pascal was one of the best products ever released, but their feeble attempt at OOP was lame, and poorly understood. And its archaic handling of GUI interfaces was inexcusable. For all of its warts, with the introduction of Windows95 - the first usable Windows product - it should have been clear that this was the way of the immediate future. But Borland chose to ignore the obvious winds of change and dropped the ball. As languages go, and I've programmed in a couple of dozen of them, C++ is probably the worst; yet it currently is the most flexible and powerful. I will master it one day, only because beating my head against a wall isn't fun, but I won't enjoy doing so...
-
Matt Newman wrote: I have read a couple C++ books they make pointers and gotos etc as dangerous and it scares people away Those are the crappy books that follow the Java karma: "You're stupid, you can't understand pointers... You'll never learn... You're stupid, you can't understand pointers... You'll never learn". So lets get rid of pointers! Absurd. :confused:
Eddie Velasquez: A Squeezed Devil (Don't you just love that anagram craze?)
Checkout GUIDGen.NETEddie Velasquez wrote: Those are the crappy books that follow the Java karma: "You're stupid, you can't understand pointers... You'll never learn... You're stupid, you can't understand pointers... You'll never learn". So lets get rid of pointers! Absurd. You can say that again! And what about garbage collection? I understand that if you're not careful that you can get memory leaks, but is this REALLY the huge problem that the creators of Java make it out to be?
-
Eddie Velasquez wrote: I wonder why some C++ developers are so afraid to use certain less-known features of C++ like templates, pointers to members, operator overloading, etc. I don't think it is always a matter of fear, for the most part a C++ programmer should be very cautious about the use of more advanced features. Too many programmers often use advanced features for no good engineering principle but only because they want to use them. All of those features you mention can turn your code into spegetti very quickly. I can understand the mentality of those who promote VB, C#, Java etc as better languages for this very reason. C++ code often becomes far more complex than it needs to be because C++ programmers seem to be incapable of exercising common sense when engineering their code. If you cannot do that then you *should* be programming in VB regardless of how well you think you know C++. "There's a slew of slip 'twixt cup and lip"
Stan Shannon wrote: I don't think it is always a matter of fear, for the most part a C++ programmer should be very cautious about the use of more advanced features. Too many programmers often use advanced features for no good engineering principle but only because they want to use them. Yeppers! The use of a $50 feature where a $3 one would have done just as well is counterproductive, in my opinion. I can attest to this because I'm not a very experienced C++ programer, but I'm a veteran developer in other languages. I've been able to write conceptually advanced code in C++ without using any of the more sophisticated;) features of C++, such as STL or pointers to members. And the code I have written has been blazingly fast compared to the other languages I'm experienced in: the many various forms of BASIC. Sure I could probably make the code more generic by pushing the OOP paradigm, or faster by getting more experienced with pointers. This doesn't mean that I'm not interested in learning STL or the other advanced features of the language. It just means that it's not necessary to know 100% of the syntax real estate to solve problems.