Looking for ugly code comparisons WAS: Slashdotter looking for kids' programming language
m.schonewille at economy-x-talk.com
Thu Dec 11 20:47:29 EST 2008
A few very simple examples. Revolution is clearly much more readable
and easier to work with for starting programmers than other languages.
repeat with x = 32 to 255
put x & " " & numToChar(x) & cr after msg
This one is hardly readable if you're not used to reading programing
for ($chrNr=32;$chrNr < 255;$chrNr++)
echo $chrNr." ".chr($chrNr)."\n";
Just for fun, here's the AppleScript version. Quite similar to
Revolution, but much more picky.
set myList to ""
repeat with x from 32 to 255
set myList to myList & x & " " & (ASCII character x) & return
Btw, if you want ugly code, this one should not be omitted...
0 REM BASIC
10 LET x = 31
20 LET X = X + 1
30 PRINT x," ",CHR$(x)
40 IF x < 255 GOTO 20
I've tested all the examples above. They all work.
Of course, there is a large collection of programming languages
already and people can easily pick the one that looks easy at <http://99-bottles-of-beer.net/language-runtime-revolution-499.html
Economy-x-Talk Consulting and Software Engineering
Dutch forum: http://runrev.info/rrforum
We are always looking for new projects! Feel free to contact us to
discuss your custom software project!
On 11 dec 2008, at 18:52, Judy Perry wrote:
> I again come hat-in-hand to ask for some really ugly-looking code
> in those "real world" programming languages to compare with Rev for
> Slashdot thread.
> Posters there are actually recommending things like Assembly(!),
> Java, & C#!
> Specifically the OP was looking to teach basics such as conditionals,
> variables & loops.
> Does anyone have any ugly examples?
More information about the Use-livecode