How about using both C++ and C together ? Just because you going to be writing a C program doesnt mean you got to use an old C compiler. C is a subset of C++ so just use only the features of C with what ever C++ compiler you been using. There are some incompatable stuff in C++ with C like use of void pointers but those were taken out of C++ for good reasons because they were unsafe.
Most C++ programers use C and they dont even realize it. When you call rand(), strcmp().. ect all those are C functions. They were left in C++ standard library from C standard library. They were usefull then and are still usefull today. Name conflicts was mentionded so why not use namespaces to avoid them.
I am one of them 19 year olds and C++ was the first language i learned but my interest in programing had led me to read and learn about C also. Those people that dont know the difference between C and C++, chanses are dont know the difference between a set and a map.
Transition from C++ to C.Tips needed.
quote:
Original post by Diodor
Thanks guys, great info !
So, I gather, C is as used and can do anything C++ can do (including deadlines, safety, etc.) And, in C I can focus on learning the actual software engineering instead of the quirks of using the pre-built C++ things.
Anyways, even if C wont be as good for me as I think it will, it will still be a very usefull learning experience. Anybody who thinks C++ is waay better than C probably still has to learn a lot about C (and should, even if he sticks to C++).
Your hubris is astounding.
I''m not going to claim to be the most experienced programmer here, but my experience is the exact opposite of what you seem to be supposing. Let me summarize:
- I''ve coded in C as a hobby since I was about 16--ran a WWIV BBS in high school, registered the software and got the source with it, started making my own little mods and eventually turned to trying to make online games ("doors" they were called at the time).
- Started coding in C as an intern at device company (by device I mean semiconductor). Worked in a lab where I wrote programs to drive automated chip testers that ran on a Unix mainframe. Can claim red badge of courage that I HAVE programmed on a dumb terminal and used the curses library to create windows on an 80x25 text screen
- Switched jobs to a telecommunications company where I wrote software to emulate an embedded controller interfacing a DSP that was running modem code (v.32bis at the time). Written in DOS using Microsoft''s good ole 6.0 C compiler. Used a proprietary operating system (same that the embedded target would use) to operate 6 simultaneous real-time tasks while controlling the phone. There for about 2 years.
- Went overseas to Holland on a 6-month internship with another telecommunications company. Wrote an embedded program to run on a Philips 8-bit CPU that would control an ethernet card. Had to hand-code IP, UDP and ARP protocol stacks. Involved both programming in C and programming an FPGA using schematic capture. Program actually did work, then the development board fried.
So, we''re up to 3 or 3.5 years professional experience in C, mostly embedded systems-type stuff.
- Graduated (thank God), signed on with a local telecommunications company as an engineer. Design, develop, debug test tools on an NT platform. Had never used C++ before, but all tools here are in C++ except for Win NT device drivers, which still use C. Had to learn C++ in about a week. I have never looked back.
Let me repeat: I have never looked back . I beg not to be asked to do any driver code because our compiler doesn''t support C++ and I just can''t even think that way anymore. I guarantee I understand C much better than you do, and I would never go back to it now that I know how to properly use C++.
C++ isn''t right for every app. C is still the thing to use in embedded, although that''s slowly changing as C++ compilers get better (it''s still a young language, y''know). But it''s right for most serious apps. And the problems that develop in large projects are easier solved in C++, just talking about name scope issues alone, nevermind member functions, polymorphism, etc. Sure, a lot of these things can be faked with C. But like a previous poster said, a screwdriver works just fine as a hammer if you''re only talking about one nail.
Feel free to happily go on your way with C, thumbing your nose at the rest of the world like the person who refuses to get a CD player because "I can hear the samples and the quality just sucks". It''s no skin off anyone''s back. But when you get out there, the "real world" as it were, I guarantee you that you will find more doors closed to you than open if you don''t know C++.
Best of luck.
I learned REAL programming in pascal (my self taught basic experience was very limited) .. and it was good and powerfull as soon as I learned the making of functions, procedures, and modules ... then I learned abstract data types ... linked lists ... etc ... then I learned OO ideas ... and used them in pascal ....
Then I changed colleges ... switched to C++ ... and learned it. Then I took ANSI C ... so compatibility, etc ... and I can say this ... When I write C programs (which is rarely, but I do it) ... I use the .cpp file extension and a c++ compiler because I can see NO reason to type silly stuff like:
typedef struct Blah { ... } MyBlah;
instead of
struct MyBlah { ... };
this is just one simple meaningless example of why you should use C++ ... even for non-oo programms ... it does not imposes ANY rules on a C program that will hurt you ... but it lets you mix in C++ specific features when needed ....
here''s another important clue ... quake is written in C for 3 reasons ... 1) that''s what John Carmack knew ... 2) the c++ compilers at the time were atrocious and incompatible ... 3) for the engine to be flexible - he keep it to an API (a set of functions) .. which is just as easily implememnted in C, C++, or Pascal. but look at windows programming ... they used a C API .. because it was the safest easiest way to offer flexible OS services ... then they created MFC a few years later becasue programming windows in C is a nightmare of extra work. Later they learned even more, and developed COM .. which is the basis for ActiveX and DirectX .. etc ... and it is so easy to work with compared to the original system. Better yet, look at BeOS ... the cleanest modern OS in existence (from a programming point of view) ... almost everything but the kernal is provided as C++ classes ... and they are GREAT!
I''ll admit that master programmers can make a well organized wonderful huge program in assemly language .. and it will be better organized than an avergage coders version in C++ ... but I strongly believe that A) a master c++ coder IS a master of C coding B) a master of C coding could easily become a master of Assembly language and C) a master C++ coder can create miraculous designs in C++ in a fraction of the time as in C. And he can make them more robust, easier to understand, and easier to reuse. BUT it is his job to do so ... the language provides the better tool ... but not the better knowledge and or design.
I can offer you modules of my code that allow easy support for INI files, program logging, object serialization, video memory management, etc ... and all of these would be MUCH harder to implement in C in a way that would not interfere with YOUR programming needs ... in C++ they are wrapped in namespaces, and impose strict rules on themselves, so an idiot CANNOT incorectly destroy video memory still in use ... in C ... this would require bending over backwards ...
My advice is simple ... strip your C++ to the minimum ... when in doubt ... do it the C way ... but ask yourself .. is there a C++ technique that would make this EASIER ... not better ... not faster ... not more flexible in the future ... but EASIER right here and now .. to develop .. to test .. to integrate .... and if so ... use the C++ method ....
I think you''ll find that for the first 6 months to year .. you''ll use mostly C .. but with classes ... then in .5-2 years .. you will be using the C++ STL (which is amazingly powerful) C++ I/O (which is easily extended but HARD to learn well) and templates heavily ... not to mention namspaces ... contants ... and my favorite underdog .. function programming ...
most people don''t even know that C++ has built in support for functional programming ... which makes the C practice of using function pointers look like cavemen attempting rocket flight ... take a look at a good C++ book and look up functors, function adapters, binders, etc ... look at the simplicity of the pair template ... and the header functional. give it a second chance.
Then I changed colleges ... switched to C++ ... and learned it. Then I took ANSI C ... so compatibility, etc ... and I can say this ... When I write C programs (which is rarely, but I do it) ... I use the .cpp file extension and a c++ compiler because I can see NO reason to type silly stuff like:
typedef struct Blah { ... } MyBlah;
instead of
struct MyBlah { ... };
this is just one simple meaningless example of why you should use C++ ... even for non-oo programms ... it does not imposes ANY rules on a C program that will hurt you ... but it lets you mix in C++ specific features when needed ....
here''s another important clue ... quake is written in C for 3 reasons ... 1) that''s what John Carmack knew ... 2) the c++ compilers at the time were atrocious and incompatible ... 3) for the engine to be flexible - he keep it to an API (a set of functions) .. which is just as easily implememnted in C, C++, or Pascal. but look at windows programming ... they used a C API .. because it was the safest easiest way to offer flexible OS services ... then they created MFC a few years later becasue programming windows in C is a nightmare of extra work. Later they learned even more, and developed COM .. which is the basis for ActiveX and DirectX .. etc ... and it is so easy to work with compared to the original system. Better yet, look at BeOS ... the cleanest modern OS in existence (from a programming point of view) ... almost everything but the kernal is provided as C++ classes ... and they are GREAT!
I''ll admit that master programmers can make a well organized wonderful huge program in assemly language .. and it will be better organized than an avergage coders version in C++ ... but I strongly believe that A) a master c++ coder IS a master of C coding B) a master of C coding could easily become a master of Assembly language and C) a master C++ coder can create miraculous designs in C++ in a fraction of the time as in C. And he can make them more robust, easier to understand, and easier to reuse. BUT it is his job to do so ... the language provides the better tool ... but not the better knowledge and or design.
I can offer you modules of my code that allow easy support for INI files, program logging, object serialization, video memory management, etc ... and all of these would be MUCH harder to implement in C in a way that would not interfere with YOUR programming needs ... in C++ they are wrapped in namespaces, and impose strict rules on themselves, so an idiot CANNOT incorectly destroy video memory still in use ... in C ... this would require bending over backwards ...
My advice is simple ... strip your C++ to the minimum ... when in doubt ... do it the C way ... but ask yourself .. is there a C++ technique that would make this EASIER ... not better ... not faster ... not more flexible in the future ... but EASIER right here and now .. to develop .. to test .. to integrate .... and if so ... use the C++ method ....
I think you''ll find that for the first 6 months to year .. you''ll use mostly C .. but with classes ... then in .5-2 years .. you will be using the C++ STL (which is amazingly powerful) C++ I/O (which is easily extended but HARD to learn well) and templates heavily ... not to mention namspaces ... contants ... and my favorite underdog .. function programming ...
most people don''t even know that C++ has built in support for functional programming ... which makes the C practice of using function pointers look like cavemen attempting rocket flight ... take a look at a good C++ book and look up functors, function adapters, binders, etc ... look at the simplicity of the pair template ... and the header functional. give it a second chance.
Oh, I''ve done it, I''ve awaken the monster of C vs C++.
Stoffel, thats just lovable : "I''ve coded professional C for 3.5 years and now I use only C++ and thats why I think you should only learn C++ and skip C" Like I said, learning C is good.
Now why I think C will do as good as C++ is a matter of personal belief, were not discussing it here, and, obviously, I''ll see how it turns out. Anyways, from now on, for at least a year, I''ll write C even when C++ could do things better. If for no other reason then for learning.
Thanks for the lengthy reply, I''ll keep it in mind when I run into trouble And btw, I do give a suspicious look to CD''s
Quake3 is written in C too. Linux too. OpenGL too. A couple of years ago when I was all C++, all of these came as a shock to me. Isnt that a good reason to look into things myself ?
Yeah, do it the C way ... huh ? whats the C way ? ... If all you write is C++, how can you know the C way ?
Anyway, lets go back at the "C how-to" talk. How do you handle (or used to handle) errors in C ? Is SEH (structured exception handling) OK ?
Stoffel, thats just lovable : "I''ve coded professional C for 3.5 years and now I use only C++ and thats why I think you should only learn C++ and skip C" Like I said, learning C is good.
Now why I think C will do as good as C++ is a matter of personal belief, were not discussing it here, and, obviously, I''ll see how it turns out. Anyways, from now on, for at least a year, I''ll write C even when C++ could do things better. If for no other reason then for learning.
Thanks for the lengthy reply, I''ll keep it in mind when I run into trouble And btw, I do give a suspicious look to CD''s
Quake3 is written in C too. Linux too. OpenGL too. A couple of years ago when I was all C++, all of these came as a shock to me. Isnt that a good reason to look into things myself ?
quote:
Original post by Xai
My advice is simple ... strip your C++ to the minimum ... when in doubt ... do it the C way ... but ask yourself .. is there a C++ technique that would make this EASIER ... not better ... not faster ... not more flexible in the future ... but EASIER right here and now .. to develop .. to test .. to integrate .... and if so ... use the C++ method ....
Yeah, do it the C way ... huh ? whats the C way ? ... If all you write is C++, how can you know the C way ?
Anyway, lets go back at the "C how-to" talk. How do you handle (or used to handle) errors in C ? Is SEH (structured exception handling) OK ?
May 24, 2001 03:42 AM
quote:
Original post by Xai
most people don''t even know that C++ has built in support for functional programming ... which makes the C practice of using function pointers look like cavemen attempting rocket flight ... take a look at a good C++ book and look up functors, function adapters, binders, etc ... look at the simplicity of the pair template ... and the header functional. give it a second chance.
Sounds interesting, can you give some examples, links ?
I''m quite interested in functional programming however I really doubt c++ would be a good choice to do it in.
Currently I use mostly c and some haskell.
C++ was one of my first languages but I don''t use it anymore. I know about all the good features c++ has and I think they are great so why do I still use c ? SPEED, not the speed of the program itself but the coding speed. I wright c code alot faster than c++ code. I think many people do. I believe that the reason that john carmack wrote his games in c was that he wrote faster in c. What not many everyone know is that he throws away most of the code he writes. He test a lot of ways of doing stuff and then pick the best one.
When I code in c++ I think most of the design but my productivity drops like bomb...
Im mostly interested in algorithms and graphics, and often want to test a thing as fast as possible. I don''t know why but c is simply faster for me, it''s more down to metal. What I''m trying to say is that in c I get things done, fast.
Besides there is a beautiful little programming ide called lcc_win32 which I love.
Please don''t flame me but here is what I think, you may not agree but it''s my opinion, not yours: C is better when you''re testing stuff and c++ is better when you know exactly what to do and how it will look like.
Another thing I don''t like about c++ is that is too complex. I got a record where the c++ board discussed the future about c++ and how they should extend it. And there where people in the board admitting that they didn''t understand all about c++, somtimes simply because there where a lot of things that where not defined by the standard. If people who spend so much time with c++ can''t understand all why should I even try, I''m not very interested in becomming a language guru, I''m not willing to spend all that time.
But yet everyone keeps telling me that I should at least read 5 books to even begin to understand c++. I''d rather read 5 books about algorithms and math instead.
C is so simple and clean and c++ is just a big mess. Even if you think c++ is the better choice I think you still can agree on the above...
I just need a language that works, let me test my ideas, and doesn''t block my creativity.
But I''m a bit tired of people calling me stupid for using c.
I just think my work is more important than what languages I use.
Languages are just tools, they are not important. However a good tool can make your life a lot easier.
But still, I like some features of c++ and I will probably change back to it soon. Currently reading "the c++ programming language" which is very well written and easy to read.
I don''t want to close any doors.
quote:
Original post by Xai
most people don't even know that C++ has built in support for functional programming ... which makes the C practice of using function pointers look like cavemen attempting rocket flight ... take a look at a good C++ book and look up functors, function adapters, binders, etc ... look at the simplicity of the pair template ... and the header functional. give it a second chance.
Sounds interesting, can you give some examples, links ?
I'm quite interested in functional programming however I really doubt c++ would be a good choice to do it in.
Currently I use mostly c and some haskell.
C++ was one of my first languages but I don't use it anymore. I know about all the good features c++ has and I think they are great so why do I still use c ? SPEED, not the speed of the program itself but the coding speed. I wright c code alot faster than c++ code. I think many people do. I believe that the reason that john carmack wrote his games in c was that he wrote faster in c. What not many everyone know is that he throws away most of the code he writes. He test a lot of ways of doing stuff and then pick the best one.
When I code in c++ I think most of the design but my productivity drops like bomb...
Im mostly interested in algorithms and graphics, and often want to test a thing as fast as possible. I don't know why but c is simply faster for me, it's more down to metal. What I'm trying to say is that in c I get things done, fast.
Besides there is a beautiful little programming ide called lcc_win32 which I love.
Please don't flame me but here is what I think, you may not agree but it's my opinion, not yours: C is better when you're testing stuff and c++ is better when you know exactly what to do and how it will look like.
Another thing I don't like about c++ is that is too complex. I got a recording where the c++ board discussed the future about c++ and how they should extend it. And there where people in the board admitting that they didn't understand all about c++, somtimes simply because there where a lot of things that where not defined by the standard. If people who spend so much time with c++ can't understand all why should I even try, I'm not very interested in becomming a language guru, I'm not willing to spend all that time.
But yet everyone keeps telling me that I should at least read 5 books to even begin to understand c++. I'd rather read 5 books about algorithms and math instead.
C is so simple and clean and c++ is just a big mess. Even if you think c++ is the better choice I think you still can agree on the above...
I just need a language that works, let me test my ideas, and doesn't block my creativity.
But I'm a bit tired of people calling me stupid for using c.
I just think my work is more important than what languages I use.
Languages are just tools, they are not important. However a good tool can make your life a lot easier.
But still, I like some features of c++ and I will probably change back to it soon. Currently reading "the c++ programming language" which is very well written and easy to read.
I don't want to close any doors.
Edited by - zel on May 24, 2001 4:45:41 AM
I never said you should skip C. Maybe you''re just having problems grasping a foreign language here. But comments like this:
...are either trolling or just stupidity. I think you''ve gotten all the patronage you deserve on this topic.
quote:
Anybody who thinks C++ is waay better than C probably still has to learn a lot about C (and should, even if he sticks to C++).
...are either trolling or just stupidity. I think you''ve gotten all the patronage you deserve on this topic.
*sigh*
I''m not a troll (maybe a goblin), but stupidity, bad English and confused sentences are no strangers to me.
I admit I was trolling (after rereading my post), but I intended no offence and I apologize.
Well, I''ve said enough stupid things today, time for some silence
Not before I thank you guys again, your answers have been very usefull and most appreciated !
I''m not a troll (maybe a goblin), but stupidity, bad English and confused sentences are no strangers to me.
I admit I was trolling (after rereading my post), but I intended no offence and I apologize.
Well, I''ve said enough stupid things today, time for some silence
Not before I thank you guys again, your answers have been very usefull and most appreciated !
Ok guys ... i was asked what is the "C" way ... and then also told how can you know good C if you only use C++ ...
this is just plain silly ...
there are 2 ways to interpret the "C" way ... either I mean that you use only things available in the C standard as opposed to the C++ standard (use printf and FILE but not streams, no STL etc) or I mean think in terms of a ''structured'' programming paradigm (with it''s focus on flow-of-control) that is natural in C, as opposed to an object-oriented paradigm with it''s focus on binding data structures with it''s related operations.
As for the being good at C while doing only C++ thing ... my reply is simple, how can you NOT be a good C coder doing C++ everyday. If I was just an object-oriented designer and architect, then I may not be able to code well in C ... But as a C++ "programmer" I am here to say that 50-80% of the code I write is in things called "functions" that exist in EVERY structured and object-oriented language .. and are NO different in C++ than C.
When I tell someone to just do things the C way when having trouble in C++ ... here''s what I mean ... I mean that they seem to be more comfortable thinking in a structured way than an object oriented way, and I''m telling them that C++ is a tool ... there is no reason to be bound by programming style rules you haven''t yet grasped and commited to heart. I''m telling them that it''s ok to make your data members public if you want ... it''s ok to just write a function for the algorithm if that''s easier to get it done ... the C++ rules exist to HELP people in general ... not to hinder them.
When I make a new class ... all my data members are public ... that way it takes me not one minute longer to get the prototype running than in C ... and as the program needs become clearer .. and more functions and rules are applied ... all of the members are moved to private or protected ... and even this is not a RULE ... i DO use structures ... but only simple ones ... one''s with no rules for dynamic memory .. one''s that don''t cause crashes if a data member is corrupted - the rules of encapsulation, polymorphism, data hiding ... they must be applied to YOUR programs needs - what I''m saying is the more you use C++ ... the more you will actual use C++ specific stuff ... without wasting time .. it will be QUICKER than the C way ... but only if you decide to use it a piece at a time ... understanding it as you do ... not by following rote rules that you''ve never agreed with.
John carmack is a master of expressing algorithms and mathmatical models in computers using data and functions ... this skill is needed to code a 3D engine in ANY language .. unless your language already has the engine as primatives, and you are working at a higher level.
If you still find yourself supprised that 95% of all API''s and libraries are written in C ... it''s because you fail to understand the relationships in the development community. 95% of these things are not USED in C ... they are provided in a C format ... and accessed from BOTH C and C++ ... more and more it''s C++. Do you not realize that there are no less than 3 primary reasons for this ... 2 of which are still valid:
1. C is compatible with C++ ... so a C library has a larger target market ... especially in the areas of embedded development.
2. There is a standard way to share functions in a C compatable way ... even from C++ ... extern "C" on a function. But there is NO standard cross-tool way to share C++ objects ... they fucked up by not spelling out the name mangling rules in the standard .. because competing compiler vendors have different methods ... so we are reduced to seeking external rules for putting C++ classes in shared libraries - such as COM/ActiveX and CORBA ... which by the way are used widely in every area of corperate america, and provide numerous oportunities to make $60,000-$120,000 / year salaries.
3. C has been around a long time ... and these things take many many years to build up from scratch ... do you not realize that FORTRAN is still used in many areas because people don''t have the resouces to replace all of the libraries they have written in it. Linux has been around for a decade ... and it STILL is not really useful to computer dummies ... Win32 has been around for 6 years and it STILL is not bug free (even though it''s written in C) - C++ has been available for about 15 years, but only widely for about 10, only taught at schools for about 8, and only standard for 3.
About the reading ... a coder NEVER needs to know the entire language and library ... why would he? Do you know ANYONE who knows all of MS Office ... or Photoshoip ... or 3D Studio Max? They are powerfull and widely used because they provide more tools than ONE person needs ... and meet a wide variety of different needs very well. I don''t have to be a power user, nor even very knowledgable to appreciate that Photoshop is better for me than Paint for almost all purposes. Hence C++, even when you only know the basics, can still make your life better ... just constructors, destructors and overloaded operators ... that''s enough to justify the language ... everything else is gravy - but man when you uncover the STL ... you''ll feel like you''ve found heaven. Have you ever heard a Java developer complain ... I wish they didn''t hav built in socket support, cause I don''t know how to use it? Here''s the deal ... get TWO C++ books ... exactly TWO ... one ... a REFERENCE ... to qucikly and easily look up what you need .... and the other ... a learning book (perhaps "C++: From the Ground Up") ... or a book of good practices ... The reference is the ONLY book you have to have ... and you need it for C also ... and you never really "read" it ... just get comfortable with using it. On the side .. at your lesuire ... you can read some greats such as: "Effective C++", and an STL refernce or learning guide ... or stuff like "Design Patterns", "Code Complete", and "Writing Solid Code", the first of which is a general OO design godsend, and the latter two are structured programming handbooks ... for C, C++, Pascal or whatever.
Oh well .. enough on the diatribe ... I like C just fine .. and given a program I''m going to do in 1 week .. i wouldn''t mind doing it ... BUT i''d do it in C++ faster ... guaranteed - because the language has so many pieces that I''d have to write ... built right in.
this is just plain silly ...
there are 2 ways to interpret the "C" way ... either I mean that you use only things available in the C standard as opposed to the C++ standard (use printf and FILE but not streams, no STL etc) or I mean think in terms of a ''structured'' programming paradigm (with it''s focus on flow-of-control) that is natural in C, as opposed to an object-oriented paradigm with it''s focus on binding data structures with it''s related operations.
As for the being good at C while doing only C++ thing ... my reply is simple, how can you NOT be a good C coder doing C++ everyday. If I was just an object-oriented designer and architect, then I may not be able to code well in C ... But as a C++ "programmer" I am here to say that 50-80% of the code I write is in things called "functions" that exist in EVERY structured and object-oriented language .. and are NO different in C++ than C.
When I tell someone to just do things the C way when having trouble in C++ ... here''s what I mean ... I mean that they seem to be more comfortable thinking in a structured way than an object oriented way, and I''m telling them that C++ is a tool ... there is no reason to be bound by programming style rules you haven''t yet grasped and commited to heart. I''m telling them that it''s ok to make your data members public if you want ... it''s ok to just write a function for the algorithm if that''s easier to get it done ... the C++ rules exist to HELP people in general ... not to hinder them.
When I make a new class ... all my data members are public ... that way it takes me not one minute longer to get the prototype running than in C ... and as the program needs become clearer .. and more functions and rules are applied ... all of the members are moved to private or protected ... and even this is not a RULE ... i DO use structures ... but only simple ones ... one''s with no rules for dynamic memory .. one''s that don''t cause crashes if a data member is corrupted - the rules of encapsulation, polymorphism, data hiding ... they must be applied to YOUR programs needs - what I''m saying is the more you use C++ ... the more you will actual use C++ specific stuff ... without wasting time .. it will be QUICKER than the C way ... but only if you decide to use it a piece at a time ... understanding it as you do ... not by following rote rules that you''ve never agreed with.
John carmack is a master of expressing algorithms and mathmatical models in computers using data and functions ... this skill is needed to code a 3D engine in ANY language .. unless your language already has the engine as primatives, and you are working at a higher level.
If you still find yourself supprised that 95% of all API''s and libraries are written in C ... it''s because you fail to understand the relationships in the development community. 95% of these things are not USED in C ... they are provided in a C format ... and accessed from BOTH C and C++ ... more and more it''s C++. Do you not realize that there are no less than 3 primary reasons for this ... 2 of which are still valid:
1. C is compatible with C++ ... so a C library has a larger target market ... especially in the areas of embedded development.
2. There is a standard way to share functions in a C compatable way ... even from C++ ... extern "C" on a function. But there is NO standard cross-tool way to share C++ objects ... they fucked up by not spelling out the name mangling rules in the standard .. because competing compiler vendors have different methods ... so we are reduced to seeking external rules for putting C++ classes in shared libraries - such as COM/ActiveX and CORBA ... which by the way are used widely in every area of corperate america, and provide numerous oportunities to make $60,000-$120,000 / year salaries.
3. C has been around a long time ... and these things take many many years to build up from scratch ... do you not realize that FORTRAN is still used in many areas because people don''t have the resouces to replace all of the libraries they have written in it. Linux has been around for a decade ... and it STILL is not really useful to computer dummies ... Win32 has been around for 6 years and it STILL is not bug free (even though it''s written in C) - C++ has been available for about 15 years, but only widely for about 10, only taught at schools for about 8, and only standard for 3.
About the reading ... a coder NEVER needs to know the entire language and library ... why would he? Do you know ANYONE who knows all of MS Office ... or Photoshoip ... or 3D Studio Max? They are powerfull and widely used because they provide more tools than ONE person needs ... and meet a wide variety of different needs very well. I don''t have to be a power user, nor even very knowledgable to appreciate that Photoshop is better for me than Paint for almost all purposes. Hence C++, even when you only know the basics, can still make your life better ... just constructors, destructors and overloaded operators ... that''s enough to justify the language ... everything else is gravy - but man when you uncover the STL ... you''ll feel like you''ve found heaven. Have you ever heard a Java developer complain ... I wish they didn''t hav built in socket support, cause I don''t know how to use it? Here''s the deal ... get TWO C++ books ... exactly TWO ... one ... a REFERENCE ... to qucikly and easily look up what you need .... and the other ... a learning book (perhaps "C++: From the Ground Up") ... or a book of good practices ... The reference is the ONLY book you have to have ... and you need it for C also ... and you never really "read" it ... just get comfortable with using it. On the side .. at your lesuire ... you can read some greats such as: "Effective C++", and an STL refernce or learning guide ... or stuff like "Design Patterns", "Code Complete", and "Writing Solid Code", the first of which is a general OO design godsend, and the latter two are structured programming handbooks ... for C, C++, Pascal or whatever.
Oh well .. enough on the diatribe ... I like C just fine .. and given a program I''m going to do in 1 week .. i wouldn''t mind doing it ... BUT i''d do it in C++ faster ... guaranteed - because the language has so many pieces that I''d have to write ... built right in.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement