Re: Coding Standards

2011-07-18 Thread Jérôme M. Berger
Roman Ivanov wrote: > On 7/15/2011 12:46 PM, Walter Bright wrote: >> On 7/15/2011 7:25 AM, Trass3r wrote: >>> And there's lots of D code using that awkward >>> if () { >>> } >>> >>> style. Gross! >> I don't particularly like that style, either, but it's used in the ebook >> because display size is

Re: Coding Standards

2011-07-17 Thread Walter Bright
On 7/17/2011 2:09 PM, Andrej Mitrovic wrote: Hey Walter, you have a really kinky coding style!!: if() { yayStatement(); } That was born of the days of programming using 24 line tty's.

Re: Coding Standards

2011-07-17 Thread Andrej Mitrovic
On 7/15/11, Walter Bright wrote: > On 7/15/2011 7:25 AM, Trass3r wrote: >> And there's lots of D code using that awkward >> if () { >> } >> >> style. Gross! > > I don't particularly like that style, either, but it's used in the ebook > because > display size is extremely limited and it's more comp

Re: Coding Standards

2011-07-17 Thread Johann MacDonagh
On 7/17/2011 4:53 PM, bearophile wrote: Walter: bearophile: But not using a standard with a bit more energy will be one of the faults of D. There is a D style guide. I really don't understand what you're complaining about. This blog post is about Gofix, a Go standard library tool, it seem

Re: Coding Standards

2011-07-17 Thread bearophile
Walter: > bearophile: >> But not using a standard with a bit more energy will be one of the faults of >> D. > > There is a D style guide. I really don't understand what you're complaining > about. This blog post is about Gofix, a Go standard library tool, it seems one possible answer: http://b

Re: Coding Standards

2011-07-16 Thread Roman Ivanov
On 7/15/2011 12:46 PM, Walter Bright wrote: > On 7/15/2011 7:25 AM, Trass3r wrote: >> And there's lots of D code using that awkward >> if () { >> } >> >> style. Gross! > > I don't particularly like that style, either, but it's used in the ebook > because display size is extremely limited and it's

Re: Coding Standards

2011-07-16 Thread Andrew Wiley
On Fri, Jul 15, 2011 at 9:46 AM, Walter Bright wrote: > On 7/15/2011 7:25 AM, Trass3r wrote: > >> And there's lots of D code using that awkward >> if () { >> } >> >> style. Gross! >> > > I don't particularly like that style, either, but it's used in the ebook > because display size is extremely li

Re: Coding Standards

2011-07-15 Thread Walter Bright
On 7/15/2011 7:25 AM, Trass3r wrote: And there's lots of D code using that awkward if () { } style. Gross! I don't particularly like that style, either, but it's used in the ebook because display size is extremely limited and it's more compact.

Re: Coding Standards

2011-07-15 Thread Andrei Alexandrescu
On 7/15/11 10:09 AM, Russel Winder wrote: On Fri, 2011-07-15 at 16:25 +0200, Trass3r wrote: Am 15.07.2011, 09:53 Uhr, schrieb Jonathan M Davis: The brace on its own line and the line length limit need to be added as notes for Phobos, but I'm not sure that they really need to be put in the guide

Re: Coding Standards

2011-07-15 Thread Jonathan M Davis
On Friday 15 July 2011 16:09:06 Russel Winder wrote: > On Fri, 2011-07-15 at 16:25 +0200, Trass3r wrote: > > Am 15.07.2011, 09:53 Uhr, schrieb Jonathan M Davis : > > > The brace on its own line and the line length limit need to be added > > > as > > > notes for Phobos, but I'm not sure that they re

Re: Coding Standards

2011-07-15 Thread Jacob Carlborg
On 2011-07-15 12:55, Walter Bright wrote: On 7/14/2011 7:07 PM, bearophile wrote: But not using a standard with a bit more energy will be one of the faults of D. There is a D style guide. I really don't understand what you're complaining about. Probably that not enough people is using it and

Re: Coding Standards

2011-07-15 Thread Russel Winder
On Fri, 2011-07-15 at 16:25 +0200, Trass3r wrote: > Am 15.07.2011, 09:53 Uhr, schrieb Jonathan M Davis : > > The brace on its own line and the line length limit need to be added as > > notes for Phobos, but I'm not sure that they really need to be put in > > the guide > > Brace on its own line

Re: Coding Standards

2011-07-15 Thread Trass3r
Am 15.07.2011, 09:53 Uhr, schrieb Jonathan M Davis : The brace on its own line and the line length limit need to be added as notes for Phobos, but I'm not sure that they really need to be put in the guide Brace on its own line really should be put there. It adds a lot to the readability of n

Re: Coding Standards

2011-07-15 Thread Dmitry Olshansky
On 15.07.2011 16:13, Simen Kjaeraas wrote: On Fri, 15 Jul 2011 01:11:18 +0200, bearophile wrote: Mark Chu-Carroll is a first class programmer and more. He's leaving Google and writes about what's good in it. Here he explains in a very simple way why coding standards are

Re: Coding Standards

2011-07-15 Thread Simen Kjaeraas
On Fri, 15 Jul 2011 01:11:18 +0200, bearophile wrote: Mark Chu-Carroll is a first class programmer and more. He's leaving Google and writes about what's good in it. Here he explains in a very simple way why coding standards are good: http://scientopia.org/blogs/goodmath/2011/0

Re: Coding Standards

2011-07-15 Thread Walter Bright
On 7/14/2011 7:07 PM, bearophile wrote: But not using a standard with a bit more energy will be one of the faults of D. There is a D style guide. I really don't understand what you're complaining about.

Re: Coding Standards

2011-07-15 Thread Jonathan M Davis
On Friday 15 July 2011 15:36:45 KennyTM~ wrote: > On Jul 15, 11 10:07, bearophile wrote: > > Jonathan M Davis: > >> do not want to be forced to write code in someone else's style. As > >> long as people don't do completely crazy stuff with formatting, it's > >> generally easy enough to read code su

Re: Coding Standards

2011-07-15 Thread KennyTM~
On Jul 15, 11 10:07, bearophile wrote: Jonathan M Davis: do not want to be forced to write code in someone else's style. As long as people don't do completely crazy stuff with formatting, it's generally easy enough to read code such that the formatting really shouldn't be an issue. But Mark C

Re: Coding Standards

2011-07-14 Thread Russel Winder
On Thu, 2011-07-14 at 18:56 -0700, Walter Bright wrote: > On 7/14/2011 6:33 PM, Jonathan M Davis wrote: > > Personally, I do _not_ want to see any kind of official coding standard > > which > > tries to regulate formatting. > > http://digitalmars.com/d/2.0/dstyle.html > > The idea of the current

Re: Coding Standards

2011-07-14 Thread Jonathan M Davis
On Thursday 14 July 2011 22:07:03 bearophile wrote: > Jonathan M Davis: > > do not want to be forced to write code in someone else's style. As long > > as people don't do completely crazy stuff with formatting, it's > > generally easy enough to read code such that the formatting really > > shouldn'

Re: Coding Standards

2011-07-14 Thread bearophile
Jonathan M Davis: > do not want to be forced to write code in someone else's style. As long as > people don't do completely crazy stuff with formatting, it's generally easy > enough to read code such that the formatting really shouldn't be an issue. But Mark Chu-Carroll is very smart and expert

Re: Coding Standards

2011-07-14 Thread Walter Bright
On 7/14/2011 6:33 PM, Jonathan M Davis wrote: Personally, I do _not_ want to see any kind of official coding standard which tries to regulate formatting. http://digitalmars.com/d/2.0/dstyle.html The idea of the current D style guide is not to force anything on anyone, it's more of a default t

Re: Coding Standards

2011-07-14 Thread Jonathan M Davis
On 2011-07-14 16:11, bearophile wrote: > Mark Chu-Carroll is a first class programmer and more. He's leaving Google > and writes about what's good in it. Here he explains in a very simple way > why coding standards are good: > http://scientopia.org/blogs/goodmath/2011/07/14

Re: Coding Standards

2011-07-14 Thread Caligo
On Thu, Jul 14, 2011 at 6:11 PM, bearophile wrote: > Mark Chu-Carroll is a first class programmer and more. He's leaving Google > and writes about what's good in it. Here he explains in a very simple way why > coding standards are good: > http://scientopia.org/blogs/goo

Re: Coding Standards

2011-07-14 Thread Adam D. Ruppe
I'm fine with any coding standard. As long as it tells everyone else to follow my lead :)

Coding Standards

2011-07-14 Thread bearophile
Mark Chu-Carroll is a first class programmer and more. He's leaving Google and writes about what's good in it. Here he explains in a very simple way why coding standards are good: http://scientopia.org/blogs/goodmath/2011/07/14/stuff-everyone-should-do-part-2-coding-standards/ He

Re: LLVM Coding Standards

2011-04-15 Thread spir
On 04/15/2011 01:10 PM, Spacen Jasset wrote: As other posters have pointed out, it seems to me, at least, that having a way to express your model/idea or view of a problem directly is the most useful thing a language can give you. This is my definition of a good language :-) Denis -- _

Re: LLVM Coding Standards

2011-04-15 Thread Spacen Jasset
On 12/04/2011 11:21, Mafi wrote: Am 12.04.2011 00:31, schrieb Spacen Jasset: std::getline(is, line); while (line.size() != 0) { ...some things... std::getline(is, line); } What's wrong with while( std::getline(is, line), (line.size() != 0) ) { //... some things } I mean, that's what the comma

Re: LLVM Coding Standards

2011-04-12 Thread Klaim - Joël Lamotte
Hi, about early breaks/returns, it seems that might answer to a similar question is widely aproved, some maybe it's of interest : http://programmers.stackexchange.com/questions/58237/are-break-and-continue-bad-programming-practices/58253#58253 (about early breaks/return/continue) "When used at th

Re: LLVM Coding Standards

2011-04-12 Thread Nick Sabalausky
"spir" wrote in message news:mailman.3428.1302601845.4748.digitalmar...@puremagic.com... > On 04/11/2011 09:58 PM, spir wrote: >> I'm reading (just for interest) the LLVM Coding Standards at >> http://llvm.org/docs/CodingStandards.html. Find them very interesting

Re: LLVM Coding Standards

2011-04-12 Thread Nick Sabalausky
"Mafi" wrote in message news:io19ar$47h$1...@digitalmars.com... > Am 12.04.2011 00:31, schrieb Spacen Jasset: >> std::getline(is, line); >> while (line.size() != 0) >> { >> ...some things... >> std::getline(is, line); >> } > > What's wrong with > while( std::getline(is, line), (line

Re: LLVM Coding Standards

2011-04-12 Thread Mafi
Am 12.04.2011 00:31, schrieb Spacen Jasset: std::getline(is, line); while (line.size() != 0) { ...some things... std::getline(is, line); } What's wrong with while( std::getline(is, line), (line.size() != 0) ) { //... some things } I mean, that's what the comma operator is for.

Re: LLVM Coding Standards

2011-04-12 Thread spir
On 04/12/2011 03:15 AM, Daniel Gibson wrote: While I am on the subject, I've *always* thought major languages have > poor loop constructs: > > > (A) > > for (;;) > { > std::getline(is, line); > if (line.size() == 0) > break; > ...some things... > } > (...) > >

Re: LLVM Coding Standards

2011-04-12 Thread spir
On 04/12/2011 03:08 AM, Walter Bright wrote: On 4/11/2011 2:03 PM, bearophile wrote: it's very far from the C-style hairy code of DMD I'm overcompensating for being bald. Unfortunately, beeing bald does not seem to always help. While I'm nearly bald as well, I found the few pieces of dmd an

Re: LLVM Coding Standards

2011-04-12 Thread spir
On 04/12/2011 02:34 AM, Nick Sabalausky wrote: The last few years though, I've been finding that I *never* have any trouble grokking code due to early exits or continue (unless the code is already convoluted anyway). And I've also realized I find code that makes intelligent use of it to be much *

Re: LLVM Coding Standards

2011-04-12 Thread spir
you would be better of with more logically linear code as in the case of the early exit. Coding standards should probably just say: try and write readable code. Yes! Everyone knows what readable code looks like. No! It's a cultural issue. In C and C-derived languages, culture fav

Re: LLVM Coding Standards

2011-04-12 Thread spir
On 04/11/2011 09:58 PM, spir wrote: I'm reading (just for interest) the LLVM Coding Standards at http://llvm.org/docs/CodingStandards.html. Find them very interesting because their purposes are clearly explained. Below sample. I also love their note about n

Re: LLVM Coding Standards

2011-04-12 Thread Dmitry Olshansky
On 12.04.2011 2:31, Spacen Jasset wrote: On 11/04/2011 20:58, spir wrote: [slightly OT] Hello, I'm reading (just for interest) the LLVM Coding Standards at http://llvm.org/docs/CodingStandards.html. Find them very interesting because their purposes are clearly explained. Below sample.

Re: LLVM Coding Standards

2011-04-12 Thread Jacob Carlborg
On 2011-04-11 21:58, spir wrote: [slightly OT] Hello, I'm reading (just for interest) the LLVM Coding Standards at http://llvm.org/docs/CodingStandards.html. Find them very interesting because their purposes are clearly explained. Below sample. Denis === s

Re: LLVM Coding Standards

2011-04-11 Thread Don
Spacen Jasset wrote: While I am on the subject, I've *always* thought major languages have poor loop constructs: (A) for (;;) { std::getline(is, line); if (line.size() == 0) break; ...some things... } You have to call getline always at least once, then you need to test i

Re: LLVM Coding Standards

2011-04-11 Thread bearophile
Walter: > I'm overcompensating for being bald. *hands a Code Brush [TM]* :-) Bye, bearophile

Re: LLVM Coding Standards

2011-04-11 Thread Daniel Gibson
Am 12.04.2011 00:31, schrieb Spacen Jasset: > On 11/04/2011 20:58, spir wrote: >> [slightly OT] >> >> Hello, >> >> I'm reading (just for interest) the LLVM Coding Standards at >> http://llvm.org/docs/CodingStandards.html. Find them very interesting >

Re: LLVM Coding Standards

2011-04-11 Thread Nick Sabalausky
"Walter Bright" wrote in message news:io08sr$ouq$1...@digitalmars.com... > On 4/11/2011 2:03 PM, bearophile wrote: >> it's very far from the C-style hairy code of DMD > > I'm overcompensating for being bald. Heh. Now that's a classic line if I've ever heard one :)

Re: LLVM Coding Standards

2011-04-11 Thread Nick Sabalausky
eople like to follow rules, that is as soon as they have > internalised them and made them their own. What this means is that they > often then follow them to a fault, and you get deeply nested, but > "structured" code, where instead you would be better of with more >

Re: LLVM Coding Standards

2011-04-11 Thread Walter Bright
On 4/11/2011 2:03 PM, bearophile wrote: it's very far from the C-style hairy code of DMD I'm overcompensating for being bald.

Re: LLVM Coding Standards

2011-04-11 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:invnce$2mfr$4...@digitalmars.com... > On 4/11/11 2:58 PM, spir wrote: >> [slightly OT] >> >> Hello, >> >> I'm reading (just for interest) the LLVM Coding Standards at >> http://llvm.org/docs/Codin

Re: LLVM Coding Standards

2011-04-11 Thread Spacen Jasset
On 11/04/2011 20:58, spir wrote: [slightly OT] Hello, I'm reading (just for interest) the LLVM Coding Standards at http://llvm.org/docs/CodingStandards.html. Find them very interesting because their purposes are clearly explained. Below sample. Denis That seem all fairly sensible. It

Re: LLVM Coding Standards

2011-04-11 Thread bearophile
Andrei: > Heh heh heh. This is bound to annoy many a dinosaur. And they even > didn't need to pull the exceptions argument! I find the LLVM C++ source code readable and sometimes even elegant for being C++ (it's very far from the C-style hairy code of DMD, despite sometimes DMD is a little mor

Re: LLVM Coding Standards

2011-04-11 Thread Iain Buclaw
== Quote from spir (denis.s...@gmail.com)'s article > [slightly OT] > Hello, > I'm reading (just for interest) the LLVM Coding Standards at > http://llvm.org/docs/CodingStandards.html. Find them very interesting because > their purposes are clearly explained. Below sam

Re: LLVM Coding Standards

2011-04-11 Thread Andrei Alexandrescu
On 4/11/11 2:58 PM, spir wrote: [slightly OT] Hello, I'm reading (just for interest) the LLVM Coding Standards at http://llvm.org/docs/CodingStandards.html. Find them very interesting because their purposes are clearly explained. Below sample. Denis === s

LLVM Coding Standards

2011-04-11 Thread spir
[slightly OT] Hello, I'm reading (just for interest) the LLVM Coding Standards at http://llvm.org/docs/CodingStandards.html. Find them very interesting because their purposes are clearly explained. Below sample. Denis === sample === Use Early Exit