And C, C++, C#, etc...
Printable View
I thought that C++ and C# were //
<!-- is there any body there -->
C started out with /* */. I believe it was C++ that added //. Naturally, the difference is between a single line comment and a block comment. It would be kind of nice if VB would add a block comment, but they haven't, so whatever.
I always read PCP when I see PHP.
Wishful thinking I suppose.
That's how I read it, too. I'm afraid to code in that language unless I get tested.
Interesting that the [php][/php] and [highlight=php][/highlight] format differently...
php Code:
if ("PHP" == "PCP") { echo "You're on the drugs"; } else { echo "You need the drugs"; }
PHP Code:
if ("PHP" == "PCP") {
echo "You're on the drugs";
} else {
echo "You need the drugs";
}
I haven't really done any PHP work, but that looks very similar to JavaScript.
They are both based on C...
My Arduino is programmed in C and its all the same looking.
PHP Code:$something = tacos;
if ($something == "tacos") {
// do something
}
javascript Code:
var something = "tacos"; if (something == "tacos") { // do something }
Arduino
c Code:
String something = "tacos"; if (something == "tacos") { // do something }
I've edited your code. For some reason only PHP and HTML have their own BB code tags.
One thing I never understood, and this goes for older versions of BASIC too, is why in the world would you want to use symbols to represent type names. Like in your example you have:
Why does $ represent a string? It makes no sense to me.PHP Code:$something = tacos;
I was editing it too. As soon as it posted i fixed it. We probably edited it at the same time.
Anyone want to give me $600,000?
I would love to give you $600,000. The only issue is I don't have any money to give away(well $2.77, but that's there to keep me from overdrafting until Friday).
$ was used as a string from early in BASIC. It still seems like a stupid idea, but it is certainly historic.