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-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 === sample

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. Denis

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 naming

Re: LLVM Coding Standards

2011-04-12 Thread spir
On 04/12/2011 12:31 AM, Spacen Jasset wrote: I think that people 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

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
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... } (...) Instead you

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 Nick Sabalausky
Mafi m...@example.org 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),

Re: LLVM Coding Standards

2011-04-12 Thread Nick Sabalausky
spir denis.s...@gmail.com 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 because

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

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 Exits

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 === sample

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 sample. Denis === sample

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 more

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 also

Re: LLVM Coding Standards

2011-04-11 Thread Nick Sabalausky
Andrei Alexandrescu seewebsiteforem...@erdani.org 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/CodingStandards.html. Find them very

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
Spacen Jasset spacenjas...@yahoo.co.uk wrote in message news:invvmu$7ha$1...@digitalmars.com... That seem all fairly sensible. It also reminds me of open source projects written in C, where GOTO is used, like so: HANDLE handle1 = open(...); ... if (out_of_memory) goto cleanup; if

Re: LLVM Coding Standards

2011-04-11 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com 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 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 because their purposes are clearly explained. Below sample

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 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