A few general thoughts

lenochware lenochware at gmail.com
Fri Apr 29 01:30:59 PDT 2011


This post is in fact mainly about removing delete, but I didn't wont make
everyone angry just with title.:) I am sure not expert to language design, so
I should probably be quiet, but I have question.
My question is: Didn't break it (i.e. removing delete) compatibility?

In my opinion every decision have both bad and good sides, which should be
carefully weighted. (I hope that you can understand me, because english is not
my native language)

For me, backward compatibility is important issue. I am sure that this topic
was discussed here many times, but I want just say that I vote for more
careful way to make changes in language. It is even more important for young
language, I believe, because many libraries and tools can stay incompatible
for long time. For example I am not using D2.0, because I have incompatible
libraries in my project and it seems it cannot be fixed easy way.
What about mark features to remove as "deprecated" and write warning by
compiler, if they are used? So feature would be really removed after some time
in next version, and people would be informed this way and have time to
prepare your code or discuss change.

I am not against breaking compatibility entirely, but it should be compensated
with really significant improvement.

Another thing with bad and good sides is "dangerous" feature, as was mentioned
for delete. In my opinion more safety means often more restrictive language
(and now I am speaking in general, not about
"delete"). For example C gives you big freedom, but it is very dangerous.
Modern languages are much more restrictive. But sometimes I prefer dangerous
feature (if it is not "too dangerous"), which give me more freedom. Because
even smartest language designer cannot see all real situations possible and
restriction which cannot be disabled can be very annoying. Example:

I was not happy with error message "invalid utf8 character". I am using
international character in my strings and compiler gives me this message. Of
course, I can switch my source codes into utf8, but here are few tricks which
can be done with plain ascii. I draw characters in graphic, using OpenGl by
calling glCallLists(somestring.length, somestring.ptr);
It will take somestring as array of indexes of displaylists where each
displaylist will draw one character and his id=ascii code. But because this
restriction it is not possible. And it is error, not
warning and cannot be disabled ANY WAY (as far as I know). You can say: Blah,
utf8 is generally good thing, and this is minor unimportant issue, but I want
just illustrate that restriction can create unexpected problems and that's
because I like if I have choice.
(And again this was not about delete or utf8, but general thougth)

Sorry for long post.


More information about the Digitalmars-d mailing list