Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
9
votes
3answers
2k views

Creating a web-end for a C++ program

I was wondering what would be the best method for creating a web end for interfacing with a C++ program on the server. At first I simply thought just using shell execution from the web server side ...
5
votes
4answers
2k 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 ...
10
votes
1answer
20k views

Header comment format

I realize that the "header comment" format varies from programmer to programmer, but what would be an example of a "good" header comment?
20
votes
8answers
3k views

Do you read C or C++ compile errors after the first one?

I never understood why C and C++ compilers try to recover from errors and continue parsing. Almost always, the first error generates a stream of bogus errors that will disappear as soon as the first ...
2
votes
5answers
478 views

Senior project environment selection

My 2 friends and I are preparing our senior project idea for next year. I need some of different ideas while deciding the base environment of the project, especially from software developers/engineers ...
16
votes
6answers
5k views

Real-world scenarios for protected methods

Today I noticed that I basically never use protected methods in C++ code, because I rarely feel the need to call non-public methods of a parent. I do use protected in Java in the template method ...
9
votes
1answer
4k views

Is C a regular language?

Are C or C++ regular languages? If not, under which category do we place the programming languages like C/C++, perl, Python?
6
votes
6answers
1k views

Where is the best place to get off my feet in Python programming? [closed]

I have tried to learn C++ and Java before, but the syntax confused me. I definitely will be learning them after, but for now, where is the best place for a guy who has programmed before to learn ...
7
votes
2answers
8k views

Google Chrome Extension Development for Dummies? [closed]

I want to get started writing extensions for Google Chrome. I am a long time C, C++, Delphi, etc. developer for many years with some Java skills. I believe Chrome extensions are written in C++ but ...
41
votes
3answers
111k 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 ...
6
votes
2answers
3k views

Smart Pointers inside class vs Normal Pointers with Destructor

Regarding pointers which are members of classes. Should they be of a smart pointer type or is it enough to simply deal with them in the destructor of the class they are contained in?
7
votes
3answers
449 views

Beginner Trying to Understand Existing Project

I have a project that requires me to control movement of SCARA robot using VC. I am a beginner in programming so I thought of using existing program as my reference. The SCARA robot that I am using is ...
26
votes
11answers
36k 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; i++)...
15
votes
6answers
6k views

How to explain that writing universally cross-platform C++ code and shipping products for all OSes is not that easy?

Our company ships a range of desktop products for Windows and lots of Linux users complain on forums that we should have been written versions of our products for Linux years ago and the reason why we ...
-2
votes
3answers
835 views

web vs desktop? (php vs c++?) [closed]

I need to write a simple file transfer mechanism (that isn't ftp). Firstly, it must have a GUI. Secondly, it must not be dropbox. Third, it may not use any paid libraries, and hopefully, it uses open ...
3
votes
2answers
3k views

Where do I go to hire a freelance programmer? [closed]

I want to hire a programmer freelance to develop a small InDesign plugin, but I have no idea how to go about finding one. Most of the freelance bidding sites are garbage, but aside from finding a few ...
2
votes
3answers
3k views

c++ write own xml parser vs using tinyxml

I am currently in a task to generate an XML file for an srt text file containing timestamps and corresponding text. To generate an exe file which accepts file name input and outputs the relevant XML ...
6
votes
6answers
1k views

In C++, is it a reflection of poor software design if objects are deleted manually?

With the advent of smart pointers, is it a sign of poor design if I see objects are deleted? I'm seeing some software components in our product that people are still doing this. This practice strikes ...
51
votes
9answers
47k views

Why are pointers not recommended when coding with C++?

I read from somewhere that when using C++ it is recommended not to use pointers. Why is pointers such a bad idea when you are using C++. For C programmers that are used to using pointers, what is the ...
39
votes
6answers
65k views

Why can you have the method definition inside the header file in C++ when in C you cannot?

In C, you cannot have the function definition/implementation inside the header file. However, in C++ you can have a full method implementation inside the header file. Why is the behaviour different?
15
votes
7answers
202k views

Game programming : C# or C++? [closed]

I've decided what I really want is to do game programming. So the question is, as a 18 years old who wants to learn self taught programming, what is the most suited programming language between C# and ...
8
votes
3answers
3k views

Detailed C++ book for a programmer already familiar with C and object-oriented programming? [closed]

I know (to some extent) a few languages, including C, Java and Python. I'm also (somewhat) familiar with Scala and Scheme, plus I can read (but not write) x86 Assembly. Say I want to learn C++, what ...
28
votes
9answers
14k views

Why there is no power operator in Java / C++?

While there is such operator - ** in Python, I was wondering why Java and C++ don't have one too. It is easy to make one for classes you define in C++ with operator overloading (and I believe such ...
2
votes
3answers
2k views

Origin of wParam and lParam

Given a standard windows procedure function: LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); Where do the names wParam and lParam come from and what the history ...
34
votes
9answers
156k views

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

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 C+...
29
votes
5answers
16k views

Are C++ templates just a kind of glorified macros?

From different comparisons among C++ templates and C#/Java generics like this one- https://stackoverflow.com/questions/31693/what-are-the-differences-between-generics-in-c-and-java-and-templates-in-c/...
20
votes
3answers
2k 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
10answers
4k views

What is the best aproach for coding in a slow compilation environment

I used to coding in C# in a TDD style - write/or change a small chunk of code, re-compile in 10 seconds the whole solution, re-run the tests and again. Easy... That development methodology worked ...
26
votes
8answers
56k views

c style casts or c++ style casts

So, what do you use? int anInt = (int)aFloat; or int anInt = static_cast<int>(aFloat); // and its brethren And, more importantly, why?
44
votes
5answers
48k views

Best practices for using namespaces in C++ [closed]

I have read Uncle Bob's Clean Code a few months ago, and it has had a profound impact on the way I write code. Even if it seemed like he was repeating things that every programmer should know, ...
6
votes
9answers
2k views

What should a C++ developer expect on an interview at a Rails company? [closed]

I have been working on C++ backend large scale apps for over 5 years. I'm doing TDD, using STL and Boost etc. I decided I need a change and about year ago started learning Ruby, and few months ago I ...
6
votes
6answers
3k 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 ...
3
votes
3answers
2k views

Interop Best Practices: Should I use Static Class, or Normal Classes

I have a front end C# that needs to call a C++ back end. So interop is needed. I have an "interop layer", that converts the C# data structure into C++ structure, and do all the memory freeing grunt ...
12
votes
4answers
7k views

Ways to organize interface and implementation in C++

I've seen that there are several different paradigms in C++ concerning what goes into the header file and what to the cpp file. AFAIK, most people, especially those from a C background, do: foo.h ...
21
votes
7answers
11k 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
12answers
4k views

Is C++ not suitable for OOP? [closed]

I read somewhere in one of the answers to a question here (can't remember which) that C++ is not suitable for object-oriented programming. There was some mentioning that you could make use of its ...
11
votes
9answers
2k views

How important is it that you know the C++ standard?

I did try searching, but I did not see a similar question (either that or my search terminology was incorrect - if so, feel free to close). I am an avid user of SO, and I notice that there are lots ...
145
votes
15answers
30k views

Why did memory-managed languages like Java, Javascript, and C# retain the `new` keyword?

The new keyword in languages like Java, Javascript, and C# creates a new instance of a class. This syntax seems to have been inherited from C++, where new is used specifically to allocate a new ...
5
votes
4answers
5k views

C/C++: Who uses the logical operator macros from iso646.h and why? [closed]

There has been some debate at work about using the merits of using the alternative spellings for C/C++ logical operators in iso646.h: and && and_eq &= bitand & bitor ...
5
votes
11answers
6k 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 ...
37
votes
13answers
32k views

Worst practices in C++, common mistakes [closed]

After reading this famous rant by Linus Torvalds, I wondered what actually are all the pitfalls for programmers in C++. I'm explicitly not referring to typos or bad program flow as treated in this ...
4
votes
6answers
9k views

how to prove the complexity of an algorithm mathematically

I know the fundamental algorithms and it's complexities. for e.g if Binary Search has Complexity O(log n), then how I can mathematically prove this?
26
votes
25answers
46k views

Is C++ suitable as a first language? [closed]

A local college is teaching C++ to first year college students (16 years old) with no prior programming experience. As first programming language, is C++ suitable?
11
votes
9answers
581 views

Studies on code documentation productivity gains/losses

After much searching, I have failed to answer a basic question pertaining to an assumed known in the software development world: WHAT IS KNOWN: Enforcing a strict policy on adequate code ...
8
votes
6answers
10k views

What should I know about C++? [closed]

I've recently started learning C++, and I enjoy it a lot. I've often read it's easier to write bad code in C++ than in most languages, and that it is a lot deeper than what it seems. As I'd like to ...
25
votes
22answers
15k views

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

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 ...
56
votes
15answers
6k views

Why do we have postfix increment?

Disclaimer: I know perfectly well the semantics of prefix and postfix increment. So please don't explain to me how they work. Reading questions on stack overflow, I cannot help but notice that ...
104
votes
14answers
70k views

Why are most browsers developed in C++ [closed]

It seems like most of common web browsers (Firefox, Chrome, Safari) are developed using C++. Whys is that so?
7
votes
6answers
10k 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 ...
21
votes
9answers
47k 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 ...