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

learn more… | top users | synonyms

3
votes
1answer
195 views

Parallel Threading in Multi-Language Software?

I'm developing a software that contain many modules/Daemon running in parallel manner, what i'm looking for is how to implement that, i cannot use Thread because some of those modules/Daemon are ...
6
votes
2answers
2k views

Build automation: Is it usual to use QMake for non-Qt projects?

So, I'm planning to write a C++ library and I want it to be cross-platform, and as this library won't deal with UI and I want it to have as little dependencies as possible, I won't be using Qt ...
3
votes
1answer
707 views

C++ compiler structures such as Virtual method Table etc

I am aware of the C++ Virtual Table which allows dynamic dispatch for doing things at runtime (although if I am honest I am not completely sure of the full list of things it achieves). I am wondering ...
3
votes
4answers
2k views

Is using a bigger buffer useful?

I use buffer for quite a long time when I need to copy a stream or read a file. And every time I set my buffer size to 2048 or 1024, but from my point of view a buffer is like a "bucket" which ...
2
votes
3answers
609 views

introducing pointers to a large software project

I have a fairly large software project written in c++. In there, there is a class foo which represents a structure (by which i don't mean the programmers struct) in which foo-objects can be part of a ...
5
votes
2answers
4k views

C++ Library API Design

I'm looking for a good resource for learning about good API design for C++ libraries, looking at shared objects/dlls etc. There are many resources on writing nice APIs, nice classes, templates and so ...
8
votes
6answers
1k views

Is it OK to mix C and C++ in an interview?

If I am asked in an interview to write down some code, should I completely stick with C++ or is it acceptable to "mix" the two to write easy code as it comes to my mind? I'll explain it: if I'm asked ...
11
votes
7answers
2k views

Does C# give you “less rope to hang yourself” than C++? [closed]

Joel Spolsky characterized C++ as "enough rope to hang yourself". Actually, he was summarizing "Effective C++" by Scott Meyers: It's a book that basically says, C++ is enough rope to hang ...
0
votes
5answers
1k views

Learning basic algorithms - better C or C++? [closed]

I'm studying fundamental algorithms (quicksort, mergesort, binary trees, etc..) and I'm going to re-code every algorithm by scratch to learn how they work. Should I code them in C or C++? I think with ...
3
votes
5answers
736 views

How do you name your personal libraries? [closed]

I'm pretty bad with naming things. The only name I can every generically come up with is 'helper'. Say, if I have a header file that contains helping functions for manipulating paths, I tend to put ...
4
votes
3answers
838 views

Middle tier language for interfacing C/C++ with db and web app [closed]

I have a web application requiring a middle-tier language to communicate between an oracle database and math routines on a Linux server and a flex-based application on a client. I'm not a software ...
4
votes
2answers
2k views

Can a compiled C++11 library (lib,dll,etc.) be linked in older C++ compilers?

Could older C++ compilers (e.g. VS2008 and gcc3.4) link with external libraries written in C++11? My thought is that the C++11 .lib files are just byte code at this stage, and it shouldn't bother the ...
4
votes
4answers
496 views

What are the various branches of the C++ language out there?

Last time I tried to use C++ several years ago I remember having to include different libraries between different IDEs even though I was using the same operating system, which left me somewhat ...
8
votes
6answers
2k views

How can I get more programming experience [closed]

I am going to be a third year computer science student and I have read Head first Java, Head First C, and I am currently reading C++ which is the language that I like the most since it has a good ...
11
votes
4answers
2k views

Object Oriented Programming: getters/setters or logical names

I'm currently thinking about an interface to a class I'm writing. This class contains styles for a character, for example whether the character is bold, italic, underlined, etc. I've been debating ...
5
votes
5answers
458 views

Alternatives for comparing data from different databases

I have two huge tables on separate databases. One of them has the information of all the SMS that passed through the company's servers while the other one has the information of the actual billing of ...
13
votes
4answers
1k views

Is there a different usage rationale for abstract classes/interfaces in C++ and Java

According to Herb Sutter one should prefer abstract interfaces (all pure virtual functions) to abstract classes in C++ to decouple the implementation as far as possible. While I personally find this ...
6
votes
2answers
6k views

Best Way To Bring C++ Into Objective-C Project

For an upcoming XCode iOS project I'm planning on writing my views and view controllers in Objective-C. My model will be provided to me in C++. I am aware of 2 ways of using C++ in an objective-c ...
4
votes
3answers
2k views

distribution of programming languages in embedded systems

I am looking for statistics concerning the distribution of programming languages in the embedded sector. Do you know any good websites, articles or books? I found this as a first reference but am ...
3
votes
5answers
1k views

function pointers are so complex to me

I found this code sample in this answer by Armen Tsirunyan. class MyClass { public: typedef void (*funcPtr)(int, int); MyClass(funcPtr whatToCall) { callme = whatToCall; } ...
7
votes
4answers
1k views

Semi-intelligent “diff” utility

Part of the QA steps required for a project I am tangentially involved with require the person who is responsible to integrate new version of source file to first calculate how many lines have been ...
5
votes
13answers
1k views

Limitations of Polymorphism in statically typed languages

I program mostly in statically typed languages, like C++ and Java. A common strategy employed in languages like these to handle dealing with collections of objects which are related, but which need ...
8
votes
8answers
2k views

Is STL implemented with OO?

There are several design patterns like Adaptor, Iterator implemented in STL. Does that mean STL is implemented with OO concepts? What is the relationship between OO and template parts of C++? I ...
2
votes
1answer
888 views

Using captured non-local variables in C++ closures

On this wikipedia page I have found the following sentence regarding closures in C++11: C++11 closures can capture non-local variables by copy or by reference, but without extending their ...
11
votes
5answers
5k views

Is it practical to abandon STL in C++ development?

I know in some areas (game industry, for example), STL is not recommended. So my question is: is it really a good practice not to use STL in some cases? If so, what's the biggest reasons of not using ...
3
votes
2answers
1k views

Abstracting a zip as a filesystem - C++ [closed]

I would like to access in read and write mode to a zip without decompressing it on disk: what options do I have? I need to perform the usual IO actions reserved for a filesystem like reading, writing ...
0
votes
1answer
329 views

Overloading Operators - C++

I was experimenting with new overloaded operators, I have created one void operator and another one that returns something when it's called: #include <iostream> struct chichachicha{ int ...
4
votes
2answers
221 views

Multiple javaScript libraries | Emerging standards - compare to C++

It seems like there are many different styles to write JavaScript, in fact I've heard that JavaScript is an expressive language. But the point of code is functionality (function) not expression ...
3
votes
7answers
7k views

C++ is easy once you know PHP [closed]

I was at work last week and one of our "lead developers" (who said he has programmed C++ before, but I don't believe him) was talking about C++ and how our team of developers who only know PHP would ...
74
votes
19answers
6k views

Is it ok to replace optimized code with readable code?

Sometimes you run into a situation where you have to extend/improve some existing code. You see that the old code is very lean, but it's also difficult to extend, and takes time to read. Is it a good ...
5
votes
4answers
1k views

Should I put newlines before or after binary operators? [closed]

When you're in Python or Javascript, you should always put binary operators at the end of the previous line, in order to prevent newlines from terminating your code prematurely; it helps you catch ...
3
votes
1answer
532 views

How to unit test with lots of IO

I write Linux embedded software which closely integrates with hardware. My modules are such as : -CMOS video input with kernel driver (v4l2) -Hardware h264/mpeg4 encoders (texas instuments) -Audio ...
5
votes
1answer
837 views

How can uTorrent be multi-platform while keeping such a small binary size?

Nowdays it turned into a bloated client that works in Mac, Linux, and Windows, while still keeping the whole program in a single binary file that weighs only 876 kb, while competitors that use gui ...
-2
votes
1answer
941 views

Code obfuscator for C++

I suspect that obfuscating C++ code will make reverse engineering harder: without meaningful symbol names there will be no hints about modules functions and interactions. Can anyone recommend good, ...
10
votes
7answers
5k views

How to get started in opensource projects and programs [duplicate]

I am interested in starting to learn how to contribute to open source projects and Linux in general. I am a first year B.Sc. Computer Science student this year and we use c++ as our main programming ...
0
votes
3answers
4k views

How to create interest in programming? [closed]

I am student of 3rd year software engineering, and I find myself nowhere in field of programming. I know basics of programming languages like C, C++, Java, Visual Basic, HTML, JAVAScript, CSS and ...
0
votes
0answers
216 views

Which programming language is Curiosity written in? [duplicate]

Possible Duplicate: What is the Mars Curiosity Rover's software built in? I only recently came across an article that stated there was well over 500,000 lines of code in Curiosity and I ...
3
votes
4answers
893 views

strategies to keep tabs of memory leaks in non memory-managed languages

When it comes to non memory managed languages such as C, C++ or Fortran (my case), it becomes increasingly difficult to keep track of memory allocation/deallocation, especially when ownership must be ...
5
votes
10answers
632 views

I'm at a crossroads with programming and theory [closed]

I bought "Beginning C++ Through Game Programming" yesterday to start learning about C++ and programming. I'm going on hour 33, and I can't seem to put this book down. I was talking to a friend who's ...
1
vote
1answer
111 views

How to represent association in programs [closed]

Could someone help me in implementing association in cpp. I am trying to implement a dice game where I have two classes a diegame and a dice.
3
votes
3answers
974 views

Patterns for Handling Changing Property Sets in C++

I have a bunch "Property Sets" (which are simple structs containing POD members). I'd like to modify these property sets (eg: add a new member) at run time so that the definition of the property sets ...
34
votes
9answers
71k views

Comparison of IDEs for C++ and C development on Linux: KDevelop, Eclipse, NetBeans, CodeBlocks and Anjuta [closed]

I'd like to note your experience of full scale IDEs on Linux. I personally work mostly with vim, however other programmers would like to see a real IDE. So I'd like to hear your personal opinion ...
6
votes
3answers
3k views

How should I encapsulate database access?

What are some examples of good class structures used to manage database access? I am a fan of class encapsulation and would prefer the containers (e.g. car) not to perform database tasks. I would ...
21
votes
1answer
3k views

Is C++.Net used extensively?

I am a C++ coder by tradition. Over the last 12 months or so I have been doing a lot of C# coding, and have been pleasantly surprised by C#'s pragmatic approach (once I stopped trying to code it as ...
19
votes
5answers
735 views

Does unit testing lead to premature generalization (specifically in the context of C++)?

Preliminary notes I'll not go into the distinction of the different kinds of test there are, there are already a few questions on these sites regarding that. I'll take what's there and that says: ...
-1
votes
2answers
301 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?
14
votes
3answers
4k views

Unit testing C++: What to test?

TL;DR Writing good, useful tests is hard, and has a high cost in C++. Can you experienced developers share your rationale on what and when to test? Long story I used to do test-driven development, ...
3
votes
4answers
410 views

Does it still make sense to think about effective code on micro scale in C++?

Early in my programming career I was in love with pointer twiddling, lean code, doing everything with as little layers of abstraction as possible and so on. The code was very C like I would say, close ...
6
votes
2answers
336 views

C++ Class Initalization

I'm a python programmer who sees a lot of C++ code but doesn't know the language and there seems to be two ways to initalize a class. I was hoping that someone can tell me the difference. class Point ...
14
votes
3answers
2k views

Why isn't the arrow operator in C++ just an alias of *.?

In c++, the * operator can be overloaded, such as with an iterator, but the arrow (->) (.*) operator does not work with classes that overload the * operator. I imagine that the preprocessor could ...