|
|
|
|
|
by _0w8t
1350 days ago
|
|
The verbosity of TypeScript types can be attributed to poor choice of syntax and names that became obvious retrospectively. Still even with TypeScript if types makes your functions ugly, then it shows the complexity of the code. Often it also suggests sensible refactoring that without types would not be apparent. |
|
Javascript: "function area(left, top, right, bottom)"
In an editor the typescript function would likely be split into five separate lines.
"function area(
left: number,
top: number,
right: number,
bottom: number)
: number {"
None of the functions are complex but the the typescript function with the formatter creates a lot of noise.