4 ms·
It's not that simple, D has UFCS (Uniform Function Call Syntax), which makes object.method(args) and method(object, args) equivalent calls. Also there's a non-
by skocznymroczny 6y ago
It's not that simple, D has UFCS (Uniform Function Call Syntax), which makes object.method(args) and method(object, args) equivalent calls.
Also there's a non-language related advantage of dot notation. Type the name of the object, press dot and IDE will show you what things you can do with that object. You don't have that with other notations.
- jasonpbecker 6y agoThat assumes a very OO mindset. method(object, args)/function(data, parameters) works better in other languages, and IDEs can handle this quite well without dot syntax. Which goes to your point-- form follows function, in syntax as with many other things.
- gvjddbnvdrbv 6y agoWhy is dot special? Fortran uses % (if I remember properly) IDE's can complete after a % as well as after a dot.
- int_19h 6y agoDot is not special. Putting the receiver objects first is special, because it allows the IDE to only show verbs (methods) that pertain to that object. If you put the verb first, code completion lacks context, so it would necessarily have to show you all verbs that can apply to any object that could conceivably be acted on in that scope.