digitalmars.D - Coding style on dlang.org
- H. S. Teoh via Digitalmars-d (6/6) Aug 23 2014 I notice that the coding style used for code examples on dlang.org isn't
- monarch_dodra (5/11) Aug 23 2014 Do you have any specific examples? I'd assume the code is mostly
- w0rp (5/11) Aug 23 2014 I think I'd recommend submitting pull requests to fix the
- Andrej Mitrovic via Digitalmars-d (8/10) Aug 23 2014 Most of these come from D1 docs ported to D2, which were originally
- Jonathan M Davis via Digitalmars-d (4/5) Aug 23 2014 Agreed.
- H. S. Teoh via Digitalmars-d (8/14) Aug 26 2014 [...]
- H. S. Teoh via Digitalmars-d (18/29) Aug 23 2014 Plenty. Just a few random examples:
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (5/8) Aug 25 2014 How about making use of automatic indentation in this case? Are
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (3/4) Aug 25 2014 Of course indentation isn't everything, and perhaps not the most
I notice that the coding style used for code examples on dlang.org isn't always consistent, and they generally differ from Phobos examples. Should we adopt Phobos style for all code examples on dlang.org? T -- Real Programmers use "cat > a.out".
Aug 23 2014
On Saturday, 23 August 2014 at 14:52:45 UTC, H. S. Teoh via Digitalmars-d wrote:I notice that the coding style used for code examples on dlang.org isn't always consistent, and they generally differ from Phobos examples. Should we adopt Phobos style for all code examples on dlang.org? TDo you have any specific examples? I'd assume the code is mostly old. I'd reject any pull that doesn't adhere to Phobos style, even if it's just ddoc'ed examples.
Aug 23 2014
On Saturday, 23 August 2014 at 14:52:45 UTC, H. S. Teoh via Digitalmars-d wrote:I notice that the coding style used for code examples on dlang.org isn't always consistent, and they generally differ from Phobos examples. Should we adopt Phobos style for all code examples on dlang.org? TI think I'd recommend submitting pull requests to fix the examples to match current conventions, or making edits to wiki pages.
Aug 23 2014
On 8/23/14, H. S. Teoh via Digitalmars-d <digitalmars-d puremagic.com> wrote:The "violations" are mainly Egyptian braces, 2-space indentation, and a few missing closing braces.Most of these come from D1 docs ported to D2, which were originally written by (I believe) Walter. Also, I think the code was meant to be tight and have as less lines as possible, to avoid increasing the size of the page. But I think if page size is a concern then the page should be split into multiple pages, we shouldn't make code readability suffer. I think we should use the D style guide for all our samples.
Aug 23 2014
On Sat, 23 Aug 2014 21:20:13 +0200 Andrej Mitrovic via Digitalmars-d <digitalmars-d puremagic.com> wrote:I think we should use the D style guide for all our samples.Agreed. - Jonathan M Davis
Aug 23 2014
On Sat, Aug 23, 2014 at 05:09:09PM -0700, Jonathan M Davis via Digitalmars-d wrote:On Sat, 23 Aug 2014 21:20:13 +0200 Andrej Mitrovic via Digitalmars-d <digitalmars-d puremagic.com> wrote:[...] Alright, the deed is done: https://github.com/D-Programming-Language/dlang.org/pull/640 It took a while, but it's all done now. :) T -- Some ideas are so stupid that only intellectuals could believe them. -- George OrwellI think we should use the D style guide for all our samples.Agreed.
Aug 26 2014
On Sat, Aug 23, 2014 at 03:01:59PM +0000, monarch_dodra via Digitalmars-d wrote:On Saturday, 23 August 2014 at 14:52:45 UTC, H. S. Teoh via Digitalmars-d wrote:[...]I notice that the coding style used for code examples on dlang.org isn't always consistent, and they generally differ from Phobos examples. Should we adopt Phobos style for all code examples on dlang.org?Do you have any specific examples? I'd assume the code is mostly old. I'd reject any pull that doesn't adhere to Phobos style, even if it's just ddoc'ed examples.Plenty. Just a few random examples: http://dlang.org/abi.html http://dlang.org/arrays.html http://dlang.org/attributes.html http://dlang.org/class.html http://dlang.org/index.html (!) The "violations" are mainly Egyptian braces, 2-space indentation, and a few missing closing braces. On Sat, Aug 23, 2014 at 03:41:03PM +0000, w0rp via Digitalmars-d wrote: [...]I think I'd recommend submitting pull requests to fix the examples to match current conventions, or making edits to wiki pages.I'm working on a dlang.org PR to fix the code examples. Still debating whether to submit them as separate PR's, or a single giant PR (esp. since I'm moving this week so won't have much time to work on this!). T -- I am a consultant. My job is to make your job redundant. -- Mr Tom
Aug 23 2014
On Saturday, 23 August 2014 at 14:52:45 UTC, H. S. Teoh via Digitalmars-d wrote:I notice that the coding style used for code examples on dlang.org isn't always consistent, and they generally differ from PhobosHow about making use of automatic indentation in this case? Are there any plans to make use of libdparse, Dscanner or DCD to implement this. Hackerpilot?
Aug 25 2014
On Monday, 25 August 2014 at 20:22:35 UTC, Nordlöw wrote:How about making use of automatic indentation in this case? AreOf course indentation isn't everything, and perhaps not the most important thing in this case...
Aug 25 2014