digitalmars.D.learn - Idiomatic D?
- Tofu Ninja (3/3) Jan 30 2014 I hear it thrown around a lot but what does it actually mean?
- Dicebot (5/9) Jan 30 2014 There is no "official" idiomatic style like, for example, in
- Tofu Ninja (2/12) Jan 30 2014 Got any tips?
- Meta (2/15) Jan 30 2014 Ranges, templates and structs.
- Stanislav Blinov (2/5) Jan 30 2014 ~= CTFE ~ UFCS
- Meta (3/9) Jan 30 2014 ~= std.algorithm ~ std.range
- Stanislav Blinov (3/8) Jan 30 2014 ~= immutable ~ (isProperlyImplemented!shared ? shared :
- Meta (5/14) Jan 30 2014 Repeat these steps until you have a beautiful, elegant solution,
- Matt Soucy (6/15) Jan 30 2014 );
- Stanislav Blinov (2/12) Jan 30 2014 I knew I forgot something...
- qznc (2/15) Jan 31 2014 http://qznc.github.io/d-tut/idiomatic.html
- Dicebot (10/16) Jan 31 2014 I'd say single most important thing is designing your API's to be
- Kelet (3/7) Jan 30 2014 Here is one of the few previous threads on the topic:
I hear it thrown around a lot but what does it actually mean? What does the ideal D code look like? What kind of things should some one think about if they are trying to do idiomatic D?
Jan 30 2014
On Thursday, 30 January 2014 at 20:05:11 UTC, Tofu Ninja wrote:I hear it thrown around a lot but what does it actually mean? What does the ideal D code look like? What kind of things should some one think about if they are trying to do idiomatic D?There is no "official" idiomatic style like, for example, in python. When I speak about idiomatic D I usually think about style Phobos is written in (omitting legacy modules) as it is the code that gets most attention from most experienced D developers.
Jan 30 2014
On Thursday, 30 January 2014 at 20:10:01 UTC, Dicebot wrote:On Thursday, 30 January 2014 at 20:05:11 UTC, Tofu Ninja wrote:Got any tips?I hear it thrown around a lot but what does it actually mean? What does the ideal D code look like? What kind of things should some one think about if they are trying to do idiomatic D?There is no "official" idiomatic style like, for example, in python. When I speak about idiomatic D I usually think about style Phobos is written in (omitting legacy modules) as it is the code that gets most attention from most experienced D developers.
Jan 30 2014
On Thursday, 30 January 2014 at 22:40:24 UTC, Tofu Ninja wrote:On Thursday, 30 January 2014 at 20:10:01 UTC, Dicebot wrote:Ranges, templates and structs.On Thursday, 30 January 2014 at 20:05:11 UTC, Tofu Ninja wrote:Got any tips?I hear it thrown around a lot but what does it actually mean? What does the ideal D code look like? What kind of things should some one think about if they are trying to do idiomatic D?There is no "official" idiomatic style like, for example, in python. When I speak about idiomatic D I usually think about style Phobos is written in (omitting legacy modules) as it is the code that gets most attention from most experienced D developers.
Jan 30 2014
On Friday, 31 January 2014 at 00:08:02 UTC, Meta wrote:On Thursday, 30 January 2014 at 22:40:24 UTC, Tofu Ninja wrote:~= CTFE ~ UFCSGot any tips?Ranges, templates and structs.
Jan 30 2014
On Friday, 31 January 2014 at 00:09:34 UTC, Stanislav Blinov wrote:On Friday, 31 January 2014 at 00:08:02 UTC, Meta wrote:~= std.algorithm ~ std.rangeOn Thursday, 30 January 2014 at 22:40:24 UTC, Tofu Ninja wrote:~= CTFE ~ UFCSGot any tips?Ranges, templates and structs.
Jan 30 2014
On Friday, 31 January 2014 at 00:13:02 UTC, Meta wrote:~= immutable ~ (isProperlyImplemented!shared ? shared : repeatedlyAskAndreiWhatsGoingOnWith!shared~= std.algorithm ~ std.rangeRanges, templates and structs.~= CTFE ~ UFCS
Jan 30 2014
On Friday, 31 January 2014 at 00:17:47 UTC, Stanislav Blinov wrote:On Friday, 31 January 2014 at 00:13:02 UTC, Meta wrote:Repeat these steps until you have a beautiful, elegant solution, or ten pages of compiler errors because a template constraint failed somewhere down the line.~= immutable ~ (isProperlyImplemented!shared ? shared : repeatedlyAskAndreiWhatsGoingOnWith!shared~= std.algorithm ~ std.rangeRanges, templates and structs.~= CTFE ~ UFCS
Jan 30 2014
On 01/30/2014 07:17 PM, Stanislav Blinov wrote:On Friday, 31 January 2014 at 00:13:02 UTC, Meta wrote:); // Sorry but that was going to cause a slight error. -- Matt Soucy http://msoucy.me/~= immutable ~ (isProperlyImplemented!shared ? shared : repeatedlyAskAndreiWhatsGoingOnWith!shared~= std.algorithm ~ std.rangeRanges, templates and structs.~= CTFE ~ UFCS
Jan 30 2014
On Friday, 31 January 2014 at 04:53:48 UTC, Matt Soucy wrote:I knew I forgot something...); // Sorry but that was going to cause a slight error.~= immutable ~ (isProperlyImplemented!shared ? shared : repeatedlyAskAndreiWhatsGoingOnWith!shared~= std.algorithm ~ std.rangeRanges, templates and structs.~= CTFE ~ UFCS
Jan 30 2014
On Thursday, 30 January 2014 at 22:40:24 UTC, Tofu Ninja wrote:On Thursday, 30 January 2014 at 20:10:01 UTC, Dicebot wrote:http://qznc.github.io/d-tut/idiomatic.htmlOn Thursday, 30 January 2014 at 20:05:11 UTC, Tofu Ninja wrote:Got any tips?I hear it thrown around a lot but what does it actually mean? What does the ideal D code look like? What kind of things should some one think about if they are trying to do idiomatic D?There is no "official" idiomatic style like, for example, in python. When I speak about idiomatic D I usually think about style Phobos is written in (omitting legacy modules) as it is the code that gets most attention from most experienced D developers.
Jan 31 2014
On Thursday, 30 January 2014 at 22:40:24 UTC, Tofu Ninja wrote:I'd say single most important thing is designing your API's to be range-based and making sure they work nicely with std.algorithm Preferring simple template + procedural/functional solutions over complicated object hierarchies. Treat module as your basic design and incapsulation unit, not class. Don't rely on specific types, prefer generic implmentations. Verify your all your assumptions with constraints and/or static asserts. Use DDOC + documented unittest feature. It rocks.There is no "official" idiomatic style like, for example, in python. When I speak about idiomatic D I usually think about style Phobos is written in (omitting legacy modules) as it is the code that gets most attention from most experienced D developers.Got any tips?
Jan 31 2014
On Thursday, 30 January 2014 at 20:05:11 UTC, Tofu Ninja wrote:I hear it thrown around a lot but what does it actually mean? What does the ideal D code look like? What kind of things should some one think about if they are trying to do idiomatic D?Here is one of the few previous threads on the topic: http://forum.dlang.org/thread/awutlttzvqaawkrjnfqe forum.dlang.org
Jan 30 2014