4 ms·
Probably because it causes the least "noisy" syntax. But I think it's a mistake. A language that lets you freely choose between using values and references shou
by fauigerzigerk 3y ago
Probably because it causes the least "noisy" syntax. But I think it's a mistake. A language that lets you freely choose between using values and references should make it very clear at the call site which one is being used.
This one "feature" has caused more bugs in my Swift code than anything else. For frequently used types I can remember whether they are structs or classes. But for new code written by others or my own code when the design isn't quite settled yet, I need every syntactical clue I can get to avoid mistakes.
This is not the only place where Swift goes with "clean" syntax at the expense of local clues that help readability. Result builders are another example.