So with all the language updates in 2019r2.1 ; are we still in love with THEN? Is there some significance I am not aware of? It is probably the most common compiler error I see. Every time I see the red ‘X’, I am like - really? “Why don’t you just put it in there and continue compiling!” Even after years of typing it sometimes the brain continues the thought and I continue typing - grammar and syntax excluded from thought - and there is sits, the lonely IF missing its pal THEN.
I’m not advocating the extinction of THEN, just a consideration of -
Ignoring it during compile (being there, or not to be)
Automatically adding it (compiler) if it is missing
because Xojo can also write key words CamelCase after leave the row i think it can also add a Then if it is missing. (optional)
Automatically adding anything by compiler i not like. should be part of analyse project and there a option to auto replace/add.
and maybe analyse project preceding the build process.
for a better understanding of source code reading “Then” should follow after the condition.
or as example app game kit editor have short cuts which the user can define self
so you can write if and press TAB the row appear if then and the cursor goto after if where you defined. very useful this feature.
Xojo does not have begin/end block keywords as pascal or delimiters { } as C++, but it depends on different delimiter-keywords in context. If you don’t write the starting THEN knowing it’s necessary, probably you forgot to conclude some expression. I love the compiler showing it. And THEN allows you doing things like IF x<10 THEN x=x+1, imagine writing IFx<10 x=x+1, it’s great that we receive a “hey? I can’t find a THEN ending your IF expression”.
THEN should continue to be an included and required part of the language syntax… as it provides for continuation of the statement, and contributes to the readability of the code.
Sometimes I think that Xojo should enforce case-sensitivity (as Swift does), but sometimes I’m glad it doesn’t. but functions that can return multiple values would be REALLY nice (and Swift also has this)
(x,y,z)=myFunction
Were you aware that THEN is optional on the Pragma statements?
[quote=464799:@Karen Atkocius]Case sensitivity for identifiers would definitely be a deal breaker for me!!!
-Karen[/quote]
just enforces a different discipline is all… and the compiler would point out where you missed
but what I do miss in Swift is that compares ARE sensitive without special consideration, the opposite of what Xojo does.