python vs d

Chris via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 07:35:02 PDT 2014


On Wednesday, 30 April 2014 at 11:46:32 UTC, Nick Sabalausky 
wrote:
> On 4/30/2014 6:16 AM, "Ola Fosheim Grøstad" 
> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>> On Wednesday, 30 April 2014 at 08:52:48 UTC, Chris wrote:
>>> In D you can do this:
>>>
>>> if (mode == "TEST") {  // Second block added later
>>> if (x == 1) {  // First block
>>> writeln("Hurray!");
>>> }
>>> }
>
> Yea, I do that all the time for debugging...*deliberately* 
> since it makes it trivial to spot the temporary testing code. A 
> language shouldn't get in my way just because it made a false 
> assumption about my workflow.

Yep. Good to know I'm not the only one who does this all the time 
:-)

>>
>> I think Go did the right thing by not requiring the redundant
>> parantheses on the if statement and perhaps also by allowing 
>> the
>> omission of semicolons where appropriate etc. Room for improved
>> legibility right there.
>>
>
> Personally, I find Go's reduced parens and such to make it 
> noticeably harder to read. There's less for my eyes to lock 
> onto when visually parsing/scanning. YMMV of course.



More information about the Digitalmars-d mailing list