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

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
anti-patterns:long_parameter_list [2021-09-02 20:29] – old revision restored (2021-03-29 20:59) 65.21.179.175anti-patterns:long_parameter_list [2021-10-18 22:23] – old revision restored (2017-05-29 11:08) christian
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: 2021-10-18 22:23 by christian