Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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 workflow should I consider? I am familiar with Linux and Mac, and prefer to use free tools like cppcheck, valgrind, g++, etc. I prefer to use Qt and Boost within my programming toolbox, and I am considering using mock objects (either Google Mock or MockPP) within the TDD. I typically use vim for my editor.

In essence, should I do something like the following:

TDD -> code -> cppcheck -> valgrind -> debug -> repeat until ready to use profilers and coverage mechanisms

or, should I pursue some other way? I realize that the opinions will vary, and I also understand that I must first take the time to think through the process and document my thoughts whether written or UML before coding, and I also know that I should document the code as I step write the code.

Any and all thoughts will be appreciated.

share|improve this question

migrated from stackoverflow.com Aug 21 '11 at 22:39

This question came from our site for professional and enthusiast programmers.

2  
Your workflow is fine. There isn't a "set" way to develop. You have all the main steps (and additional ones as well.) If it works for you, keep doing it! –  Starkey Aug 21 '11 at 22:39
1  
Throw in "take a break" somewhere in there too. Too many programmers waste hours trying to fix an issue when taking a 15 minute break will be much more beneficial to them. –  BlackJack Aug 21 '11 at 23:20
2  
For a C++ beginner, an "ask for a code review" should be added now and then. –  Sjoerd Aug 22 '11 at 2:28

3 Answers 3

You forgot something ... thinking. Programmers don't do enough thinking.

Think -> Design -> TDD -> code -> Think again -> cppcheck -> valgrind -> debug -> repeat until ready to use profilers and coverage mechanisms -> Think some more

share|improve this answer

First read C++ annotations. It's free and online.

Honestly I don't think you're best off starting with TDD. TDD is really cool once you realize its true value. And to do that, I believe you've got to have your share of agonizing debugging.

So first you might want to just implement some random programs in C++. Just make-up games and such, or find some people who want things done (and maybe get some money out of it). Take your implementation seriously.

Then, once you think you're really good at programming (at this point, programming for you will probably stand for "making super complex things ultimately - and magically - work), read some books about Testing. Watch some GoogleTechTalks about testing.

Good authors you should remember: Robert C. Martin, Michael Feathers, Martin Fowler, Kent Beck. Then search for some videos about clean, testable code by Misko Hevery from Google.

share|improve this answer

Don't fall into the guess & check trap of c++ programming. That is, don't get into a tight edit -> compile (get error) -> edit loop w/o understanding what is going on.

If you don't understand why adding an ampersand or removing parenthesis fixes a compiler error/warning then take the time to understand.

Excellent resource for understanding the idiosyncrasy of c++: http://www.parashift.com/c++-faq/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.