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

learn more… | top users | synonyms

4
votes
2answers
220 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
524 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
819 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
935 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
885 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
629 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
943 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 ...
33
votes
9answers
70k 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
729 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
299 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
409 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 ...
1
vote
2answers
640 views

Is C++ really going out of fashion? [closed]

The TIOBE index claims that the popularity of C++ is waning, and is currently way below C and Java. Echoing this claim, a blogger suggested today, that because C++ is going out of fashion, C++ ...
1
vote
2answers
739 views

Nice iterator naming [closed]

How do you name your iterators when you return a begin and an end iterator from a class? Without it sounding clunky, that is. Example: typedef std::vector<Idea> Ideas_Type; ...
1
vote
3answers
1k views

Writing cross-platforms Types, Interfaces and Classes/Methods in C++

I'm looking for the best solution to write cross-platform software, aka code that I write and that I have to interface with different libraries and platforms each time. What I consider the easiest ...
17
votes
10answers
4k views

What are the best practices regarding unsigned ints?

I use unsigned ints everywhere, and I'm not sure if I should. This can be from database primary key id columns to counters, etc. If a number should never be negative, then I will always used an ...
1
vote
3answers
445 views

Is an API in C++ a better alternative to computing directly in SQL?

I need to perform large amounts of computations on data storerd in a busy Microsoft SQL server. Would it be faster if I retrieve the data from the server, perform the computations locally in C++, and ...
3
votes
2answers
185 views

How to find an error in a tcp server application for which there is no source code

I have a c++/cli tcp client application sending a data in a specific format like L,20100930033425093,-5.929958,13.164021 to a main application on port 9000.The main application is actually done by the ...
5
votes
3answers
447 views

Should a standard include header be specified in each file or as a compiler parameter?

I've got a file such as this: #ifndef STDINCLUDE #define STDINCLUDE #include <memory> #include <stdexcept> #endif I want this file to be included in every header file, because I use ...
1
vote
2answers
261 views

Oracle has some very helpful and free code…I think

I found that some of the code that Oracle uses is very useful so I don't have to re-invent the wheel. Given this is at the top of the file where the code in question is: /* * Copyright (c) 1997, ...
2
votes
4answers
640 views

The benefits of using RAII in C++

Suppose I'm a teacher and I want to explain to my students what are the benefits of using RAII in C++: I need a very good example, full of details, but that is easy to understand. Which approach ...
1
vote
2answers
363 views

Can I develop OpenGL ES iPhone simple physics app with Xcode 3 in C++ without a GUI?

Can I develop OpenGL ES iPhone simple physics app with Xcode 3 in C++ without a GUI and Objective-C? So I don't need Cocoa and I don't need Objective-C?
2
votes
3answers
2k views

Can I make a good career with VC++ programming? [closed]

I'm addicted to VC++ since 2008, and I begin to work for my current company from 2011 when I graduated in Mathematics. Now I still love VC++, it is a wonderful programming language. I'm a little ...
3
votes
5answers
968 views

It's ok to study the C++ from a book that only support the 1998 version of standard?

I have this big book that basically covers all the main aspects of the C++, the problem is that is pretty old according to the C++ standards of today, it's ok to use it?
4
votes
2answers
2k views

Any good site that teaches C++? [closed]

I am searching for any good site that teaches C++, that can explain most to all things about it(general) and has a decent active community. About Me: I am new to programming(knows nothing of it, so ...
8
votes
4answers
1k views

Undefined behaviour in Java

I was reading this question on SO which discusses some common undefined behavior in C++, and I wondered: does Java also have undefined behaviour? If that is the case, then what are some common causes ...
1
vote
1answer
210 views

The design of a generic data synchronizer, or, an [object] that does [actions] with the aid of [helpers]

I'd like to create a generic data-source "synchronizer," where data-source "types" may include MySQL databases, Google Spreadsheets documents, CSV files, among others. I've been trying to figure out ...
1
vote
3answers
853 views

How to organize programming exercise [closed]

Due to my bad performance on past job interviews, I decided to perform daily programming exercises out of my work. Currently, I am concentrating on algorithms, design patterns, and unit testing in ...
3
votes
2answers
192 views

Custom graph comparison?

I'm trying to compare two graphs using hash value ( i.e, at the time of comparison, try to avoid traversing the graph ) Is there a way to make a function such that the hash values compared can also ...
1
vote
2answers
449 views

Efficient way to compare scene-graph trees

I'm designing a scene graph system, where it is required to compare two trees. The trees are populated with individual objects, each with varied number of children; and they have a root. Eg: Parent: ...
1
vote
2answers
596 views

For nodejs what are best design practices for native modules which share dependencies?

Hypothetical situation, I have 3 node modules all native, A, B, and C.  A is a utilities module which exposes several functions to javascript through the node interface, in addition it ...
0
votes
1answer
860 views

Updating and organizing class diagrams in a growing C++ project

I am working on a C++ project that is getting bigger and bigger. I do a lot of UML so it was not really hard to explain my work to co-workers until now. Lately I implemented a lot of new features and ...
3
votes
5answers
2k 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 ...
2
votes
2answers
556 views

The best way to have a pointer to several methods - critique requested

I'm starting with a short introduction of what I know from the C language: a pointer is a type that stores an adress or a NULL the * operator reads the left value of the variable on its right and ...
2
votes
3answers
2k views

function works fine without return value in c++

I forgot to write return 'a'; in function and return 0; in main function but its works fine in Code::Blocks. #include <iostream> using namespace std; char show() { cout<<"this is show ...
0
votes
1answer
387 views

Implementing a “state-machine” logic for methods required by an object in C++

What I have: 1 hypothetical object/class + other classes and related methods that gives me functionality. What I want: linking this object to 0 to N methods in realtime on request when an event is ...
3
votes
3answers
1k views

Can coding style cause or influence memory fragmentation?

As the title states, I'd like to know if coding style can cause or influence memory fragmentation in a native application, specifically one written using C++. If it does, I'd like to know how. An ...
5
votes
8answers
1k views

Is there a point to writing in C or C++ instead of C# without knowing specifically what would make a program faster?

I wrote a small library in Python for handling the xbox 360's STFS files to be used on my web applications. I would like to rewrite it for use in the many desktop programs people are writing for 360 ...
10
votes
3answers
5k views

When to use typedef?

I'm a bit confused about if and when I should use typedef in C++. I feel it's a balancing act between readability and clarity. Here's a code sample without any typedefs: int ...