Conversation
|
Thanks for your pull request, @bbasile! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some things that can help to speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. |
|
Please don't do this. Explicitly initializing declarations may be "useless" from the compiler's POV, but they are important for readers of the code to understand intent. We should not blindlty remove these documentations of intent just for questionable "savings" of not generating extra AST nodes. I object to this change. |
|
@quickfur, i understand and i have no special interest into seeing the PR merged. The fact is that i used phobos to improve a d-scanner plugin and now I'm happy to see that it covers 99.7 % of the cases and only errors on.. well 0.3... That being said, there are inconsistencies in the way people init or not. For example: size_t consumed;
- size_t element = 0;
+ size_t element;
|
|
Thanks for the effort, but I'm fairly sure this is not a change we want. |
|
@bbasile Writing an initializer to a default value is not "in case the compiler will randomly fail to initialize it". It is a documentation of intent; it's saying "I am explicitly setting this variable to this value, so pay attention, code reader, because this is important". Declaring a variable without an initializer is saying "x is a variable, it's not important what its initial value is". Nobody writing D code is "afraid" that the compiler won't initialize the value properly; this is D, not C, after all. It's about conveying intent to whoever reads the code. |
|
I was not trying to be polite. If you don't care about it, then so be it. |
No description provided.