I also prefer "X = A * (B - 2)" to "X=A*(B-2)", the eye has more space to breath... ;-)
...with complex math, it's easier for my eyes to see all of it in one place & figure out the math, than to r e a d c r a p a l l s p a c e d o u t...now don't that take a couple reads to put together?
I disagree, it allows to write nice obfuscated code... :lol:
...obfuscated code, is one of the 'reasons' for a semi-colon...the 'no reason' cases are when one statement is on the line, like...
int i=1;
...in that case I don't see a need for a semi-colon...but I also don't like the need for a var type...in JavaScript (unlike C), you can just do...
i=1
i='yo momma'
i=2
...no semi-colon, no var type...a variable is just that, vary-able, able to vary between a number or a string (or anything else)...I still don't know how to make a simple string var in C...
char thisdontalwaysworkright[128]='this makes things crash depending on how you use it later';
LPSTR idontthink='this ever works';
Some people have asked for it, perhaps because they feel it improves readability.
...it don't. It don't
look like a function call with spaces.
So as long as it isn't too hard and doesn't hurt runtime performance, it seems best to support it.
...I guess, I'm all for flexibility, but please don't bend too far over for it. There are better things to bend over for...like...
The difficulty of implementing this seems much harder than one-true-brace.
...I didn't really mean the full-JS style in AHK, a half-way point would be good...
Current...
if thiskindasucks
that=yup
else that=nope
New 1 (a)...
if thiskindarocks that=yup
else that=nope
New 1 (
...
if thiskindarocks=1 that=yup
else that=nope
...slightly obfuse, but you should be able to find the condition...
New 2 (a)...
if (thiskindarocks) that=yup
else that=nope
New 2 (
...
if (thiskindarocks=1) that=yup
else that=nope
...condition in parens, not obfuse...also I'm not worried if I can scrunch the else on the same line (as in JS) I just want simple assignments or returns or breaks to work...
New 3...
if (byebye) return
if (stoploop) break
if (ilikecheese) ireallydo++
if (ilikecheese) ireallydo=Yes
if (ilikecheese) ireallydo:="Yes"
...it might be nice (tho completely existing script breaking) for semi-colon to be treated as in JS...as a 'newline' (loosely speaking of course)...I prefer // for a comment (but I haven't yet used #CommentChar in my scripts to change it tho)...but I also see it's now floor divide, so it's kinda out for a comment char, perhaps ;; (double semi-colon) could be treated as the comment char & 1 semi be the "multiple commands on one line" char (or the other way to save precious existing scripts). How about #MultiCmdOnLineChar (or a better name)...basically in pre-processing, you could replace the "multi line char" with a real newline & not have to think about it further?
Speaking of "I prefer // for a comment"...why doesn't this work...
/*if goawayfornow=1
break*/
...you have to do...
/*
if goawayfornow=1
break
*/
...I really don't like all these line breaks, some lines only have 2 chars to em, wasting vert space in the editor.
Although I think that would hurt runtime performance
...how would it do that? Allowing...
wow:="cool"
this:='too'
...would hurt runtime performance? You could pre-process singles into doubles?