ID:75856
 
Well as the title suggests PHP is very similar to DM. I only found this out today as I just started learning PHP, and I find similarities that I don't find in other languages...

Let's start with the loops eh?
dm:
var/i=5
while(i>0)
world<<i
i--

for(i,i>0,i--)
world<<i

do
world<<i
i--
while(i)

Pretty simply stuff eh? Now PHP
<?php
$i=5;
while($i>0)
{
echo $i;
$i--;
}

for($i,$i>0,$i--)
{
echo $i
}

do
{
echo $i
$i--
}
while($i>0)
?>

Don't tell me you don't see similarities!
Along with that, php has;
if's (Usual)
else if
else
switch
ALL the same operators (++,--,|| ect)
Variables, like so $variable = 100
Procs (Known as functions in php)
Lists (all the types, listname[] listname("ahh"=1) ect ect, known as arrays)

While I know I'm nitpicking, it's the closest to DM I've seen, out of C, C++, Linux, Perl, HTML and Torque.

*Shifty eyes*
XxBloody NightmarexX wrote:
Well I know this has nothing to do with similarities but the easiest language to learn would either be Ruby or HTML but the most powerful language in my opinion would be C++.

That's bull.
C++ isn't the most powerful, not by a long shot.
C > C++
Linux > C++
Ruby Basically = Linux, and Linux is NOT easy to learn.
HTML doesn't really qualify as it's not really a PROGRAMMING language >.>
Rushnut wrote:
XxBloody NightmarexX wrote:
Well I know this has nothing to do with similarities but the easiest language to learn would either be Ruby or HTML but the most powerful language in my opinion would be C++.

That's bull.
C++ isn't the most powerful, not by a long shot.
C > C++
Linux > C++
Ruby Basically = Linux, and Linux is NOT easy to learn.
HTML doesn't really qualify as it's not really a PROGRAMMING language >.>

Fail
Err, to be honest with you pretty much every programming language has those "similarities" you've listed. I can list a few just for a start:

C++, C, Ruby, Python, Javascript, etc.

Pretty much all non-calculus-lambda based programming languages have those functions and they look pretty close to each other too.
Rushnut wrote:
That's bull.
C++ isn't the most powerful, not by a long shot.
C > C++
Linux > C++

First off, Linux is many things, but it's not a programming language.

C is as "powerful" as C++, as C forms a subset of C++. C++ is generally more expressive than C in the sense that it allows you to express data structures in a more natural manner, the upshot being less bugs, less obscure algorithm bottlenecks etc. However by "power" I'm going to assume we don't mean expressive power (to which I'd say languages like python fair much better than C), but raw computational power. C++ is as computationally quick as C, if not faster for expressive reasons. I can write C code and run it through both a C compiler and it's C++ counterpart in a given toolset (without externing the code), and both should produce machine code that performs the same. The overhead of most C++ specific features (objects, function overloading etc) is the same if not better than programmer recreated equivalents in C.
Except for the part where DM doesn't use stupid unnecessary symbols everywhere.

They need a version of PHP called PHP-- that's -- the stupid unnecessary symbols. :P Obviously DM works fine without them.
Foomer wrote:
Except for the part where DM doesn't use stupid unnecessary symbols everywhere.

They need a version of PHP called PHP-- that's -- the stupid unnecessary symbols. :P Obviously DM works fine without them.

Horses and courses I guess. Personally I prefer the declarative nature of those symbols in a dynamic language. Mind you, PHP and DM are quite different in syntax and paradigm anyway. DM uses whitespace as syntax, PHP doesn't. DM is inherently OO, PHP is inherently procedural etc etc.
When comparing two pretty generic features that are common in pretty much every language ever, I'd say they would look pretty similar.

I am pretty sure a for loop in C++ looks exactly the same as it does in both DM and C++, except you'd replace the ,s in the for loop with ;s.

Example
var/i=1
for(i=1,i<5,i++)
world << i


Compared to...

int i=1;
for(i=1;i<5;i++){
cout << i << endl;
}
(Although, not being able to use
 tags in comments combined with HTML trying to format everything I say probably will make them not look as they should)
But if I started comparing other things in two languages, the differences would soon become apparent.

As Metamorphman said. All languages and features like this will look similar. I could post 20 examples from 20 different languages, and you'd struggle to identify which was from which language.
But when you compare actual programs, not tiny snippets of code, you'll soon find the differences are pretty major in most cases.
Rushnut wrote:
C++ isn't the most powerful, not by a long shot.

If you had said ASM or straight machine language, you might not've come off as a uninformed retard. As it happens to have ocurred, though...

C > C++

Let me tell you guys, when it comes to the Lamborghini Countach, they have nothing at all on Lamborghinis.

Linux > C++

Let me tell you guys, when it comes to Ubisoft's games, they have nothing at all on Lamborghini Countachs.

Ruby Basically = Linux, and Linux is NOT easy to learn.

This shows such a totality of ignorance in regards to programming that you have basically reached the bottom of the barrel. I suggest you stop talking about anything even marginally related to software. Firstly, Ruby = Linux is a true statement inasmuch as Banana = Coral Reef, in that the similiarity is that you could consider them similiar in an extremely, extremely broad category (both software-related for the former, and both alive in the latter).

Ruby is an interpreted language (written in C, actually), and writing an operating system with it would not be terribly different from writing an operating system in Javascript or Python. Assuming that a programming language is the same as an operating system is just a new level of 100%, Grade-A certified bat shit-insane nonsense.

HTML doesn't really qualify as it's not really a PROGRAMMING language >.>

This is the only thing you've said that's right, and you're still wrong. HTML isn't 'really' a programming language. It's not a programming language at all. It's simply a mark-up language.
Popisfizzy wrote:
Rushnut wrote:
C++ isn't the most powerful, not by a long shot.

If you had said ASM or straight machine language, you might not've come off as a uninformed retard. As it happens to have ocurred, though...

C > C++

Let me tell you guys, when it comes to the Lamborghini Countach, they have nothing at all on Lamborghinis.

Linux > C++

Let me tell you guys, when it comes to Ubisoft's games, they have nothing at all on Lamborghini Countachs.

Ruby Basically = Linux, and Linux is NOT easy to learn.

This shows such a totality of ignorance in regards to programming that you have basically reached the bottom of the barrel. I suggest you stop talking about anything even marginally related to software. Firstly, Ruby = Linux is a true statement inasmuch as Banana = Coral Reef, in that the similiarity is that you could consider them similiar in an extremely, extremely broad category (both software-related for the former, and both alive in the latter).

Ruby is an interpreted language (written in C, actually), and writing an operating system with it would not be terribly different from writing an operating system in Javascript or Python. Assuming that a programming language is the same as an operating system is just a new level of 100%, Grade-A certified bat shit-insane nonsense.

HTML doesn't really qualify as it's not really a PROGRAMMING language >.>

This is the only thing you've said that's right, and you're still wrong. HTML isn't 'really' a programming language. It's not a programming language at all. It's simply a mark-up language.

Even though I don't like being called a retard, but if anyone would know no joke it would be Popisfizzy.
God job catching I was replying to Rushnut, not you (He also considered Linux, THML, and Torque to be programming languages above, too).

And the reason the similiarities are there is because DM is partially based off C, and C has influenced a ridiculous amount of language.
Popisfizzy wrote:
God job catching I was replying to Rushnut, not you (He also considered Linux, THML, and Torque to be programming languages above, too).

And the reason the similiarities are there is because DM is partially based off C, and C has influenced a ridiculous amount of language.


I was simply stating the fact that OUT of all of those, PHP is by far the closest, I don't really know why I put HTML (Or as you said, THML ;) )
Torque is a programming language, It is commonly misconceived to be JUST a game engine...

I find C hardly = DM, and when I said Ruby = Linux, what version of ruby are we talking about? The one which is a fork of Red Hat or some other one?
You can deploy ruby on just about whatever platform you please. PHP is to DM and C is to DM, in that they subscribe to different paradigms. Python is a much closer companion to DM than PHP is.
PHP is a scripting language, DM is not.
Cbgames wrote:
PHP is a scripting language, DM is not.

Well, I'd opted to ignore the huge swathes of technical differences =P. I guess he was just going by syntax, at which PHP is mostly similar (unsurprisingly) to C, and DM is mostly similar to python or ruby.
Rushnut wrote:
and when I said Ruby = Linux, what version of ruby are we talking about? The one which is a fork of Red Hat or some other one?

Ruby is a programming language. Linux is an operating system. Red Hat is a distribution of Linux, which is an operating system. You do not fork an operating system and obtain a programming language.