language agnostic - Helper Casting Functions -- Is it a code smell? -


I recently started using functions to make my fingers easier for an example, I have Something was

  ((dictionary; string, string & gt;) value) .add (foo);  

and converted it into a small supporting function so that I can do this

  ToDictionary (value). Add (foo);  

Is this code odor?

Besides, what about simple examples? For example, in my scripting engine I have considered doing things like this

  (StringVariable arg). Value = "foo";  

be

  ToStringVar (arg). Value = "foo";  

How do I really dislike how to cast a value and immediately get a property from you should attach it to you in dual brackets.

(I also have this language agnostic, even if my example is C #)

< / P>

If you really want to "save your fingers", you can do this - in fact you can only need to do this casting.

At the top of your file, with all other uses:

  using shortcut = dictionary & lt; String, dictionary & lt; Int, list & lt; Dictionary & lt; Other type, this ISDrDQCell & gt; & Gt; & Gt; & Gt ;;  

Comments