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 these little tasks as quickly as possible.

I used to be of the philosophy of - "use most efficient tool for the task". However, I'm afraid that over time, this means that I won't have a deeper experience and expertise, so recently I've been forcing myself to use C++ (w/ Boost and STL) for everything, even if I could do the task in python or perl much more quickly. I'm hoping that in the long run, this will make me a more productive developer. I hope to reach a level of familiarity that I can do things in C++ as quickly as I can in python (and also have the practice to work on bigger projects that would require C++).

Is this a good strategy towards long-term productivity and deeper skills? Or am I unnecessarily wasting time / torturing myself?

  • 1
    "do things in C++ as quickly as I can in python" -- Good luck. Try a 0815 web application, for instance. Learning another language is certainly a good goal, and won't hurt. But it's not mutually exclusive with choosing appropriate tools - quite the contrary, one big reason learning several languages is good is that none of them is perfect for all tasks. – user7043 Nov 8 '11 at 17:33
  • 1
    there are limits to this practice of course. At the moment many of the programs I write are data analysis pipelines that are at least feasible in any language, but perhaps easier/quicker if I use perl/python. I can still do them in C++ within a reasonable amount of time, but in the short-term it does take more time. The question is if it's worth it in the long-term in terms of both skills, productivity (and possibly career opportunities...) – daj Nov 8 '11 at 17:37
  • Doing things in a less efficient way is a skill I'm glad I haven't mastered. – JeffO Nov 11 '11 at 14:20

Or am I unnecessarily wasting time / torturing myself?

That's what you are probably doing.

A woodworker doesn't spend all day using a chisel to cut out shapes instead of a saw, does he? Programming languages are tools just like libraries and development environments. Writing a big C++ program to perform a job best handled by perl or grep is often a waste of time.

But, don't go overboard on the "best tool for a job" religion. A tool your are very familiar with and enjoy using may well exceed it's drawbacks compared to a "proper" tool that you don't enjoy using.

  • Maybe I didn't quite use the right tone. I actually do enjoy using C++ (especially vs. Perl :) and find it stimulating so that is part of it. – daj Nov 8 '11 at 17:46

I thinks devs often find the grass greener on the other side. There isn't much that can't be theoretically be accomplished in either environment. But, the strengths of C++ become clearer when dealing with performance-intensive problems, while the strengths of scripting become clearer when dealing with breadth-first implementation. At some point, the productivity curves meet, and switchover to C++ makes its case.

Also, C++ is the lingua franca of development for historical reasons, and obviously C++ talks best with C++, so you're likely to encounter it frequently.

Finally, learning both sides is great for perspective, which generally makes one a more versatile and informed developer. So, I think improving your C++ would be a very productive thing for you, and learning something like Python (or Perl, etc) is a great thing for C++ developers to know.

  • Thanks for the insightful perspective. In terms of exposure, I'm sort of past the point of exposure-to-basic-ideas/usage - the question at this point is how to best invest my time/effort now beyond that "exposure" level of familiarity. My feeling is there is more depth to discover in C++ - getting comfortable with STL/Boost and sharpening a coherent coding style, so in part, that's part of the knowledge I'm pursuing by forcing myself to use it all the time. – daj Nov 8 '11 at 18:08
  • Sorry, didn't mean to assume that - I agree with you that there's a lot more depth to discover. I think it is worthwhile to force usage as practice, though I'd temper that if you find yourself working with others who might not be on the same page. Myself, I try to stick with what I know, and venture out a little at a time. I've tried pursuing depth, but found only a small fraction actually sticks with me. I suppose it's a function of ones environment. – Kevin Hsu Nov 8 '11 at 18:33

Using many languages and tools increase the ability of a programmer to think beyond a particular language. If someone sticks to C alone, that person will code strings every time there is a need for a string. Not bad, but counter-productive.
Let me write from a different perspective. I have seen that computer science/engineering students turned programmers approach coding a solution different than others. They do not think of what is available in the language, but start from a generic solution and try to find ways to code it in a language. This is the concept of design before coding.
I believe your question can be answered from the same perspective. Using many different languages and tools to solve a problem enables one to realize there are ways to solve a problem beyond the traditional way, and one tries to find such constructs/libraries in every language. I believe this is an invaluable quality of a programmer that can only be built by working in different languages.


The only way to truly master a language is to use it regularly on real projects. Forcing yourself to use a language for one-offs is great when you are enthusiastic about it, but the novelty usually wears off before you really achieve mastery. Not that just being "familiar" with a language isn't useful in and of itself.


"use most efficient tool for the task" - don't completely throw away this principle. You won't be able to achieve the same level of efficiency in C++ as in Python and Perl, simply because they are high-level languages. But there will be reasons you will want to choose C++ in spite of development efficiency.

But, by all means, do choose C++ over the others for the sake of practicing it. Getting familiar with it is a good start, and won't be a waste of time. But note that there will be limitations to how proficient you can get by writing the C++ equivalent of a script. You'll eventually need to move beyond that to actually get proficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.