I like self documenting code.

The import procs are nothing but self-documenting, see for eg 
lib/posix/posix.nim: 
    
    
    proc fmtmsg*(a1: int, a2: cstring, a3: cint,
                  a4, a5, a6: cstring): cint {.importc, header: "<fmtmsg.h>".}
    
    
    Run

(many such examples)

why not use instead the native argument names where the proc is defined, eg: 
from [https://linux.die.net/man/3/fmtmsg](https://linux.die.net/man/3/fmtmsg)
    
    
    int fmtmsg(long classification, const char *label,
               int severity, const char *text,
               const char *action, const char *tag);
    
    
    Run

so we'd have: 
    
    
    proc fmtmsg*(classification: int, label: cstring, severity: cint,
                  text, action, tag: cstring): cint {.importc, header: 
"<fmtmsg.h>".}
    
    
    Run

this is especially important when named arguments are being used.

How about:

  * adding to contributing.md (see 
[https://github.com/nim-lang/Nim/pull/8271](https://github.com/nim-lang/Nim/pull/8271))
 an note on that for new code
  * accepting PR's to fix these for old code


Reply via email to