Author Topic: is this a bug ?  (Read 3219 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
is this a bug ?
« on: February 12, 2011, 03:14:22 PM »
Deleted
« Last Edit: May 07, 2015, 11:28:12 AM by Peter »

JRS

  • Guest
Re: is this a bug ?
« Reply #1 on: February 12, 2011, 07:34:04 PM »
Personally I see no advantage in using multiple statements on a single line. A second statement after a IF/THEN is cruel.  >:(

ScriptBasic gains a lot of it's speed as an interpreter due to the single statement per line rule. Much easier to compile into pcode.


Charles Pegge

  • Guest
Re: is this a bug ?
« Reply #2 on: February 12, 2011, 08:28:28 PM »
Oxygen has very flexible parsing rules - a great challenge to implement but it gives the programmer great flexibility of expression and makes code porting easier. You can get the code working before imposing the preferred style.

Personally I use colons when the statements go together naturally as a semantic unit. But I think we can all agree that clarity is paramount.

Just to show off, These 2 extreme variations do the same thing :)

Code: [Select]
10 a=100 : b=0 : tx="" : iF a=10 then b=a : tx = "HALLO" else tx="GOODBYE" : b=a*2
20 print tx + "  " + b

Code: [Select]
long a=100;
long b;
string tx;
if (a==10) {
  b=a;
  tx = "HALLO";
} else {
  tx="GOODBYE";
  b=a*2;
};

 print tx + "  " + b;

Charles
« Last Edit: February 13, 2011, 02:01:20 AM by Charles Pegge »

Charles Pegge

  • Guest
Re: is this a bug ?
« Reply #3 on: February 13, 2011, 03:08:45 AM »
I think Assembler is good too but enforcing one instruction per line
m
a
k
e
s

i
t

h
a
r
d

t
o

r
e
a
d


 ;D

therefore Oxygen supports:

mov eax,a : add eax,4 : mov b,eax

Charles

JRS

  • Guest
Re: is this a bug ?
« Reply #4 on: February 13, 2011, 01:13:00 PM »
I was referring to Basic and interpreters specifically.