Dictionary with delegate or switch?

后端 未结 6 1413
一生所求
一生所求 2021-02-07 01:21

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)            


        
6条回答
  •  灰色年华
    2021-02-07 01:50

    If the typical programmer on your team is anything like the ones I often deal with, you should go for the simplest option i.e. the switch. The delegates seem to me like a 'clever' solution that is not needed.

提交回复
热议问题