I am writing a parser which calls some functions dependent on some value.
I can implement this logic with simple switch like this:
switch(some_val)
Both do the same (well you should check if the key appears in the dictonary).
It is just a matter of readability. What looks the best for your and more important, what do people reading your code would prefer.
(I think the dictionary)