Page 1 of 1

English-like Language Comparison

Posted: Wed Sep 19, 2012 2:02 pm
by Simon
Hi,
Just watched K Miller's presentation at the Turing festival and wanted to know if there is a text file of the JavaScript vs LC example that I could get? I did see in another video in which LC was compared to many other languages which would be even better.


Thanks,
Simon

Re: English-like Language Comparison

Posted: Sun Sep 23, 2012 1:19 pm
by Simon
OK, did it myself:

Code: Select all

Sort by last name decending:

Mr, Kevin, Miller		Mr, Mark, Waddingham
Mr, Ben, Beaumont		Ms, Heather, Nagey
Ms, Heather, Nagey		Mr, Kevin, Miller
Mr, Mark, Waddingham		Mr, Ben, Beaumont

	LiveCode:
sort lines of tText decending by last item of each

	JavaScript:
theText = theText.split("\n");
theText = theText.sort(sort_item_3).join("\n");
function sort_item_3(line1,line2) {
	line1 = line1.split(",");
	line2 = line2.split(",");
	if(line1[2] == line2[2] return 0;
	else if(line1[2] > line2[2] return -1;
	else return 1;
}
Simon

Re: English-like Language Comparison

Posted: Sat Sep 29, 2012 12:23 pm
by Dixie
The javaScript snippet of nine lines is just a comparison of how many lines it would take using javaScript to accomplish what liveCode can do in one line... but I think that the most important point is that, the one line of liveCode code is much easier to read... justlike reading an instruction from a book... something that makes immediate sense rather than trying to decipher what the javaScript is trying to achieve...

be well

Dixie

Re: English-like Language Comparison

Posted: Mon Oct 01, 2012 2:30 pm
by Simon
Hi cisprakash,
The JavaScript is not used within LiveCode. The 2 scripts are just an example. They are supposed to do exactly the same thing which is to sort the names by last name decending.

Simon

Re: English-like Language Comparison

Posted: Mon Oct 01, 2012 3:28 pm
by Klaus
Hi Simon,

I strongly believe that this is just SPAM!

The link in his sig points to a "IT professionals"(sic!) website, so these questions do not fit here somehow :wink:
Besides the fact that the prevevious postings leave no doubt about what is being discussed here.

I give him 2 days to proof that this is no spam... 8)


Best

Klaus

Re: English-like Language Comparison

Posted: Mon Oct 01, 2012 4:32 pm
by Mark
Klaus,

No need to wait: http://qery.us/2l4

I'd remove the spam post and everything following it.

Kind regards,

Mark

Re: English-like Language Comparison

Posted: Mon Oct 01, 2012 5:19 pm
by Klaus
OK, and done :D