June 03, 2011
Incidentally I did write a feature request for some new constraint syntax, it wasn't shot down but it wasn't discussed all that much. But now that I look at it again my problem wasn't really the syntax, but the error messages.
June 03, 2011
Andrej Mitrovic:

> as a templated function gets several
> constraints it's impossible to figure out which constraint failed just
> by looking at the error message. The only thing you ever get back is:
> "<complex template declaration> does not match any function template
> declaration"
> "<complex template declaration> cannot deduce template function from
> argument types <your arguments here>"
> 
> You get to see which arguments you've passed, but not which of the constraints failed. If you wrote the template it might be easy to figure out that you can't pass a certain type of argument, but if you didn't write it it's hard to figure out what went wrong.

This is a problem that I've discussed some in past. I think it's worth discussing some more about a possible way to add user defined error messages (like the second argument of a static assert) to template constraints. To do this it's good to have first of all a short list of typical use cases where we'd like to add some messages.

Bye,
bearophile
June 03, 2011
On 6/4/2011 12:36 AM, Matthew Ong wrote:
> On 6/3/2011 11:16 AM, Mehrdad wrote:
>
Alternatively, D might want to use some kind of voting tool online on yahoo to help vote for syntax that programmer really wants.
A simple solution to the long like JCP process in Java.

If the aim is to grow D into a large community, popular hated syntactic sugar counts!!! Plain old fact.

How did people in Java overcome the need of new syntactic sugar and still keep the some original bytecode design?
See this URL:
http://www.javac.info/closures-v05.html

Example. The variable declaration
{int,String=>Number throws IOException} xyzzy;
is *translated into*
interface Function1<R,A2,throws E> { // system-generated
    R invoke(int x1, A2 x2) throws E;
}
Function1<? extends Number,? super String,? extends IOException> xyzzy;

Original syntax kept, original binary generated is also kept. No changes
to the JVM and NO changes to the API.

Just overcome that with the compilation and linking process. Just a 'simpleton' suggestion, yes?

Just ensure someone filter the list on new feature, so that it will meet:
to consistently *do the right thing* within the constraints it chose

My dear 'friends', this is like deciding what is the best official language in a world conference. Not possible.

IT world tried once with XML protocol and look at the end results?
Not a total failure, but went further and further away from that original goal.

Then JSON, BSON, YAML... so on and so on...

Did Java XML talk transparently with C# or C++ XML?

See a software developers common thinking pattern here?
D need to open up and tries to see how to pick the syntax people
like.

I am just citing an example in english, it could have been french/spanish/...
I am sure, before poetry format are created in the past for english
language, the same content can be communicated via point form sentences.
But poetry is formed because it also communicate more beautifully,
emotion can be attached to the content?

That my 'friend' is the syntactic sugar in the human language.

Hopefully you understand what the current direction of the programming
language seems to be going?

-- 
Matthew Ong


June 03, 2011
On Fri, 03 Jun 2011 12:36:20 -0400, Matthew Ong <ongbp@yahoo.com> wrote:

> On 6/3/2011 11:16 AM, Mehrdad wrote:
>
>  >But it's also tiresome to continually argue the same things over and  >over with new people.  I think this is just the way things are, and  >will always be.
> Have you ever wonder why that pops up over and over again by your own
> experience?

It depends on the problem.  If the problem has a conclusive negative answer, it's just annoying.  If it's something that seems promising but we could not find a way to implement it, or we already implemented it some other way, then it can be difficult to convince someone to reopen it.

Take for instance rebindable const object references.  Walter steadfastly refused to look at any possible new suggestions because he had already expended so much time trying to find a syntax that worked and was not confusing.  I still feel there is a possible syntax that would work, and that it's a feature we need.  Michel Fortin's patch for it seems like the only possible way to get this through with Walter, we'll see how it works out.  But yes, there are cases where something is a good idea, but it is difficult to get people to listen to your ideas because they have too much bad blood with it.

> Perhaps people knows that is the useful syntax? Nope,
> the world changed in the last 3-4 years, and shocked a lot of people.

Again, if you have new ideas that people haven't seen before or haven't tried before, it's always worth trying to see if people will accept them.  When you see "we tried that already, and it doesn't work" it's a good idea to stop right there (although a thorough explanation is usually more appreciated).

> Past does not define the future. Just like C++ people mocked at Java 1.0
> or Java mocked at C# does not mean those idea are alll bad?

I hate salmon.  Every time I go out to eat with my parents and my father gets salmon, he tries to get me to eat it saying "yeah, I know you don't like salmon, but this is different, this is really good".  And any time I try it, I still hate it.

If someone says "we tried that *EXACT* thing in the past, and it doesn't work" you are basically wasting your time arguing that you have some new interesting way to get it to work.  BTW, D has a lot of ideas that came from Java and C#, we are not against them.

> The only constant in history is: Past does not define the future.

No, the only constant is people who ignore history are bound to repeat it.

-Steve
June 03, 2011
On 6/4/2011 1:32 AM, Steven Schveighoffer wrote:

> But yes, there are cases where something is a good idea, but
> it is difficult to get people to listen to your ideas because they have
> too much bad blood with it.
Suggest that those bad blood get some time off to think about the issue.

>
>> Perhaps people knows that is the useful syntax? Nope,
>> the world changed in the last 3-4 years, and shocked a lot of people.
>> Past does not define the future. Just like C++ people mocked at Java 1.0
>> or Java mocked at C# does not mean those idea are alll bad?
> I hate salmon. Every time I go out to eat with my parents and my father
> gets salmon, he tries to get me to eat it saying "yeah, I know you don't
> like salmon, but this is different, this is really good". And any time I
> try it, I still hate it.
Here you are talking about food which is a single personal choice that does
NOT impact the rest of the community. We are talking about the other way around.
Single or small group of people's choice that DOES impacting the entire D community. Unless we are talking about being a iron curtain style management, EVEN that has changed.

>> The only constant in history is: Past does not define the future.
>
> No, the only constant is people who ignore history are bound to repeat it.
In this case, both.

Sometime, repeating the history, get things changed. Most people need linear time to 'sink' in the idea.


-- 
Matthew Ong

June 03, 2011
On Fri, 03 Jun 2011 13:50:49 -0400, Matthew Ong <ongbp@yahoo.com> wrote:

> On 6/4/2011 1:32 AM, Steven Schveighoffer wrote:
>
>> But yes, there are cases where something is a good idea, but
>> it is difficult to get people to listen to your ideas because they have
>> too much bad blood with it.
> Suggest that those bad blood get some time off to think about the issue.

Good ideas aren't always accompanied by good or obvious designs.  The point I was making is, you need to have a very solid "oh, obviously that is better!" design in those cases in order to re-open the issue, even if the core ideas are solid.

>
>>
>>> Perhaps people knows that is the useful syntax? Nope,
>>> the world changed in the last 3-4 years, and shocked a lot of people.
>>> Past does not define the future. Just like C++ people mocked at Java 1.0
>>> or Java mocked at C# does not mean those idea are alll bad?
>> I hate salmon. Every time I go out to eat with my parents and my father
>> gets salmon, he tries to get me to eat it saying "yeah, I know you don't
>> like salmon, but this is different, this is really good". And any time I
>> try it, I still hate it.
> Here you are talking about food which is a single personal choice that does
> NOT impact the rest of the community. We are talking about the other way around.

The point is, if something doesn't work, "trying it again" isn't going to make it work the next time.

What I see in your past proposals are personal choices that will affect everyone in the community, almost all of which are happy with the current state of things.  It's not a good place to start from.  If you want to tackle a problem that affects a lot of people, you will definitely get better reception, and if you can do it in a way that doesn't break existing code, you will be even further.

> Single or small group of people's choice that DOES impacting the entire D community. Unless we are talking about being a iron curtain style management, EVEN that has changed.

Not accepting bad designs does not mean management is ruling with an iron curtain.  Propose better designs, you'll get a better response.  Again, you can't base all this on one failed proposal.  If you have a legitimate argument, you will get better results.  Listening to the community doesn't mean obeying every request that gets submitted.

>
>>> The only constant in history is: Past does not define the future.
>>
>> No, the only constant is people who ignore history are bound to repeat it.
> In this case, both.
>
> Sometime, repeating the history, get things changed. Most people need linear time to 'sink' in the idea.

Really?  That goes against all logic I can think of.  Isn't the definition of insanity doing the same thing over and over again, but expecting different results?

What you need to do in this case is *avoid* repeating history.  Don't have the same failed arguments over and over, you will get nowhere.

-Steve
June 03, 2011
On 6/3/11 12:22 PM, Matthew Ong wrote:
> On 6/4/2011 12:36 AM, Matthew Ong wrote:
>> On 6/3/2011 11:16 AM, Mehrdad wrote:
>>
> Alternatively, D might want to use some kind of voting tool online on
> yahoo to help vote for syntax that programmer really wants.
> A simple solution to the long like JCP process in Java.
>
> If the aim is to grow D into a large community, popular hated syntactic
> sugar counts!!! Plain old fact.
>
> How did people in Java overcome the need of new syntactic sugar and
> still keep the some original bytecode design?
> See this URL:
> http://www.javac.info/closures-v05.html
>
> Example. The variable declaration
> {int,String=>Number throws IOException} xyzzy;
> is *translated into*
> interface Function1<R,A2,throws E> { // system-generated
> R invoke(int x1, A2 x2) throws E;
> }
> Function1<? extends Number,? super String,? extends IOException> xyzzy;
>
> Original syntax kept, original binary generated is also kept. No changes
> to the JVM and NO changes to the API.
>
> Just overcome that with the compilation and linking process. Just a
> 'simpleton' suggestion, yes?

Although I'm sure you don't mean it, this is a manipulation because it vaguely associates your argument with an obviously good example. Then by extension that implies that your argument has value on its own.

The above is called lowering, and D uses it extensively. "lowering" is present in TDPL's index with five referring pages. The value of syntactic sugar is understood and we provide it to the best extent we can. That doesn't mean any suggestion for syntactic sugar is good, and it doesn't mean that not accepting such is a sign of narrow-mindedness of the community.

> Just ensure someone filter the list on new feature, so that it will meet:
> to consistently *do the right thing* within the constraints it chose
>
> My dear 'friends', this is like deciding what is the best official
> language in a world conference. Not possible.
>
> IT world tried once with XML protocol and look at the end results?
> Not a total failure, but went further and further away from that
> original goal.
>
> Then JSON, BSON, YAML... so on and so on...
>
> Did Java XML talk transparently with C# or C++ XML?
>
> See a software developers common thinking pattern here?
> D need to open up and tries to see how to pick the syntax people
> like.
>
> I am just citing an example in english, it could have been
> french/spanish/...
> I am sure, before poetry format are created in the past for english
> language, the same content can be communicated via point form sentences.
> But poetry is formed because it also communicate more beautifully,
> emotion can be attached to the content?
>
> That my 'friend' is the syntactic sugar in the human language.
>
> Hopefully you understand what the current direction of the programming
> language seems to be going?

Mehrdad made a sensible suggestion, and just as sensibly understood the issues that surround it. The fact that you refuse to do so, and instead are falling increasingly in a self-reassuring pattern, does not speak well about your competence. If I were you, I'd abandon this increasingly disorganized rant, and thought of how I can improve the quality of my proposals and contributions.


Thanks,

Andrei
June 04, 2011
== Quote from Andrei Alexandrescu (SeeWebsiteForEmail@erdani.org)'s article
> On 6/3/11 12:22 PM, Matthew Ong wrote:
> > On 6/4/2011 12:36 AM, Matthew Ong wrote:
> >> On 6/3/2011 11:16 AM, Mehrdad wrote:
> >>
> > Alternatively, D might want to use some kind of voting tool online on
> > yahoo to help vote for syntax that programmer really wants.
> > A simple solution to the long like JCP process in Java.
> >
> > If the aim is to grow D into a large community, popular hated syntactic sugar counts!!! Plain old fact.
> >
> > How did people in Java overcome the need of new syntactic sugar and
> > still keep the some original bytecode design?
> > See this URL:
> > http://www.javac.info/closures-v05.html
> >
> > Example. The variable declaration
> > {int,String=>Number throws IOException} xyzzy;
> > is *translated into*
> > interface Function1<R,A2,throws E> { // system-generated
> > R invoke(int x1, A2 x2) throws E;
> > }
> > Function1<? extends Number,? super String,? extends IOException> xyzzy;
> >
> > Original syntax kept, original binary generated is also kept. No changes to the JVM and NO changes to the API.
> >
> > Just overcome that with the compilation and linking process. Just a 'simpleton' suggestion, yes?
> Although I'm sure you don't mean it, this is a manipulation because it
> vaguely associates your argument with an obviously good example. Then by
> extension that implies that your argument has value on its own.
> The above is called lowering, and D uses it extensively. "lowering" is
> present in TDPL's index with five referring pages. The value of
> syntactic sugar is understood and we provide it to the best extent we
> can. That doesn't mean any suggestion for syntactic sugar is good, and
> it doesn't mean that not accepting such is a sign of narrow-mindedness
> of the community.
> > Just ensure someone filter the list on new feature, so that it will meet: to consistently *do the right thing* within the constraints it chose
> >
> > My dear 'friends', this is like deciding what is the best official language in a world conference. Not possible.
> >
> > IT world tried once with XML protocol and look at the end results? Not a total failure, but went further and further away from that original goal.
> >
> > Then JSON, BSON, YAML... so on and so on...
> >
> > Did Java XML talk transparently with C# or C++ XML?
> >
> > See a software developers common thinking pattern here?
> > D need to open up and tries to see how to pick the syntax people
> > like.
> >
> > I am just citing an example in english, it could have been
> > french/spanish/...
> > I am sure, before poetry format are created in the past for english
> > language, the same content can be communicated via point form sentences.
> > But poetry is formed because it also communicate more beautifully,
> > emotion can be attached to the content?
> >
> > That my 'friend' is the syntactic sugar in the human language.
> >
> > Hopefully you understand what the current direction of the programming language seems to be going?
> Mehrdad made a sensible suggestion, and just as sensibly understood the
> issues that surround it. The fact that you refuse to do so, and instead
> are falling increasingly in a self-reassuring pattern, does not speak
> well about your competence. If I were you, I'd abandon this increasingly
> disorganized rant, and thought of how I can improve the quality of my
> proposals and contributions.
> Thanks,
> Andrei


Interesting... I just saw the continuation of this thread, and wanted to make some meta-comments (I guess this should be on meta.digitalmars.com, haha):


I admittedly didn't bother to check whether my suggestion was made before. Sorry. :(

Question: Why?

Answer:   Because it's really hard to search for it, and it gets really annoying past the Nth time you try to. The *only* useful way I know of for searching is to add "site:digitalmars.com" in
my Google query, which gets _really_ annoying to type after a while... and it doesn't help that the results aren't always on the mark (although it's hard to say anybody is at fault here). So I
just stopped bothering to do that a while ago (sorry) and didn't really bother checking whether my suggestion was already made.

But, on the other side of things, if I was on a newsgroup where newbies repeated the same suggestions over and over again, I'd get pretty annoyed myself. I think it's natural, and ultimately, a
lot of this boils down to the inability to search the newsgroup effectively (or perhaps my lack of knowledge on how to do that effectively, if I haven't found the right way to do it).

Ultimately, I'm not sure myself what the fix for this would be. The only thing I've found found to be AMAZINGLY useful is StackOverflow's automatic search based on the title (while you're typing
your own question), but that's not exactly easy to implement well, and I'm not sure if that's a reasonable thing to expect for this site, at least in the short term. I'm not sure what the
solution is, but _some_ easy way to search the newsgroups would DEFINITELY make duplicate suggestions by newbies less likely, IMHO.

Possible ideas for improvement:
1. Better searching on the newsgroup
2. Allow for categorization of posts somehow (although that's kinda against how newsgroups work, I guess...)
3. Something better that I can't think of



Again, I'm not blaming anybody or anything, just noting why duplicate and/or not-so-great ideas sometimes get posted (IMO).
Hope this feedback is useful. :)

Mehrdad
June 04, 2011
On 6/4/2011 12:20 PM, Mehrdad wrote:

>meta-comments (I guess this should be on meta.digitalmars.com, haha):
:) :)

> But, on the other side of things, if I was on a newsgroup where newbies repeated the same suggestions over and over again, I'd get pretty annoyed myself. I think it's natural, and ultimately, a
> lot of this boils down to the inability to search the newsgroup effectively (or perhaps my lack of knowledge on how to do that effectively, if I haven't found the right way to do it).
They suggested to use thunderbird, but they does not know, some coparation network does not allow newsgroup protocol and only HTTP/S from laptop.

>The only thing I've found found to be AMAZINGLY useful is StackOverflow's automatic search based on the title (while you're typing
your own question)
I will like that a lot also.


-- 
Matthew Ong
email: ongbp@yahoo.com

June 04, 2011
On 6/4/2011 2:10 AM, Steven Schveighoffer wrote:

> Again, you can't base all this on one failed proposal.
I am assuming you are referring to this string switch topic:

http://download.java.net/jdk7/docs/technotes/guides/language/strings-switch.html

I am sure they would have talked about the pro and cons already?

That suggestion is ahead of this java 7 implementation of only static string value.

>*Sometime* (not all the time), repeating the history, get things changed. Most people need linear time to 'sink' in the idea.
This should speak for itself clearly.

>Walter steadfastly
I never pointed at Walter, I read some of his paper from his home page.

>If you have a legitimate argument, you will get better results. Listening to the community doesn't mean obeying every request that gets submitted.
Totally agree about this. Which is why I suggested this:

Alternatively, D might want to use *some kind of voting tool online* on yahoo (group, missing) to help vote for syntax that programmer really wants. A simple solution to the long like JCP process in Java.

Web base open voting with clear results viewed. Or else, who knows what
has already been suggested and voted on for the next version of DMD?

>The point is, if something doesn't work, "trying it again" isn't going to make it work the next time.
I understand that, I went offline for a week plus to see if someone with more solid case to present and is similar or inline with the
proposal that presented. No point being the lone person voicing out?

>Single or small group of people's choice that DOES impacting the entire D community.
I know most of them are not from digital mars.

>a iron curtain style management, EVEN that has changed.
But they do voice out like one.

> Good ideas aren't always accompanied by good or obvious designs.  The
> point I was making is, you need to have a very solid "oh, obviously that
> is better!" design in those cases in order to re-open the issue, even if
> the core ideas are solid.

>What I see in your past proposals are personal choices that will affect everyone in the community,
That is normal for all mankind to make a preference of choices,
some think english is good because of Shakespear, chinese is good
because of LiBai, and yet others,

>What you need to do in this case is *avoid* repeating history.
Actually, I cited that example to highlight the point of:
to consistently *do the right thing* within the constraints it chose

In programming and *most*(not all) thing in life.
As not possible. Unless you claim to know all possible path of future.
That mentality is in itself self-contradictory. Since, it is constrained.

It is more like recovering from the error that you make and solutions
found and kept.

Java 1.4 to 1.5, James Gosling also had the mind set of trying
to keep things as simple as possible. M$ proved otherwise with C#.
It is an industrial factual history. M$ did the right choice in this aspect and captured a large set of developer.

Hopefully this makes a clear solid point as shown here.
>The point I was making is, you need to have a very solid "oh, obviously that is better!"

I am not talking about "auto" anymore, but the process of reviewing
new suggestions and improvement.

-- 
Matthew Ong
email: ongbp@yahoo.com