HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

would you rather?

05-30-2008, 10:56 PM#1
Vexorian
Table:
inc v
dec a[t]
set v++
set a[t]--
set v=v+1
set a[t]=a[t]-1
  • ugly
  • makes sense
  • reminds me of C
  • Is longer than inc/dec
  • Redundant
  • No work for me to implement it.
  • KISS
  • Must type more


05-30-2008, 11:14 PM#2
Strilanc
set v += 1

while you're at it, allow:

if [condition] then [statement]

so I can stop using three lines for every IF.

A while loop would be nice, too:

while [condition]
[block]
endloop
05-30-2008, 11:15 PM#3
Captain Griffen
+= -= /= *= would be very nice.
05-30-2008, 11:43 PM#4
TEC_Ghost
set v++
set a[t]--

I like my C++ :)
05-30-2008, 11:52 PM#5
Av3n
Second one is most likely the easiest to remember

-Av3n
05-31-2008, 01:32 AM#6
MaD[Lion]
i like
v++
v--
for increament and decreament
but i would also like this if u wanna step higher than 1:
v+=2
v-=2
this will be awesome, i wonder why many languages doesnt have this. Or maybe im wrong, but C++ doesnt have tat i think?
05-31-2008, 01:45 AM#7
Gorman
ah, yeah c++ has that =)

its the best option, noone will remember dec/inc =)

so, yeah += etc is best =)
05-31-2008, 03:20 AM#8
PurgeandFire111
+= seems best to me. Easy to remember and saves some typing. But my next choice would be ++ and --...
05-31-2008, 03:44 AM#9
The Elite
set v++ seems easiest, and thus best in my opinion
Quote:
Originally Posted by Strilanc
while you're at it, allow:

if [condition] then [statement]

so I can stop using three lines for every IF.
agreed
05-31-2008, 04:45 AM#10
TheDamien
I'd rather stick to set i = i+1.

If not, "dec" + "inc" would be my preferred style.

Quote:
Originally Posted by MaD[Lion]
this will be awesome, i wonder why many languages doesnt have this. Or maybe im wrong, but C++ doesnt have tat i think?

05-31-2008, 05:22 AM#11
ADOLF
+=,-= etc, because it can be used not only for increment/decrement...)
Quote:
set v++
set a[t]--

I like my C++ :)
inc src
dec src

i like my asm (but the code in assembler's style in jass will be really ugly)
05-31-2008, 06:12 AM#12
darkwulfv
I suppose set v++ or however it works would be good.

So, say I wanted to take v and add one. Would it be "v++"? (If so, then what is the =+, =*, etc. everyone keeps mentioning?)

inc/dec is ugly. And option #3 is fine, honestly. I mean if you MUST, use option 2, but there's nothing WRONG with option 3. I mean, it really doesn't take that much effort to type like, 3 or 4 extra characters.
05-31-2008, 09:11 AM#13
Toadcop
in that case (what you have now) the best would be
Code:
inc v 
dec a[t]
but ++ is also not bad but i have some strange feeling on that xD
05-31-2008, 09:55 AM#14
TEC_Ghost
Quote:
Originally Posted by darkwulfv
I suppose set v++ or however it works would be good.

So, say I wanted to take v and add one. Would it be "v++"? (If so, then what is the =+, =*, etc. everyone keeps mentioning?)

inc/dec is ugly. And option #3 is fine, honestly. I mean if you MUST, use option 2, but there's nothing WRONG with option 3. I mean, it really doesn't take that much effort to type like, 3 or 4 extra characters.

Variable++ Takes the current variable and Adds 1

Variable =+ Number Takes the variable and adds the number then just swap the enumerator
05-31-2008, 10:11 AM#15
Themerion
variable += -= *= /= would be great.