Optimization might be necessary for variables of class HTuple. This kind of optimization can either be done in HDevelop or in the generated C++ code. In most cases, optimization is not necessary if you program according to the following rules.
T := [T,New]
because this can be transformed to
T = T.TupleConcat(New);
in C++ and requires no creation of a new tuple, whereas
T := [New,T]
which is translated into
T = HTuple(New).TupleConcat(T);
would need the creation of a new tuple.
T[i] := New
can directly be translated into the efficient and similar looking code
T[i] = New;