There are situations that the caret cursor symbol ^ remains in the code like if the code is not finished and something has to be added in its position yet the code works without any error message.
Is this style of programming correct?
Divide[Sequence @@ {2, 3}] 2/3 The above input looks like this in notebook:
I know it can be written also as Divide @@ {2, 3} but there are sometimes situations when you need to use Sequence like in the first example.
Another strange behavior of syntax highlighting is the following code like if there is an error in the syntax indicated by red brackets:
Divide{2, 3} Divide {2, 3} Divide*{2, 3} {2 Divide, 3 Divide} {2 Divide, 3 Divide} {2 Divide, 3 Divide} The above input looks like this in notebook:
Again no error (in fact there is no reason why there should be any error) but the brackets in the first two lines are red even though they represent the same code as third line which has no red brackets.
So why are the brackets red?
By the way I do not have much trouble with that behavior of Mathematica, it is more a question out of curiosity.



Divideis expecting 2 arguments and it has no means to snoop the evaluation of the 1st argument to see its result. The red curly brackets make sense because the symbol is a function expecting parameters and that usage will not result in the evaluation of the function. The last is explicit with the multiplication so no highlighting given. I think all cases make good sense. $\endgroup$Sequence @@ {2, 3}will evaluate to an acceptable argument list. It could only do that if it first asked the kernel to perform the calculation, but of course it can't do that without, well, the calculation happening (presumably prematurely, since the user is still trying to input stuff), $\endgroup$Divide{2,3}is almost certainly a bug in your code even if it is valid syntax. $\endgroup$