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

learn more… | top users | synonyms

19
votes
14answers
3k views

University teaches DOS-style C++, how to deal with it

Half a year ago I had a look at available programming educations. I chose this one because unlike most of the choices: The majority of the courses seemed to be about something concrete and useful; the ...
6
votes
4answers
1k views

Learning Python is good? [duplicate]

Possible Duplicate: Is Python worth learning? Is it a useful tool? Recently I have seen some videos from MIT on computer programming topics. I found it's really worth watching. Especially ...
6
votes
7answers
2k views

How to become a professional web developer from a C/C++ programmer? [closed]

I am currently a high school student and know how to use Pascal and C/C++ to take part in competitions such as the Informatics Olympiad. I have learned data structures and many algorithms to solve ...
5
votes
3answers
616 views

Is it bad idea to use flag variable to search MAX element in array?

Over my programming career I formed a habit to introduce a flag variable that indicates that the first comparison has occured, just like Msft does in its linq Max() extension method implementation ...
1
vote
2answers
210 views

How is this “interface”-like structure/pattern called? [closed]

Let's assume we have an XmlDoc class that contains basic functionality for dealing with an XML data structure and saving/loading data to/from a file. Now we have several subclasses, A, B and C. They ...
5
votes
2answers
1k views

How to do thread management in C++?

We use pthread for thread management in C based systems. pthread is in general compilable by C++ compiler (like g++). However, what are the better ways of abstractions for threads in C++? Also, for ...
53
votes
17answers
5k 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 ...
1
vote
2answers
1k views

Finding header files

A C or C++ compiler looks for header files using a strict set of rules: relative to the directory of the including file (if "" was used), then along the specified and default include paths, fail if ...
5
votes
5answers
790 views

increasing productivity - mastering a language vs. selecting efficient tools

I'm looking for advice from experienced developers on this question. In my work there's a need for a lot of one-off code. It's tempting to just dip into the right python/perl library calls to do ...
3
votes
3answers
753 views

Developing a Project in a Statically Typed Language Entirely in VIM

I've recently started taking Scala to heart (sweet Python, I still love you, but your collections just can't match Scala's), and in doing so am now using IntelliJ IDEA almost entirely for development. ...
3
votes
2answers
2k views

What is the advantage of using map datastructure?

I am a member of some online coding website and today when I submitted a solution in C++, I saw there were much better answers in C++ itself which took considerably less time. The solutions were open ...
5
votes
7answers
1k views

What keywords are important to speedup the code in C++?

I'm porting to C++ and adding a lot of functionality to a numerical application written in Fortran 77. While I hate F77, I have to admit that the thing goes very fast. Now, I'm implementing ...
1
vote
3answers
434 views

Should non-interface code be hidden from the client?

I am working on a library which had several headers that are meant to only be used by the library itself. I also have a few classes and functions in headers that I do not want the client to use. For ...
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 ...
5
votes
8answers
1k views

Why has the rate of programming language popularization slowed down in recent decades? [closed]

If I understand correctly, there was a huge birth of programming languages during the early decades of computing, but then things have stabilized. Basically, why are many universities and industries ...
6
votes
1answer
690 views

Delegation and MetaClass in C++

We have an OOP course at our university, while discussing the concepts I came across MetaClass and Delegation. As far as I know, these don't exist in C++. Could someone give an example by which I can ...
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 ...
9
votes
8answers
6k views

How is C different from C++?

Many people have said that C++ is a completely different language than C, but Bjarne himself has said that C++ is a language that is extended from C hence that is where the ++ comes from. So why does ...
18
votes
6answers
785 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 ...
3
votes
4answers
1k views

Is this a pattern? Should it be?

The following is more of a statement than a question - it describes something that may be a pattern. The question is: is this a known pattern? Or, if it's not, should it be? I've had a situation ...
1
vote
1answer
301 views

Designing Subclasses for an abstract base class in C++

I'm doing a small assignment in C++ where I have to use concepts like virtual functions and inheritance in a domain of my choice. I'm implementing the prototype for a package manager in Linux. I have ...
6
votes
2answers
602 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); ...
4
votes
2answers
166 views

How to keep settings for C++ Unit Test modules in sync with the production code modules?

Note: I'm coming from a Windows / Visual-C++ background. Note: I have already read Michael Feathers' Working Effectively with Legacy Code. Note: Broad question, asking for narrow answers, i.e. while ...
23
votes
3answers
5k 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 ...
0
votes
6answers
5k 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 ...
2
votes
2answers
307 views

Best practice for shared files within multiple unit test fixtures

I was wondering what the general best practice is for when you have multiple unit test fixtures testing different things that use the same file paths. My test files are in a directory tree with ...
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
437 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
5k 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 ...
32
votes
17answers
5k 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 ...
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 ...
2
votes
1answer
161 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. ...
6
votes
3answers
3k 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++.
13
votes
7answers
1k views

Does C# experience translate well to C++?

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 ...
10
votes
4answers
931 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 ...
54
votes
14answers
9k 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/ ...
18
votes
10answers
5k views

Why is Java considered more portable than other languages like C++?

What differs between "writing a specific JRE for each platform" for Java developers and "writing a C++ compiler for each platform" for C++ ones?
4
votes
4answers
706 views

What are the arguments for/against Code Generation?

I'm in a position where we've got some brittle code that constructs SQL-like queries via text concatenation with parameters for inputs. The data source that it queries is fast and scalable but lacking ...
6
votes
4answers
2k 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 ...
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 ...
8
votes
4answers
5k 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 ...
7
votes
4answers
550 views

“Pythonic” equivalent term for code written in modern C++ style? [closed]

There's a lot of good idioms promoted in modern C++. These include RAII and elegant use of boost or STL or a std::algorithm to solve a given problem. Just like you can write C in any language, you ...
1
vote
4answers
543 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 ...
0
votes
1answer
331 views

Using MVP, how to create a view from another view, linked with the same model object

Background We use the Model-View-Presenter design pattern along with the abstract factory pattern and the "signal/slot" pattern in our application, to fullfill 2 main requirements Enhance ...
3
votes
5answers
535 views

Designing for an algorithm that reports progress

I have an iterative algorithm and I want to print the progress. However, I may also want it not to print any information, or to print it in a different way, or do other logic. In an object oriented ...
7
votes
5answers
3k 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 ...
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 ...
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 ...
3
votes
3answers
458 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 ...