I'm just starting out man. Since I started (see: from the very start), I've learnt how to use if statements / switches, for /while / foreach loops, functions (and passing by reference), arrays, classes and inheritence etc. It's all pretty much identical.
I know how == and === work, C++ doesn't need the latter because of its strong typing. I'm assuming also that PHP doesn't need templates because of its loose typing. Global variables are different, sure, but it's not an enormous difference in terms of how it's going to effect the language. No namespaces, right, but again I'm talking about everything I've learnt so far.
If you've been a programmer for years and years then I'm pretty sure that this thread looks hilarious. Again though, I'm only saying that the things I listed at the start of this post are all I've learnt so far and are identical to what I've learnt in C++. You could probably say it's the same as any other programming language too, my point is that I'm surprised at how similar the logic is between different languages.
Sorry, not trying to rag on you or anything :-) My point isn't that there are no similarities (you're correct - there are many, especially
on an abstract level where you deal with the general flow of logic etc.) but that the similarities aren't as important as they may look.
Consider it the perspective of many long years of learning new languages - certainly not some kind of judgment of your position. To be fair a lot of the really significant differences between most languages (imperative ones at least) are very hard to appreciate without
years of experience and lots of languages under your belt.
Where you're at is a perfectly legitimate position. Here's a better way to drive at what I'm saying: Spanish and Italian have a few words in common, and a bit of grammatical structure in common. If you're 3 weeks into learning both languages, with just a small vocabulary and a little bit of sentence structure to work with, you would be correct in observing that they have a lot of superficial similarities. (After all, both are
Romance languages, so that stands to reason.) However, as you get further along, don't be surprised if your opinion on how similar they are starts to change :-)
Anyways, probably enough harping on that. Here's the important part of why I bring this up at all: once you start noticing the differences between languages beyond syntax and basic structural elements (conditions, loops, functions, etc.) you'll be advancing to a new level of programming ability. To accelerate that, see if you can identify some crucial differences between the languages you're learning on your own
, and see if you can think up why those differences might be important and why one language went one direction while the other differs. This is an excellent exercise and will help you a lot (or so I believe). You're already doing well in noting the difference in type systems between C++ and PHP; see if you can find anything else :-)