Thread overview | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 08, 2013 A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D. I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important. http://nomad.so/2013/08/alternative-function-syntax-in-d/ I'll post to reddit in the morning. |
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On 8/8/2013 11:53 AM, Gary Willoughby wrote:
> I personally think this is more confusing than many people think. Hopefully this
> will quickly arm a developer with knowledge to be able to read and understand
> most D code. Let me know if i've missed anything important.
>
> http://nomad.so/2013/08/alternative-function-syntax-in-d/
s/compliments/complements/
s/-profile/-property/
s/behaviour/behavior/ if you mean to use the american english spelling
s/explained the rules/explained that the rules/
s/ommited/omitted/
s/in the call parens/in the call then parens/
s/i've/I've/
Under Extension Methods, a huge reason for them is to head off the temptation to write 'kitchen sink' classes that are filled with every conceivable method. The desired approach is to have the class implement the bare minimum of functionality, and add other functionality with extension methods (that do not have access to the class' private state).
All in all, good article!
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 8/8/2013 12:15 PM, Walter Bright wrote:
> s/compliments/complements/
The frequency with which I see this error is a pet peeve of mine!
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On 8/8/13 3:53 PM, Gary Willoughby wrote:
> I've just finished a new blog article on the subject of alternative
> function syntax in D. I guess this is pretty straightforward stuff to
> all the people here but was a major source of confusion to me (and
> others?) when first learning D.
>
> I personally think this is more confusing than many people think.
> Hopefully this will quickly arm a developer with knowledge to be able to
> read and understand most D code. Let me know if i've missed anything
> important.
>
> http://nomad.so/2013/08/alternative-function-syntax-in-d/
>
> I'll post to reddit in the morning.
Nice article.
But when I read "alternative function syntax" I thought your article was a proposal for that, an alternative function syntax. :-P
Maybe it should be renamed to something else... but I don't know enough English to suggest that.
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | On Thursday, 8 August 2013 at 19:24:31 UTC, Ary Borenszweig wrote:
> On 8/8/13 3:53 PM, Gary Willoughby wrote:
>> I've just finished a new blog article on the subject of alternative
>> function syntax in D. I guess this is pretty straightforward stuff to
>> all the people here but was a major source of confusion to me (and
>> others?) when first learning D.
>>
>> I personally think this is more confusing than many people think.
>> Hopefully this will quickly arm a developer with knowledge to be able to
>> read and understand most D code. Let me know if i've missed anything
>> important.
>>
>> http://nomad.so/2013/08/alternative-function-syntax-in-d/
>>
>> I'll post to reddit in the morning.
>
> Nice article.
>
> But when I read "alternative function syntax" I thought your article was a proposal for that, an alternative function syntax. :-P
>
> Maybe it should be renamed to something else... but I don't know enough English to suggest that.
Maybe "unique" instead of "alternative"?
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 8 August 2013 at 19:15:29 UTC, Walter Bright wrote:
> lots...
I've made the corrections, thanks. I really need to work on my English. I haven't written anything in years and it's harder work than i remember. Nothing that practise, practise, practise ...and a spell checker won't fix! ;)
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Thursday, 8 August 2013 at 18:53:47 UTC, Gary Willoughby wrote:
> I've just finished a new blog article on the subject of alternative function syntax in D. I guess this is pretty straightforward stuff to all the people here but was a major source of confusion to me (and others?) when first learning D.
>
> I personally think this is more confusing than many people think. Hopefully this will quickly arm a developer with knowledge to be able to read and understand most D code. Let me know if i've missed anything important.
>
> http://nomad.so/2013/08/alternative-function-syntax-in-d/
>
> I'll post to reddit in the morning.
I think you should mention the terms UFCS and IFTI, since those are used by D folk.
UFCS: Universal Function Call Syntax, i.e. dot notation.
IFTI: Implicit Function Template Instantiation, i.e. template parameters can be omitted when they can be deduced from the function arguments.
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to anonymous | On Thursday, 8 August 2013 at 20:37:35 UTC, anonymous wrote:
> I think you should mention the terms UFCS and IFTI, since those are used by D folk.
>
> UFCS: Universal Function Call Syntax, i.e. dot notation.
> IFTI: Implicit Function Template Instantiation, i.e. template parameters can be omitted when they can be deduced from the function arguments.
Good point.
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 8 August 2013 at 19:18:22 UTC, Walter Bright wrote:
> On 8/8/2013 12:15 PM, Walter Bright wrote:
>> s/compliments/complements/
>
> The frequency with which I see this error is a pet peeve of mine!
I know! It's rediculous!
|
August 08, 2013 Re: A new blog article detailing the alternative function syntax | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 8 August 2013 at 19:15:29 UTC, Walter Bright wrote: > Under Extension Methods, a huge reason for them is to head off the temptation to write 'kitchen sink' classes that are filled with every conceivable method. The desired approach is to have the class implement the bare minimum of functionality, and add other functionality with extension methods (that do not have access to the class' private state). > http://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197#.UW1X9HWZeXA.reddit I think you linked this Meyers article at some point as being the original rationale for UFCS (correct me if I'm wrong). |
Copyright © 1999-2021 by the D Language Foundation