Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell21-Sep-12 10:21
jschell21-Sep-12 10:21 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti21-Sep-12 12:00
pasztorpisti21-Sep-12 12:00 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell22-Sep-12 8:37
jschell22-Sep-12 8:37 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti22-Sep-12 11:28
pasztorpisti22-Sep-12 11:28 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell23-Sep-12 7:53
jschell23-Sep-12 7:53 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti23-Sep-12 7:59
pasztorpisti23-Sep-12 7:59 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell24-Sep-12 12:34
jschell24-Sep-12 12:34 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti24-Sep-12 15:14
pasztorpisti24-Sep-12 15:14 
Well, up until now we basically havent listed any useful stuff for the OP about C/C++ benefits/defects. We just continued a totally unneded flame war that started from my statement about C/C++ headers so now I'm going to give a random list of some useful stuff about defects without attempting to be comprehensive because that would be too long.

Today it would be quite reasonable to use a "fixed/repaired" version of C without most of its defects - the same is true for C++. Of course no language is perfect but the number of C/C++ defects are unreasonable in a modern widely used general purpose language. There are several obvious bugs just alone in C that are directly inherited by C++. My favorite is: The Most Expensive One-byte Mistake[^]

The simple C language alone allows for a lot of programming errors most of which could be eliminated just by making the language more strict. I link a list of C programming errors that can be committed easily and accidently: http://www.andromeda.com/people/ddyer/topten.html[^]

Previously I mentioned header files that started a dispute. Some people would argue that headers are good because they separate the interface for reading. I think this is rather a personal preference - with todays tools you can esily extract such information on the fly for languages with better design like C# and Java as well where full runtime type information is available in the ide basically all the time. Even if you prefer header files, there are other languages that implement it in a much better way, I would compare C/C++ headers to assembly text file includes (containing full fledged C source code). (My favorite and silently compiling include related bug was when I found an anonymous namespace in a header, imagine what happens in this case...). Declarations in headers are not guaranteed to match cpp content if a mistake is made not to mention hidden dependencies. I would even question the readability of C++ header files that contain not only public/protected stuff but private and implementation details too (inlined functions -most notably templates - and data members are of course separated from actual implementation of the class methods). Headers and macros held back the development of C/C++ diagnostic tools a lot, this is why some modern (younger) languages has much better ide support even today.

Of course C++ inherited almost all mistakes and because of this immediately developed some necessary new ones. It also has its own unnecessary list of mistakes as well.

I would mention something that became immediately evident to me when I started using C++: compile speed is unreasonably slower than that of other languages even if we take the compile time of just individual compilation units in a relatively small or mid-sized project. One good comparison to this was when I used Borland Delphi and its stepbrother C++Builder that has the EXACT SAME ide but with C++ language. The compile times were so annoying in the C++ version that made iterations much worse despite the fact that I was tempted to switch to C++. C++Builder wouldn't be able to compete with Delphi even if we had the choice to use one of the best C++ compilers of the last decade and speed is gold when its about fast iterations and development time. Delphi compiled objectpascal so quickly you didn't even notice it - you modifed code, pressed the debug button, and half or one second later you saw the window of your debugged application to open - this is priceless. My favorite is when someone comes with the resoning that "C++ optimizes quite well, that takes time...". Other compilers optimize as well. This slow compile time has much more todo with reasons listed here: http://www.drdobbs.com/cpp/c-compilation-speed/228701711[^]. Please skip the first 3 links in the article becauase I think that has advertising purposes.

I'm open to any reasoning against the above list.

Another thing I simply can't understand: how does it come that you built large systems and you just say it doesn't matter what langues/tools you are using and most of the time the decisions are subjective. I completely disagree with these two points. I know that sometimes you are told to use XYZ technology becuase the customer wants it for this and that reasons (or just because there is a fashion wave and everybody wants to use XYZ technology to solve a problem beacause now that is cool) but this isn't always the case. In my opinion tools (including dev envs and languages) are very important. Depending on the type of project it often whort investing the time even to develop some additional project spcific tools because in time (and at the same time in cost) it often pays off well. At the same time if you automatize something with tools then you eliminate a lot of human errors that can increase the quality of the product a lot. You mentioned the importance of a regulated development process - I think every company that continues other than garage development has some kind of dev process, but that is another dimension of the problem of cutting development time and providing quality on a completely different level: management. The dev process is the tool of the manager, the language/ide is the tool of the coder. Without properly chosen tools both dev time/cost and quality suffers for sure but on a different level when using a bad software dev process.

modified 24-Sep-12 21:23pm.

GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet25-Sep-12 7:40
ErnestoNet25-Sep-12 7:40 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell25-Sep-12 8:12
jschell25-Sep-12 8:12 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet25-Sep-12 8:41
ErnestoNet25-Sep-12 8:41 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti25-Sep-12 8:20
pasztorpisti25-Sep-12 8:20 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet25-Sep-12 8:27
ErnestoNet25-Sep-12 8:27 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti25-Sep-12 12:29
pasztorpisti25-Sep-12 12:29 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet25-Sep-12 13:29
ErnestoNet25-Sep-12 13:29 
GeneralRe: What makes C and C++ a "good" language? Pin
pasztorpisti25-Sep-12 13:46
pasztorpisti25-Sep-12 13:46 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet25-Sep-12 15:58
ErnestoNet25-Sep-12 15:58 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell26-Sep-12 8:21
jschell26-Sep-12 8:21 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet27-Sep-12 4:00
ErnestoNet27-Sep-12 4:00 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell27-Sep-12 9:41
jschell27-Sep-12 9:41 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell26-Sep-12 8:18
jschell26-Sep-12 8:18 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet27-Sep-12 5:15
ErnestoNet27-Sep-12 5:15 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell27-Sep-12 9:39
jschell27-Sep-12 9:39 
GeneralRe: What makes C and C++ a "good" language? Pin
ErnestoNet27-Sep-12 10:02
ErnestoNet27-Sep-12 10:02 
GeneralRe: What makes C and C++ a "good" language? Pin
jschell28-Sep-12 10:13
jschell28-Sep-12 10:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.