User Tools

Site Tools


anti-patterns:long_parameter_list

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
anti-patterns:long_parameter_list [2013-08-04 20:25]
christian created
anti-patterns:long_parameter_list [2017-05-29 11:08]
christian [Description Status]
Line 61: Line 61:
 ==== Example 1: CreateProcess and how it is avoided ==== ==== Example 1: CreateProcess and how it is avoided ====
  
-The Windows API function [[http://​msdn.microsoft.com/​en-us/​library/​windows/​desktop/​ms682425(v=vs.85).aspx|CreateProcess]] takes ten arguments most of which are even optional. The function is cumbersome to use and hard to read because of the large number of parameters. Developers tend to avoid the use of the function and use simpler ones like [[http://​msdn.microsoft.com/​en-us/​library/​bb762153(VS.85).aspx|ShellExecute]] (which still has six parameters) instead, or write wrapper functions for it. Some might be even tempted to use [[http://​msdn.microsoft.com/​en-us/​library/​ms687393(VS.85).aspx|WinExec]] which is very easy to use bur deprecated. In contrast to that the .NET method [[http://​msdn.microsoft.com/​de-de/​library/​system.diagnostics.process.start(v=vs.110).aspx|Process.Start]] can often be called with just one parameter.+The Windows API function [[http://​msdn.microsoft.com/​en-us/​library/​windows/​desktop/​ms682425(v=vs.85).aspx|CreateProcess]] takes ten arguments most of which are even optional. The function is cumbersome to use and hard to read because of the large number of parameters. Developers tend to avoid the use of the function and use simpler ones like [[http://​msdn.microsoft.com/​en-us/​library/​bb762153(VS.85).aspx|ShellExecute]] (which still has six parameters) instead, or write wrapper functions for it. Some might be even tempted to use [[http://​msdn.microsoft.com/​en-us/​library/​ms687393(VS.85).aspx|WinExec]] which is very easy to use but deprecated. In contrast to that the .NET method [[http://​msdn.microsoft.com/​de-de/​library/​system.diagnostics.process.start(v=vs.110).aspx|Process.Start]] can often be called with just one parameter.
  
  
 ===== Description Status ===== ===== Description Status =====
 /* Choose one of the following and comment out the rest: */ /* Choose one of the following and comment out the rest: */
-[[wiki:​Stub]] +/*[[wiki:​Stub]]*
-/*[[wiki:​Incomplete]]*/+[[wiki:​Incomplete]]
 /​*[[wiki:​Complete]]*/​ /​*[[wiki:​Complete]]*/​
  
anti-patterns/long_parameter_list.txt · Last modified: 2017-05-29 11:08 by christian