Comment

Comment by a1369209993

Because most people can figure out that:

  CreateProcess(NULL,cmd,NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&si,&pi);
is a terrible interface that we should try to split up better, but

  CreateProcess(
    lpApplicationName: NULL,
    lpCommandLine: cmd,
    lpProcessAttributes: NULL,
    lpThreadAttributes: NULL,
    bInheritHandles: TRUE,
    dwCreationFlags: CREATE_NO_WINDOW,
    lpEnvironment: NULL,
    lpCurrentDirectory: NULL,
    lpStartupInfo: &si,
    lpProcessInfo: &pi,
    );
tends not to attract the same scrutiny for some reason. On the other hand, removing named parameters doesn't actually fix this (see jasode's example at https://news.ycombinator.com/item?id=24401913 so I don't need another dozen lines), so it's not clear that this is a good argument against named parameters.
parent a1369209993 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton