Tagged Questions

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

learn more… | top users | synonyms

6
votes
3answers
643 views

C++ XML Parsing: Suggestions on Approach for Parsing and Storing data

I am looking into developing a C++ application to parse xml (using the rapidxml framework), and I would like some advice on how to approach this. The file I want to parse is a XML game file that ...
0
votes
6answers
6k views

C++: Spaces vs Tabs [duplicate]

Possible Duplicate: Tabs versus spaces—what is the proper indentation character for everything, in every situation, ever? I have always used tabs in all my code (C, C++, python etc.) but I ...
24
votes
3answers
6k views

Why are exception specifications bad?

Back in school some 10+ years ago, they were teaching you to use exception specifiers. Since my background is as one of them Torvaldish C programmers who stubbornly avoids C++ unless forced to, I only ...
6
votes
2answers
618 views

Thread class design?

I have a method like this in my UI code: void MyDialog::OnCommandSaveData() { std::list<MyClass*> objects; service_->GetAll(objects); dataService_->SaveObjects(objects); ...
20
votes
13answers
3k views

Is Systems Hungarian notation still a useful practice? [closed]

I searched the forum, but I couldn't find the answers why it should be avoided, only why it's not a silver bullet. So I don't think this question is a duplicate. Is there a VALID reason why I should ...
5
votes
3answers
494 views

How can we verify that software meets specifications meets requirements?

So we're pretty good at eliciting requirements from our end customers, business division and sales/marketing. We plan projects to add/enhance features to meet those requests and prioritize tasks to ...
3
votes
7answers
6k views

Is there a common capitalization convention in C++? [closed]

I do a lot of work in Python and Java, and both those languages have fairly common (though not universal) conventions on how capitalization should be used in identifiers: both use PascalCase for class ...
1
vote
3answers
587 views

Finding all nearby points in a point cloud

What's the best way to store 3D point cloud data, optimising for time it takes to find all the points in a sphere of 3D space, and also for time it takes to insert new data points into the data set? ...
-1
votes
2answers
281 views

When the shell prints “TBD: create a test thread to print info from the Test object”, what does the 'TBD' stand for?

I did this after 'make' for some C++ files, and then running one of them. Does anyone know what the significance of the acronym 'TBD' is?
2
votes
2answers
426 views

How would you design a generic layer for OpenGL windowing that does not care how the program underneath actually looks like?

The kind of OpenGL windowing that I refer to is like GLFW, GLUT, SDL, etc. Imagine three C++ programs: (ignore syntax) Game A: class Game resize() keyEvent() Game B: resize() keyEvent() ...
12
votes
3answers
2k views

Where to start learning to use the Boost libraries?

Boost has recently become available on the project on which I'm working, and I don't have much experience with it. The library has so many parts and features that it's hard to know where to get ...
6
votes
3answers
4k views

Can anyone recommend a good robot kit for learning C++ robotics programming? [closed]

Preferably something that is a combination of affordable and close to real world robotics programming and will allow me to program it with C++.
2
votes
1answer
163 views

Can anyone recommend a toolchain-agnostic way of declaring and documenting inter-package build dependencies?

I currently have a project at my hand that I'll leave soon (PhD work) and should be left in an understandable form since it is likely to be taken up, though it is not known yet by whom and when. ...
13
votes
7answers
1k views

Does C# experience translate well to C++? [closed]

My programming classes in school were C++, but I ended up working a job doing C# for the last few years. If there was a position that required say 1 or 2 years experience in C++, would my experience ...
35
votes
7answers
3k views

In C++, how much programmer time is spent doing memory management

People who are used to garbage collected languages are often scared of C++'s memory management. There are tools, like auto_ptr and shared_ptr which will handle many of the memory management tasks for ...
10
votes
4answers
1k views

How should I bring my C++ back up to date with modern developments?

How should I bring some very rusty C++ up to date, as I'm sure the language and best practices have evolved? I realise this might be close to being off-topic so let my clarify some details. About 10 ...
5
votes
3answers
701 views

Handling false positives and legacy code warnings in static-analysis of C++ code? [closed]

We have a large "legacy" C++ code base on which no static analysis is run at the moment. Every now and then, we are thinking about at least using cppcheck, maybe via Visual Lint. (I've also briefly ...
20
votes
6answers
3k views

C++ Renaissance - marketing slogan? [duplicate]

Possible Duplicate: What does the latest “C++ Renaissance” mean? Lately, I hear a lot about C++ Renaissance. What is that? C++ is currently undergoing a renaissance. This ...
2
votes
4answers
379 views

What programs emit C++ code and pass it to mainstream compilers?

I suspect there're programs that instead of emitting machine code instead emit C++ code and then start a mainstream C++ compiler to compile it to machine code. I can't find any notable examples ...
55
votes
14answers
10k views

Why would it ever be possible for Java to be faster than C++?

Sometimes Java outperforms C++ in benchmarks. Of course, sometimes C++ outperforms. See the following links: http://keithlea.com/javabench/ ...
6
votes
4answers
3k views

Is there a general rule for when you should use 'make clean' instead of just 'make'?

I am writing a multiple-filed program right now, and apparently running only 'make' (as one would intuitively think needs to be done in most situations) for some reason causes my program to fail. I ...
8
votes
4answers
6k views

Fast algorithm to search a sorted array of floats to find the pair of floats bracketing an input value

I have an array of floats, sorted from smallest to largest, and need to be able to pick out the nearest float greater than or less than a passed input value. This input value is not necessarily ...
28
votes
13answers
3k views

Tutoring students who are struggling with the basics in C++

I am tutoring a few students who are having significant trouble learning the basics of their first programming language: C++. I have known many excellent and bright students who have failed or dropped ...
1
vote
4answers
590 views

Why python library APIs are more intutive than C++ STL library APIs? [closed]

I am not sure whether it is a personal perspective or just a common feeling. I think in most cases, python's API is much more intuitive than C++ STL library APIs. If it is not a subjective ...
7
votes
5answers
4k views

Why do schools (or most schools) teach Java as the intro language? [duplicate]

Possible Duplicate: Why do we study Java at university? This is a question I've wondered a lot as a young developer that just graduated from college. Why do schools teach Java in-depth vs ...
45
votes
16answers
3k views

Strictness in programming methods among Stack Overflow users [closed]

I've been a member of Stack Overflow for a couple of weeks now and have answered questions and read others answers, mostly in C/C++. True, I have learned about some things. For example, undefined ...
18
votes
5answers
1k views

Why C++ cannot adopt D's approach for its concept implementation?

As many of you guys know, concepts, C++'s approach for constraining possible types for a template argument has failed to be included in C++11. I learned that the D programming language 2.0 has a ...
33
votes
17answers
6k views

Teaching C++ to first time high school students: Where to draw the line?

I will be mentoring a team of high school students for the FIRST Robotics Competition, most teams here develop[ their robot software using C++. For many of the students on the team this will be their ...
53
votes
17answers
6k views

What programming problems are best solved by using pointers?

Well, I basically understand how to use pointers, but not how best to use them in order to do better programming. What are good projects or problems to resolve involving the use of pointers so I can ...
5
votes
3answers
851 views

Young C++ student lacking direction

I was hoping for some direction or guidance regarding my C++ learning experience. I have now read two books, from cover to cover, twice. The first was Ivor Horton's Beginning Visual C++ 2010 and ...
3
votes
3answers
478 views

Reasons for C++ Prototyping

I'm a beginning programmer, trying to get a grasp on everything, so pardon the probably mundane theoretical question: I see in a C++ tutorial that prototyping is needed to let the compiler know that ...
32
votes
10answers
3k views

Difference between Idiom and Design Pattern?

What is the difference between idiom and design-pattern? It seems that these terminologies overlap somewhere; where exactly, I don't know. Are they interchangeable? When should I use what? Here is a ...
3
votes
7answers
855 views

Pass in single settings object vs multiple setter methods?

Working with C++. Suppose I have a class BoxFilter. The class is used to filter boxes which have properties such as height, width, depth, weight, etc. The filter might have something like MaxWidth ...
4
votes
2answers
560 views

Is there a term for the error-handling anti-pattern of discarding all available info and just returning failure?

From time to time (unfortunately way too often) I have to fix code such as this: // C++ code bool anyOldFunction(Param p) { try { ... if(some_condition_here) { handleErrorX(); return ...
4
votes
4answers
2k views

Do I need to understand pointers to use C++?

Well, I love C++, I have been using it for a while: I like all the libraries (Allegro, SDL, QT, Ogre, etc.), but I have a problem: I don't understand pointers. Do I really need them ? I just program ...
6
votes
8answers
2k views

C++ to friend or not to friend

I have an object oriented programming with c++ course this semester at college and we were learning about friend functions. I instinctively dislike them for their ability to bypass the security that ...
10
votes
8answers
2k views

What should I expect from a technical evaluation for C++? [closed]

I have been asked to go for a technical test/evaluation for a job as a junior developer, mainly using C++. This is my first test/evaluation, and it is 2 hours long. My C++ is a bit rusty as I have ...
5
votes
4answers
756 views

Why were concepts (generic programming) conceived when we already had classes and interfaces?

Also on stackoverflow.com: I understand that STL concepts had to exist, and that it would be silly to call them "classes" or "interfaces" when in fact they're only documented (human) concepts and ...
30
votes
3answers
9k 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 ...
33
votes
2answers
3k views

How should C++ Unit Test code be organized for maximum Unit Test efficiency?

This question is not about Unit Testing Frameworks. This question is not about writing Unit Tests. This question is about where to put the UT code written and how/when/where to compile and run it. ...
28
votes
6answers
6k 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 ...
6
votes
7answers
1k views

Choosing the type of Index Variables

We use Integer type represent index variables most of the time. But in some situations, we're forced to choose std::vector<int> vec; .... for(int i = 0; i < vec.size(); ++i) .... This ...
2
votes
2answers
925 views

Is there a canonical book on C++/CLI ?

I know quite a lot about C++ but I know very little about .NET. I would like to broaden my horizons. Is there a book out there that's the de-facto standard for describing best practices, design ...
3
votes
3answers
1k views

What is a good workflow for a C++ beginner?

I desire to become a more serious scientific C++ programmer. To do so, I need a consistent style of workflow (e.g., coding, test-driven development, etc.). My question is simply what sort of ...
5
votes
4answers
677 views

Why do we love using i? [duplicate]

Possible Duplicate: Why do most of us use 'i' as a loop counter variable? Maybe this questions seems to be extreamly stupid but I wonder why we use i as variable in most cases in ...
17
votes
5answers
998 views

Advantages of a left to right language syntax

I've been watching an interview with Herb Sutter on Channel9 and he mentioned at the end of the video that left to right language syntax would be on the top on his whishlist for a future C++ ...
54
votes
11answers
10k 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 ...
21
votes
4answers
2k views

Given C++ '11 Was Approved, Does This Change How A C++ Beginner Learns The Language?

I've wanted to learn C++ for awhile and took AP Computer Programming in High School (back when it was C++ and not Java). I enjoy C and just haven't found the time to learn C++ or I'll just fall back ...
2
votes
3answers
549 views

Is C++0x Compatible with C?

I have heard that there will be a lot of changes done in C++ because of the new standard (C++0x). My question is: What are the major changes, and will C++0x be compatible with C++ 98 and C ?
6
votes
1answer
2k views

Parallel programming library? (+ some features)

Note: this is a reposting as the question has been considered non-suitable for the Stack Overflow forum and should have been posted here. The original topic is there. I'd like to talk of ...