Hi..

this is not a "which is better" thread, although if you happen to have a reason for thinking so, please share your thoughts.

First I just want to say that I do not want to have any flame wars or arguments or anything like that. Please keep emotional arguments out of this thread!!

On to my question...

I consider myself to be a mid-level or so PHP developer. I love the web and programming for it, and while I am not bored of PHP (still have things to learn!), I feel it is time to spread my wings a bit.

PHP is fantastic for the web, but now I'm ready to move on to hopefully creating some great software for the desktop as well.

My goals are simple. I want to learn a language that will allow me to do nearly anything I can come up with...I have a particular software aimed at young children that I would like to create.
I want the language to also make me marketable to potential employers, so a possible career in the field is a big consideration.

For now, the learning is for fun and self improvement, and hopefully I will be good enough to have a career at some point.

I have narrowed the options down to Python and C++.

I dabbled a little with both...Python looks like it will be much simpler to learn (not easy, but simpler than C++), even though the syntax will take some getting used to after spending a good bit of time in PHP.

C++ is well, C++. From what I understand, it cant be beat in portability or performance, and is just as versatile (if not more so) than Python.
But it looks like it will be a real challenge to master (not that that scares me off). Looks like a much steeper learning curve, and longer to become proficient at.

I simply want a powerful language that will not restrict me much, if at all, in terms of flexibility (if I want to create an app for the web and import it into my PHP coding, I want that option available to me, for example -- as well as create programs/apps for the desktop).

The only catch is that time is an issue .... I dont have time to learn both, it has to be one or the other.

All these things considered, I would love some thoughtful feedback on which language would be best for me.

Thanks for your time!

Given your restrictions, I'd go with Python. If you don't care too much about getting the absolute highest performance, then Python will allow you more flexibility and (contrary to one of the points you make*) portability. If you identify some parts of your Python script that are really slowing you down, you can write it in C++ and call it from Python.

There are also several good GUI tool kits with Python bindings (such as Qt, GTK ans wxWidgets), which will be easier to get to grips with than their C/C++ counterparts.

Have fun :0)

* C++ can be portable, but you have to work at it. With an interpreted language like Python, you almost get it for free.

...* C++ can be portable, but you have to work at it. With an interpreted language like Python, you almost get it for free.

I think you'll have to clarify your thoughts on this statement. At its core, the C++ language is by its very nature highly portable. That's why it's used in anything from Gaming to Business to Embedded Systems (i.e. robotics). C++ compilers on the other hand, are platform-specific, no different than Python or Java needing a specific interpreter for the target platform (which was probably written in C++ by the way). As long as you write proper code, and use the proper libraries (i.e. no "conio.h" or "windows.h", etc...), it will work on any platform.

What's not portable about the language is third-party libraries. A very large portion of them are platform-specific.

Edited 5 Years Ago by Fbody: n/a

The structure and syntax of PHP and C++ are very similar. Myself, if I were already proficient in PHP, then C++ won't be that difficult to learn, and more useful than Python if you want to get into systems programming. Python is a great tool for building utilities, but for the really heavy lifting, C++ is, IMHO, hands-down a better choice.

Edited 5 Years Ago by rubberman: n/a

Comments
Would have said the same thing, but I don't know Python.
This article has been dead for over six months. Start a new discussion instead.