Questions about C++, a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

42
votes
13answers
8k views

How to find a programming mentor? [closed]

I decided to learn programming. I've been reading SO for few days, and I think I will start with C++, as I read some articles. I am aware of loops, arrays, program logic and objects a little and I ...
136
votes
15answers
63k views

When to use C over C++, and C++ over C?

I've been introduced to Computer Science for a little over a year now, and from my experience it seems that C and C++ are both considered to be "ultrafast" languages, whereas others such as Python and ...
106
votes
19answers
65k views

Is there any reason to use C++ instead of C, Perl, Python, etc.? [closed]

As a Linux (server side) developer, I don't know where and why should I use C++. When I'm going to performance, the first and last choice is C. When "performance" isn't the main issue, programming ...
39
votes
5answers
23k views

What is the role of C++ today?

Currently I'm an IT student and I'm wondering what is still important in C++ today, what for is it used? I completed basic C++ course in my university but I can't imagine where can I use my knowledge ...
11
votes
12answers
1k views

Is there a good book to grok C++? [closed]

This question got me thinking. I would say I am a pretty experienced C++ programmer. I use it a lot at work, I had some courses on it at the university, I can understand most C++ code I find out there ...
20
votes
22answers
5k views

Is learning how to use C (or C++) a requirement in order to be a good (excellent) programmer?

When I first started to learn how to program, real programmers could write assembly in their sleep. Any serious schooling in computer science would include a hefty bit of training and practice in ...
48
votes
12answers
5k views

Did the developers of Java consciously abandon RAII?

As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom: using (var ...
28
votes
7answers
17k views

Can C++ be used as a server-side web development language?

I'd like to get into web development using C++ as the "scripting language" on the server-side. My server infrastructure is *nix based, so doing web development in C++ on Azure is not applicable and ...
22
votes
3answers
7k views

How could the first C++ compiler be written in C++?

Stroustrup claims that Cfront, the first C++ compiler, was written in C++ (Stroustrup FAQ). However, how is it even possible that the first C++ compiler be written in C++? The code that makes up the ...
44
votes
11answers
42k views

For what reasons should I choose C# over Java and C++?

C# seems to be popular these days. I heard that syntactically it is almost the same as Java. Java and C++ have existed for a longer time. For what reasons should I choose C# over Java and C++?
39
votes
12answers
12k views

What's the benefit of object-oriented programming over procedural programming?

I'm trying to understand the difference between procedural languages like C and object-oriented languages like C++. I've never used C++, but I've been discussing with my friends on how to ...
20
votes
6answers
2k views

How can I learn to write idiomatic C++?

I am a computer science student, and as a result, I was taught C++ as a better version of C with classes. I end up trying to reinvent the wheel whenever a solution to a complex problem is needed, only ...
44
votes
16answers
5k views

Languages on a resume: Is it better to put “C/C++” or “C, C++”?

I'm graduating in a couple of weeks, and my resume (as expected) lists the languages that I've had experience with. Previously I've put "C/C++", however back then I didn't have that much experience ...
201
votes
43answers
14k views

My Dad is impatient with the pace of my learning to program. What do I do? [closed]

So my Dad bought me 5 books on programming (C++, Java, PHP, Javascript, Android) about a month ago. He's an architect and he knows NOTHING about programming. He bought me them because I told him ...
17
votes
5answers
967 views

Is there a measure of code rot? [duplicate]

I'm dealing, again, with a messy C++ application, tons of classes with confusing names, objects have pointers into each other and all over, longwinded Boost and STL data types, etc. (Pause and ...
16
votes
3answers
5k views

Where should I put functions that are not related to a class?

I am working on a C++ project where I have a bunch of math functions that I initially wrote to use as part of a class. As I've been writing more code, though, I've realized I need these math functions ...
2
votes
2answers
3k views

Fastest C++ XML parsing library

I have thousands of .xml files from size 1MB-45MB (no DTDs). I need to parse and further manipulate these XML files before generating separate .xml files with the results of my regex. What the ...
3
votes
5answers
1k views

What is the best method to start understanding BIG project source code? [duplicate]

Possible Duplicate: How do you dive into large code bases? Sometimes before developing new products we need to understand some existing products or existing source code. Sometimes to ...
6
votes
7answers
2k views

Why c++? Where to start? [closed]

I know there was many questions like this one, but please hold on one more. All programming languages I know now are made for web purposes. I've been learning ActionScript, php and a bit of ...
25
votes
8answers
10k views

Are C and/or C++ viable/practical options for web development? [duplicate]

I am proficient in C, and I am learning C++ right now. I always played with websites (HTML/CSS), and I was wondering if it would be viable/practical to create some simple web apps using C and/or C++. ...
10
votes
7answers
957 views

In C and C++, what methods can prevent accidental use of the assignment(=) where equivalence(==) is needed?

In C and C++, it is very easy to write the following code with a serious error. char responseChar = getchar(); int confirmExit = 'y' == tolower(responseChar); if (confirmExit = 1) { exit(0); } ...
18
votes
9answers
1k views

Good design: How much hackyness is acceptable? [duplicate]

Possible Duplicate: Prototyping vs. Clean Code at the early stages I'm right in front of a difficult decision. I have a problem in my codebase (it's in C++), which I could solve in two ...
12
votes
6answers
1k views

Are header files actually good?

I find header files to be useful when browsing C++ source files, because they give a "summary" of all the functions and data members in a class. Why do so many other languages (like Ruby, Python, ...
1
vote
11answers
5k views

Avoid Postfix Increment Operator

I've read that I should avoid the postfix increment operator because of performance reasons (in certain cases). But doesn't this affect code readability? In my opinion: for(int i = 0; i < 42; ...
79
votes
11answers
19k views

What backs up the claim that C++ can be faster than a JVM or CLR with JIT? [closed]

A reoccurring theme on SE I've noticed in many questions is the ongoing argument that C++ is faster and/or more efficient than higher level languages like Java. The counter-argument is that modern JVM ...
53
votes
11answers
8k views

A modern review of Java [closed]

I've been programming for a few years and I began in Java, and in my time I've found many different sources claiming Java to be an inferior language in some way or another. I'm well aware that each ...
12
votes
7answers
5k views

What are some good open source c++ packages to study in order to learn advanced software construction? [closed]

I've heard that you should read 10 times more than you should write. This applies to both literature and source code. Therefore, I'd like to study the best c++ packages we've developed. I'm ...
28
votes
6answers
5k views

What does the latest “C++ Renaissance” mean? [closed]

There's recently some voice about C++ renaissance, among which the most noteworthy one is from Herb Sutter, Chairman of the C++ Standard Committee. You can search for "C++ renaissance" on Google and ...
30
votes
17answers
6k views

How can I feel more confident about my programming skills? [closed]

Programming isn't alien to me. I first starting doing markup (HTML, now please don't laugh at me) when I was 12 and a little bit of BASIC when I was 13 (I knew much about Flowcharts, Pseudocodes at ...
21
votes
4answers
3k views

Why do C++ and Java both use the notion of “reference” but not in the same sense?

In C++ a reference argument to a function allows the function to make the reference refer to something else: int replacement = 23; void changeNumberReference(int& reference) { reference = ...
16
votes
7answers
3k views

Learning C++ properly (not C with classes) [duplicate]

The typical reason I hear to why people bash C++ is that they don't actually know C++, they just know "C with classes", which apparently is different. I am just beginning to learn C++, however, I want ...
14
votes
4answers
1k views

Enhancing the level of my C/C++ code

I have been programming for 3-4 years now and feel I can no longer be called a beginner, but I read some questions on this site and think WTF are they talking about? I feel the same way when I pick up ...
14
votes
2answers
2k views

What's RAII? Examples?

Always when the term RAII is used, people are actually talking about deconstruction instead of initialisation ... I think I have a basic understanding what it might mean but I'm not quite sure. Also: ...
9
votes
3answers
2k views

How long and what type of complexity would have been involved in Chris Sawyer writing most of rollercoaster tycoon in assembler?

From this question, I have another question about... How long and what type of complexity would have been involved in Chris Sawyer writing most of rollercoaster tycoon in assembler? In order to ...
6
votes
4answers
2k views

GO instead of C/C++ with cgo

Is it possible to replace C and C++ with Go + cgo and interface frameworks such as Qt or DirectX with Go? Any potential pitfalls I should be aware of? UPDATE: I see that my question was not precise ...
23
votes
11answers
5k views

I am a beginner. Can I directly start learning C++11? or I have to learn old C++? [closed]

I'm a beginner and have only little knowledge in programming. Would it be good if I directly learn C++ from books which cover new C++11 or should I study through the old best C++ books? Should I ...
21
votes
11answers
1k views

Is pure oop necessary

Please don't direct me to this post: http://stackoverflow.com/questions/1551/how-to-think-in-oo. I have read it and still have no answer. I have programmed c++ for years and was taught that ...
18
votes
6answers
741 views

Does adding unit tests make sense for well-known legacy code?

I'm talking about unit tests in the TDD sense. (Not automated "integration", or what you like to call it tests.) Legacy code as in: (C++) code without tests. (see: Michael Feathers' Working ...
16
votes
7answers
1k views

To rewrite or slowly refactor old C++ project [duplicate]

Our team has recently inherited a relatively large project from another company (~250k lines). It was developed using C++Builder and we intend to port the Ui side to Qt. Most of the Ui code is ...
8
votes
5answers
1k views

What one should look for when choosing a cross-platform C++ GUI library?

As a learning C++ programmer, I am trying to select a GUI framework or library for my own projects. I have some experience with Qt: it's very straightforward, it has a very good documentation, and ...
8
votes
7answers
3k views

Structured programming versus OO programming

I am making a presentation that shows the differences between structural and object oriented programming and I want to illustrate why people need OOP with an example where applying OOP concepts will ...
7
votes
2answers
2k views

How big a problem is Qt's cross-platform GUI? [closed]

I read something on this site saying that Qt's GUI being a big problem that stop programmers from using Qt. They say the problem is that the GUI don't look native, and they are inconsistent. I ...
14
votes
9answers
1k views

Isn't class scope purely for organization? [duplicate]

Isn't scope just a way to organize classes, preventing outside code from accessing certain things you don't want accessed? More specifically, is there any functional gain to having public, protected, ...
9
votes
4answers
1k views

Monitoring C++ applications

We're implementing a new centralized monitoring solution (Zenoss). Incorporating servers, networking, and Java programs is straightforward with SNMP and JMX. The question, however, is what are the ...
8
votes
9answers
2k views

What C++ coding standard do you use? [closed]

For some time now, I've been unable to settle on a coding standard and use it concistently between projects. When starting a new project, I tend to change some things around (add a space there, remove ...
6
votes
3answers
605 views

Avoid having an initialization method

I have this existing code where they have a class and an initialization method in that class. It is expected that once the object of the class is created, they need to call initialize on it. Reason ...
6
votes
11answers
3k views

Learning C, C++ and C# [duplicate]

I'm sure you guys are tired of this question but after wading through hours of similar posts and questions I've really not made any progress to my specific concerns. I was hoping you guys could shed ...
5
votes
1answer
2k views

Observer pattern; knowing *what* changed?

I've created two abstract classes Subject and Observer that define a classic Observer pattern interface. I derive from them to implement the Observer pattern. An observer might look like this: void ...
5
votes
7answers
5k views

When is C a better choice than C++? [closed]

I can't imagine that there's any reason not to use the OOP features of C++. It's is just as fast as C, and - what's more important to me - it's transparent, just as C. (I mean "transparent" that I ...
0
votes
3answers
2k views

How to apply good Object Oriented Design principles in Embedded Systems [closed]

I am a firmware engineer moved from Electrical background to Embedded Systems. I was till now programming in C and never bothered to apply OO principles in my design. Recently I was forced to ...