Should I learn C & C++ before learning PHP?

I’ve read on a few sites that a knowledge of C/C++ makes it easier for you to learn PHP. Some even recommended learning a bit of C/C++ before diving into PHP.

What’s your opinion regarding this?

No, there is no need to learn C/C++ before learning PHP. If your goal is to learn PHP then dive into it asap. :slight_smile:
If you had known C it would be advantage now, but definitely there is no need for that.

>> C/C++ makes it easier for you to learn PHP

That is if you already know C/C++ you can probably learn PHP quicker & easier than someone who doesn’t know C/C++

But you don’t need to know C/C++ to learn PHP. There are many programers who started with PHP. Not your older programmers, because PHP hasn’t been around for much more than 10 years. But many people who’ve begun programming within the last 10 years start with PHP, just like many start with Java, and many start with C, and many start with [insert some programming language here].

Anyone that says you should start programming with this or that language is out of their mind with superiority. :wink:

Learning C takes more time, but is ultimately a more complex language. As so, PHP will be easier to learn once you fluently know C. Learning C will also help you appreciate the finer details (memory management et cetera) that PHP doesn’t.

If you EVER plan on using C, you should learn it first. That way learning PHP is easier. If you learn PHP first, then decide to go to C, you’re going to have a much harder time.

Thanks for the advice. One follow-up question. If I do decide to learn C, should I start with regular C then move to C++, or just skip regular C and start with C++?

You can just start with C++, learning C first would be a waste of time in my opinion.

If you do decide to go ahead with that, I really recommend getting a good book on C++. There’s a ton of online tutorials, but I always find I make way better progress with books.

I would forget C/C++ entirely.

If you want to learn something with similar concepts to C++ but more relevant to the web community etc. then go for Java, or if you’re a Microsoft advocate C# in a .NET framework.

Sean

Depends on what you want. For learninig php and webscripting you need nothing but common sense. Php is a simple language designed for non-programmers. However if you want to become a professional programmer, C knowledge is a must.

If I do decide to learn C, should I start with regular C then move to C++, or just skip regular C and start with C++?

(Modern) C++ has virtually nothing in common with C. Learning C is mandatory, further, you have a choice between “heavy” languages (C++, C#, Java) and “lightweight” ones like Python or Ruby. PHP is optional BTW :wink:

To become a professional programmer in general or a professional PHP programmer?
And what do you mean saying a professional programmer? Isn’t he the one that knows binary trees and many more principles of programming generally?

Isn’t knowing programming mean knowing the art of the programming?

Thanks.

P.S. I’m still stuck C? or PHP? - the latter I love.

I think there is no such thing as “professional <any-language> programmer”. Learning new language takes normally from two days to two months, if you know the basics. “Professional programmer” is a person who understands how computers and networks really work, not how they could be “programmed” in some concrete environment.

So to be a Professional PHP programmer you must mostly know how networks work and Web application development methodologies. Am I right?

No :wink:

A “professional programmer” is just someone who makes their living through programming [as opposed to someone who does it as a hobby].

A “professional PHP programmer” is just someone who makes their living through programming in PHP.

A “professional ________” is just someone who makes their living through ________. It is their profession. Yes a word that is hardly used anymore today, but it is where “professional” comes from.

>> I think there is no such thing as “professional <any-language> programmer”

I’m going to have to call you right here. There are plenty of people who make their living by programming in a single language [this doesn’t mean they don’t know or are not learning other languages though].

>> C/C++ makes it easier for you to learn PHP

That is if you already know C/C++ you can probably learn PHP quicker & easier than someone who doesn’t know C/C++

But you don’t need to know C/C++ to learn PHP. There are many programers who started with PHP. Not your older programmers, because PHP hasn’t been around for much more than 10 years. But many people who’ve begun programming within the last 10 years start with PHP, just like many start with Java, and many start with C, and many start with [insert some programming language here].

>> Can I insert the language here “English”?

Learning new language takes normally from two days to two months, if you know the basics.

If you can learn C in 2 months, you should be coming up with new forms of energy or something. NOBODY can learn C in two months, I don’t care who you are.

I learned C and C++ during college and use PHP now for the WEB. I will say that I still learn more about all three languages everyday. Unless you plan on becoming a software engineer that builds software for the *nix platform or something, I would learn PHP and C#.NET. I do think you should learn a 3rd level language like C or Java or C# in addition to a 4th level language like PHP. If you’re just going to be a web developer, then stick to C#, PHP, and maybe a little BASH shell scripting.

By the way, I would assume the person who told you to learn C or C++ told you that because PHP is written in C. That’s what I mean by PHP being a 4th level language.

Simple answer: No.

I think it’s probably a good idea to learn how to program before using PHP. I don’t think PHP is a good language to learn with.

It’s my belief that a good teaching language should be very strict and rigid, and I don’t believe that to be true of PHP, or C.

Most programmers who have had formal training will have studied C at some time or other so they will have at least some experience with C.

If you can learn C in 2 months, you should be coming up with new forms of energy or something. NOBODY can learn C in two months, I don’t care who you are.

Find C a bit difficult? :smiley:

Once you know virtually any other programming language, it is very easy to pick up a new language in no time at all. The basic concept of types, expressions, functions and parameters can be applied to almost any language. My advantage when it came to learning C is that I had lots of experience with other languages so it didn’t take me any time at all to learn it. However I’d argue that it’s not unreasonable for even a beginner to learn C in less that 2 months if he is quick-witted.

I have a feeling that my experience isn’t typical - I’d guess that most people would start with C before learning other languages.

I agree with mmj.

Learning C to learn PHP is certainly not a requirement, per se. But, if you know some C (or most any other programming language, for that matter), then PHP will come more easily. C and PHP are synactically very similar. It’ll go the other way around too.