Code: Select all
Example1
Index = i
i + 1
*Suggested*
Index = i++
Example2
i + 1
Index = i
*Suggested*
Index = ++i
Code: Select all
Example1
Index = i
i + 1
*Suggested*
Index = i++
Example2
i + 1
Index = i
*Suggested*
Index = ++i
Code: Select all
; i + 1
INC qword [v_i]
;
; i + 2
ADD qword [v_i],2
;
; i + 3
ADD qword [v_i],3
The main effect of this would be to worsen the readability of the code.kinglestat wrote:Consider the following code
Code: Select all
Example1 Index = i i + 1 *Suggested* Index = i++ Example2 i + 1 Index = i *Suggested* Index = ++i
Code: Select all
Macro Inc(var)
var : var + 1
EndMacro
Macro PreInc(var)
var + 1 : var + 1
EndMacro
Macro Dec(var)
var : var - 1
EndMacro
Macro PreDec(var)
var - 1 : var - 1
EndMacro
Define I.i = 4
Define Index = 4
Index = Inc(I)
Debug Index
Debug I
Index = PreInc(I)
Debug Index
Debug I
Index = Dec(I)
Debug Index
Debug I
CompilerIf works well for multiline comments.skywalk wrote:I agree this does NOT improve the PB language.
Add multiline comments waaay before considering this.
Code: Select all
AddMapElement( mapVariables(), varname )
mapVariables()\Index = gVarPos
gVarPos + 1
;Suggsted
AddMapElement( mapVariables(), varname )
mapVariables()\Index = gVarPos++
;1 line saved and more readable in my opinion
Code: Select all
AddMapElement( mapVariables(), varname )
mapVariables()\Index = gVarPos
gVarPos + 1
;Suggsted
AddMapElement( mapVariables(), varname )
mapVariables()\Index = gVarPos++
Code: Select all
AddMapElement( mapVariables(), varname )
mapVariables()\Index = gVarPos:gVarPos + 1
No. Just some people with an own opinion.kinglestat wrote:So many lawyers
This is only readable for people who know C (or languages such as Java that also use this syntax).kinglestat wrote:Code: Select all
;Suggsted AddMapElement( mapVariables(), varname ) mapVariables()\Index = gVarPos++ ;1 line saved and more readable in my opinion
Code: Select all
Macro inc(x,y)
x = x + y
EndMacro
Macro dec(x,y)
x = x - y
EndMacro
While i.d < 360
inc(i,Sqr(2))
Debug i
Wend
; While i.d > -360
; dec(i,Sqr(2))
; Debug i
; Wend
Code: Select all
int i;
i = ++i + i++ + ++i;
printf("%d", ++i); // 7