Conventions for order of parameters in a function

后端 未结 2 930
青春惊慌失措
青春惊慌失措 2020-12-17 20:32

In writing functions my brain always spends a few milliseconds to check which order of parameters would be best for a given function.

should I write:



        
2条回答
  •  情深已故
    2020-12-17 20:47

    Personally, I'd do the first one because that's exactly the order I would have in the GUI: User, Title, Text.

    But as David said, this is very open ended. If my project standards required a special order I would use that.

提交回复
热议问题