News for hackers. Stuff that matters.
Re:N-Params vs. Single Param by geakstr on Thursday April 17, 2025 @03:36PM (#43721183)
Some languages allow to define type alias, name of this type can be self-explanatory:

  type FullName = string;
  function combineName(first: string, last: string): FullName;
Also documentation comment for function is what specifically solves this - describes what function does and returns.
Re:N-Params vs. Single Param by hyperhello on Thursday April 17, 2025 @03:41PM (#43721252)
Neither really addresses the issue. Making a type for a single kind of string seems like an abuse of types just to shoehorn the documentation in. Documentation can be used directly of course, but that moots all of this -- just document? Yeah, but naming the variable is super quick compared to either.
Re:N-Params vs. Single Param by oneoverten on Thursday April 17, 2025 @07:27PM (#43723334)
Variable names is just documentation. Having types that can assert some condition on the underlying value is not even comparable to "having a named return variable". (just document? just name variables?) You don't care about what the name of the returned value is, you care about what *it is*.
Re:N-Params vs. Single Param by avandekleut on Thursday April 17, 2025 @10:45PM (#43724464)
Typescript nukes primitive aliases like this sadly. Intellisense will just infer it as "string".