9 ms·
It's not C/C++. C/C++ is not a language. The project's goal is to write a very simple UNIX-based operating system in C++ (does anyone else smell a contradicti
by clarry 13y ago
It's not C/C++. C/C++ is not a language. The project's goal is to write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?). The code is predominantly C++.
- Houshalter 13y agoI thought it was a reference to this* when I read the title, but after reading them both I'm not sure there is any connection. *http://i.imgur.com/fQ1ST8w.jpg http://i.imgur.com/fQ1ST8w.jpg
- 10098 13y agoplease tell me it was some kind of joke
- Houshalter 13y agoPossibly but I think it's real. I believe it's the same guy from this: http://i.imgur.com/evPQL2S.jpg http://i.imgur.com/evPQL2S.jpg
- 10098 13y agoFound that guy's facebook. It does seem real, I mean the person seems real, but I still really hope they're doing this as a joke or something.
- smnrchrds 13y agoYou are correct. Usually I see this in CVs. It usually means that the person is proficient in C++ but knows a little C as well. But C/C++ can be a language. It could be a code written in C++ but looks more like C than C++. Some people e.g. use character arrays instead of string class, avoid STL as much as possible, don't use object-oriented aspects of the language, etc. The end result uses some C++ libraries, compiles on a C++ compiler but resembles C more than anything. I think it would be appropriate to call it C/C++.
- clarry 13y agoI mostly agree with your observation regarding CVs and what seeing this in one tells about the person who wrote it. Although I like to think that most proficient C++ programmers respect the differences between the two languages and prefer to call C++ what it is, and mention C separately if it needs to be mentioned. I don't think the style of your code should change the name of the language you claim to use. If it doesn't pass through a C compiler, it's not C or "C/anything". Now it is quite possible to use the subsets of C and C++ to write code that conforms to both language specifications and compiles with a compiler for either language. If some project deliberately does this, I don't have an issue with calling it C/C++ to hilight the fact. This however really is quite rare from what I've seen, even if I can name some projects that do make such code (the Opus audio codec is one example). C/C++ still isn't a language though, so I would very much prefer to call it C in a case like this. A different scenario entirely would be a project with parts clearly written in two (or more) different languages, which could happen to be C and C++...
- girvo 13y agoI was looking at an analysis of id Tech's Doom3:BFG engine yesterday, and it's best described as this. The author described it as "C, with classes". Quite interesting, so I went and asked some game devs I know, apparently this is pretty standard!
- adsche 13y agoHm, it doesn't claim it's one language. And it has indeed C code and C++ code...
- alexgartrell 13y ago> write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?) I'm going to use this as an opportunity to champion C++ for systems programming despite the fact that it wasn't really your argument. I feel obligated to do this because I agreed with you for a long time on this but have changed my mind over the past year or two. The argument against C++ as a systems programming language has always been that it gives you too much freedom to hide complexity, but I've written systems code in both C and C++ professionally and it's been my experience that the extra burden of having to write every damn thing over again in C (or use a relatively poorly tested container library, as compared to something like the STL) is not worth the "obvious performance characteristics." I'd further contend that in non-trivial software all perf characteristics are non-trivial, so even though a + b might be doing all kinds of crazy things in C++, you're much more likely to run into problems invoking store_value() which might interact with a number of underlying libraries and system calls. At the end of the day you're hopelessly screwed without profiling and the utility perf works just as well on C++ programs as it does on C programs. Finally, the majority of code in my experience is either slow path or at least not the bottleneck anyway. You can almost always optimize a systems program by making smarter system calls (or hardware invocations), while optimizing CPU is rarely worth it. Even if you're CPU bound, it's likely that it's in doing something like SSL, wherein you're almost definitely wrong to try to jump into a project like OpenSSL with micro-optimizations. With that in mind, why not allow yourself to move faster by creating a std::vector? When you use the proper conventions, it's generally as fast anyway. Just because people can (and have, a lot) misused C++ and created way too much complexity with it doesn't mean that it's not the preferred language in the hands of someone who knows what they're doing. (And yes, it's much harder to learn how C++ works in a meaningful way to avoid these pitfalls, but if it's your job, learn it anyway).
- deleted 13y ago[deleted]
- Peaker 13y agoYou can have generalized containers in C, using the intrusive pattern. For example, Linux's list.h has an intrusive list that is far better than the abysmal std::list from the STL.
- gordaco 13y agoI used to put C/C++ in my curriculum until I realized that my C++ code was getting a lot less "C-like" each year. Now I put it separatedly, which also allows for a nice explanation whenever I'm asked about it in a job interview.