5 ms·
I'm from the "Modern C++" school. I learned C++ without first learning C. I don't consider myself a C programmer. Of course, I can read and write C code, but I
by alexk7 16y ago
I'm from the "Modern C++" school. I learned C++ without first learning C. I don't consider myself a C programmer. Of course, I can read and write C code, but I would consider it a burden to code without smart pointers, templates and exceptions. How should I answer this poll?
- sonnekki 16y agoI come from a similar background and chose the third from the top. I can read it, but writing would require more education, also known as, documentation.
- hvs 16y agoYou don't know C. Coding in C and C++ has diverged significantly enough that they are two completely different languages. That said, answer #3 or #4 makes sense.
- alexk7 16y agoI said I would consider it a burden to write in pure C, not that I would not be able to do it. I would not need any documentation, but I would scratch my head figuring out how to organize a large program. I would need to write a lot of comments to replace things that do not exist in the language: const-correctness, memory management conventions, type-safe containers, etc.
- msbarnett 16y agoConst correctness has existed in C since 1999. Again, knowing C++, and even being able to constrain yourself to some C-like subset of it, is not the same as knowing C.
- nostrademons 16y ago"How to organize a large program" is a large part of what learning to program in a language means. BTW, const correctness is in C99, and memory management is usually done by writing constructors and destructors like C++ (except that they're real functions, often named stuff like <prefix>_init and _destroy or <prefix>_new and _free) and calling them manually. It's not as elegant as RAII, but if you write short functions with clear logic, you can usually ensure you cover all code paths. Remember that you don't have exceptions to screw up control flow in C. For type-safe containers, I just use void* containers with a comment indicating the intended type, but perhaps more experienced C programmers have a better system. Remember that Java didn't have type-safe containers until Java5, and honestly ClassCastException was a fairly rare error.
- Jun8 16y agoPrecisely! It always is a red flag when new graduates have "proficient in C/C++ " in their resumes. I've found that these people tend to write code in a combination dialect of C and C++ that I call C+.
- ern 16y agoThere was old adage that people who say they code in "C/C++" don't really know either one. This was about a decade ago, I can't recall where I saw it, and don't know if it still a widely held view.
- jrockway 16y agoThe fewer C++ features you use, the more likely it is that you will eventually write a computer program that actually runs.
- albertzeyer 16y agoWhat knowledge about C do you think does someone miss when he is using C++? I have made the experience that a good C++ developer also automatically knows everything about C.
- BrandonM 16y ago> I have made the experience that a good C++ developer also automatically knows everything about C. Not even close in my experience. In college, we used C++ in our intro course. The addition of pass by reference, classes (with constructors and destructors), and the standard library (e.g. std:string) hides a lot of the common paradigms of C, and that's not even mentioning boost. In my experience, people coming from C++ tend to write really bad C. Many of them have a poor understanding of the concept of pointers. Once you get familiar with some good C design patterns, it's pretty easy to write clear, modular C. Knowing C++ is not a very effective measure of ability to use C.
- warmfuzzykitten 16y agoAu contraire, a modern C++ developer probably knows nothing about C. Good C is like good assembly language: dense and performance-obsessed. No objects, no exceptions, no STL, bare bones and riddled with pointer manipulation and macros.
- util 16y agoNo objects = no structs?
- fossuser 16y agoI'm in a similar place, probably the second or third option is the best answer.