Open KristofferC opened 6 years ago
We have had discussions about this subject a couple of times in Gitter. I think we generally agree it would be better to use symbols. We could still have things like update!(elements, "my data", 1.0)
syntax for user-friendliness, and string is converted to a symbol.
Also, going towards more explicit syntax, maybe it would be good to have update_integration_points!
, update_element!
, update_problem!
, update_analysis!
and so on to make clear for which structure are fields going to be updated.
Currently, fields are indexed using
String
s (haskey(element, "flux")
). For cases like this, usingSymbol
s is usually better sinceSymbol
s are interned and therefore represented by their pointer. This means comparing symbols is just a pointer comparison and hashing them is faster than for strings. For example, the columns in aDataFrame
are indexed usingSymbol
s.