Question

I've got good experience in Java and web development with some experience in C++ also. Lately, I've been thinking of leaving Java (bored with it) for C++. Then came Python(didn't like Ruby). I find it too good to resist and started using it. But the C++ still stays in my mind.

Now I want to "stick" with one language to be fluent with it.

Python is great for quick programming but its too easy and I fear it would dumb me down. C++ is tougher but I doubt if I should use such a language where more time is wasted in keeping the compiler happy.

Which language should I stick with. Any comments?

Was it helpful?

Solution

I have mostly experience in a few of domain-specific languages and a few general purpose languages (C, C++, Java, Delphi, etc.), and I have no experience with Python (only a general idea of it).

You must not judge languages on a basis of how hard they are. You say you have to consider the fact that you have to spend time debugging code to please the C++ compiler. I'm an experienced C++ programmer, and I can write several thousands of lines of code at a time, then compile and run, and everything works on the first try (well there are a few inevitable typos and stuff, like in any programming). So, that argument really only refers to your skill level in a programming language. I always favour C++ for any projects I have, because it is so effective (for me) to code in this language. That can surely factor in as a pragmatic view that you should program in the language in which you can actually be productive (in the short term).

But, when it comes to learning, you have to steer towards what seems applicable in your domain. I do artificial intelligence for controlling robots, so I need the hardware access and I need the complex programming constructs that OOP, GP and TMP offer. So, the C++ choice is a no-brainer for me. You have to ask what are the common tasks in your domain? Where do they stand on scales like low- vs. high-level, networking vs numerical analysis, user-oriented vs. computationally-oriented? What are the most widely used languages in your field (or the one you would like to get into)?

I also want to point out that, as a Linux user, a setup that seems quite prevalent amongst the open-source developers of the Linux software ecosystem is to implement low-level drivers in C, complex software in C++, and high-level software interfaces and plugins in Python. That's just what I seem to observe in many of the open-source software, and I think it makes sense that it seems to use the best sides of all three languages.. that's why I'm considering starting to learn Python on the side.

OTHER TIPS

I suggest you don't worry about "sticking" with a language and learn to move in and out of whatever is the best solution for your problem.

The best programmers are simply great problem solvers - the particular language doesn't really matter.

I am of the opinion that you don't "leave" a language. It's still in your toolbox, just possibly not used as often. I would recommend looking at it more like:

"i'm thinking of broadening my options by learning a new language."

Just this past week I have worked in C#, Java, Bash, Python and Javascript. When you're looked at as a problem solver, you never know what you'll be asked to help with next month, but you know you'll be doing something...

I'd suggest looking into a more esoteric language, at least for a little while. Write up a small GUI in Smalltalk, or a utility in Common Lisp or Scheme. Don't just try to adapt your Java knowledge to those languages, really try to use the languages the way the Ron Jeffries and Paul Grahams of the world use them.

If you just want to learn something applicable in the job market, then those won't be as good as Python or C++. However, learning languages that are very different from languages that you already know should provide an interesting challenge, and permanently alter the way you think about programming.

I personally keep my main activity on C/C++/Assembly, and explore other languages on the side. This is because my goals are to stay as sharp as possible, whether that be on problem solving part or hardware friendly side. Personally I find it much more exciting to be next to the hardware amongst other things. Also, when you code regularly in the latter languages, managing pointers, memory etc. become natural and intrinsically makes you that much better as a coder and even more so problem solver ;^).

Hope this helps!

It really depends on what kind of work you are planning to do. But, really, most high level programming languages operate on very similar principles. If you understand all the underlying concepts, switching from one language to another is just a matter of changing your syntax.

Still, if you're insistent on sticking entirely with one language, I'm a fan of java. I think you're right that C++ is a little clunky for large tasks. You can probably accomplish anything with java that you can with python, but it trades some of the smoothness of python for a more direct relationship between what you're doing and what's actually going on. (At least, that's my opinion, as someone who has spent a LOT more time using java than using python. Experts in both might disagree with me.)

Dumb programmers are good programmers. I've maintained code of people that is much smarter than me, their code is an unreadable mess. Funnily, the same things happen with people who can't program except that the really smart programmers code actually works.

In both cases it's hard for other people to take over, and at the same time the smart programmer has become bored and are doing something else.

A good programmer writes "dumb", easy to understand code that he can give to somebody else to maintain, so he can go on doing more interesting things instead of maintaining that annoying piece of huge software that is seriously in need of a refactoring.

Programmers should be smart. Code should be dumb.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top