D vs nim

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 14 03:09:14 PDT 2015


On Tuesday, 14 April 2015 at 06:31:08 UTC, Jadbox wrote:
>> btw : I think D should get rid off un-bracketed if statement, 
>> program king is not about sparing the number of lines...but 
>> that’s again a matter of taste.
>
> I'm that guy on the other side of the fence. I view unbracked 
> IFs as an essential part of concise code readability. Brackets 
> are the symbolization of a block of logic, meaning multiple 
> steps of logic. Being forced to express "this is a block of 
> code" for just a single statement after an IF seems bloaty and 
> hurts scanning through code. I also feel reducing line numbers 
> is something to strive for as long as no readability is 
> sacrifices.

+1. I personally think that whenever you use unbracketed if the 
statement should be on the same line as the if - but that should 
be checked by configurable style-checkers, not by the compiler.

I also don't like the idea of introducing these kinds of breaking 
changes when the language is supposed to be stable. Enforcing 
some best practices from the beginning of the language is 
beneficial, since I can be sure all code written in that language 
uses these best practices. But if such best practices are 
introduced when the language claims to be stable, forcing me to 
go all over my project to make sure it complies to it, and then 
forking some of the dependencies' repositories so I can do the 
same with them(only this time it's code that I'm unfamiliar with) 
- I'll seriously consider if migrating my project to a more 
stable language might actually be less work in the long run, 
considering that more breaking changes like this might be 
introduced in the future.


More information about the Digitalmars-d mailing list