[Issue 16771] Depreciation of implicit string concatenation in 2.072

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Nov 24 20:50:19 PST 2016


https://issues.dlang.org/show_bug.cgi?id=16771

Sprink <sprink.noreply at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sprink.noreply at gmail.com

--- Comment #1 from Sprink <sprink.noreply at gmail.com> ---
Adding exceptions to a rule just makes the language even more complicated, with
very little benefit.



(In reply to Joseph M Rice from comment #0)
> I actually have to complain about this whole thing. In C/C++, Java, C# and
> virtually every programming language based on the C syntax allows for
> implicit string concatenation.   
> 
> Allowing this to be depreciated you are making the D language harder to use.
> 
> the rationale for the reasoning for why all of sudden we have to start using
> ~ to break up long strings so that the code is readable is quite frankly
> Bullshit!
>
> There is a huge difference between Array assignment and single string
> assignment.  How about you revert the changes in 2.072 and re-implement to
> fix the actual problem, which is solely with array assignment and look for
> '[' ']' characters to not allow implicit string concatenation.  
> 
> At this point 2.072 is not usable, and I would appreciate not having to fix
> ~20,000 lines of code to add '~' everywhere.   Not to mention you just broke
> almost every dub library I use as well.


Adding an exception to the rule will just make it more complicated. With very
little benefit. In your example, you can just add "~" to the end of the line to
split the long string.

string aReallyLongString = "this is a really long string that will" 
                           "not look good on the page if it put on"
                           " a single line";

// vs

string aReallyLongString = "this is a really long string that will"~
                           "not look good on the page if it put on"~
                           " a single line";

I don't think it'll be that difficult to correct. It's only a deprecation right
now, that doesn't mean the feature is removed. I doubt there's 20k lines of
strings as well. You could probably write a regex to fix most of the
occurrences.

--


More information about the Digitalmars-d-bugs mailing list