digitalmars.D - What is Invariant Good For?
- Walter Bright (1/1) Aug 01 2008 http://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_g...
- Bruce Adams (18/19) Aug 02 2008 I disagree with the suggestion that immutable is a better choice than
- Jesse Phillips (9/31) Aug 02 2008 I would like to agree with you here, on the mutable and 'dibblego' point...
- Walter Bright (4/11) Aug 02 2008 His post missed the point of the article by focusing on the definition
- Sean Kelly (28/39) Aug 02 2008 But words represent concepts... generally very specific ones. It's why
- Walter Bright (3/5) Aug 02 2008 It's hard to find 3 people to agree on any one word for constant. I
- Derek Parnell (17/23) Aug 02 2008 Isn't this also because we are trying to use simple words to express sub...
- Walter Bright (2/8) Aug 02 2008 Exactly. The rest is arguing about the color of the bicycle shed.
- Manfred_Nowak (8/9) Aug 03 2008 A problem is, that your article refers to "existing terminology
- Walter Bright (5/11) Aug 03 2008 The thing is, nobody has actually been confused about the meaning of
- Sean Kelly (5/16) Aug 03 2008 I disagree. The meaning of 'const' is quite clear in D 1.0. At
- Bruce Adams (16/32) Aug 03 2008 Actually its quite the reverse. In normal usage (insert your definition
- Paul D. Anderson (7/44) Aug 03 2008 All true, but the keywords that are most controversial are ones that are...
- Walter Bright (4/8) Aug 03 2008 I guarantee it that if "invariant" is changed to something else, an
- JMNorris (6/15) Aug 04 2008 I like "invariant". The expression "invariant variable" has a satisfyin...
- Russell Lewis (2/4) Aug 04 2008 I've thought about "invariable" from time to time. :)
- Bruno Medeiros (12/62) Aug 11 2008 Although I think 'immutable' is preferable over 'invariant', I only
- Peter C. Chapin (9/10) Aug 02 2008 For what it's worth, I agree with some of the posts on the article
- Knud Soerensen (7/21) Aug 03 2008 I agree invariant also leads my thoughts into other things.
- Koroskin Denis (3/23) Aug 03 2008 Nice idea but... I wouldn't sign up for the site just for a vote. Sorry.
- Knud Soerensen (6/38) Aug 03 2008 The site uses openid, so if you already have a openid you can just
- Nick Sabalausky (3/41) Aug 05 2008 I avoid openid.
- Wyverex (7/8) Aug 04 2008 not here to fight the term or meaning but I think short words should be
http://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/
Aug 01 2008
On Fri, 01 Aug 2008 20:52:26 +0100, Walter Bright <walter nospamm-digitalmars.com> wrote:http://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/I disagree with the suggestion that immutable is a better choice than invariant. To me, perhaps still wrongly in a C++ mindset, mutable and immutable are in terms of the clients ability to modify the data whereas invariant data is invariant in the normal sense because it implies a contract. Namely that X(t+n) == X(t=0) for at least the duration of any function using X. It strikes me that 'dibblego' is some kind of troll or an extreme pedant from a parallel experience. I'm not sure how much communicating with it is educational. I understand all the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude. Regards, Bruce.
Aug 02 2008
On Sat, 02 Aug 2008 11:42:32 +0100, Bruce Adams wrote:On Fri, 01 Aug 2008 20:52:26 +0100, Walter Bright <walter nospamm-digitalmars.com> wrote:d_what_is_invariant_good_for/http://www.reddit.com/r/programming/comments/6ui1q/I disagree with the suggestion that immutable is a better choice than invariant. To me, perhaps still wrongly in a C++ mindset, mutable and immutable are in terms of the clients ability to modify the data whereas invariant data is invariant in the normal sense because it implies a contract. Namely that X(t+n) == X(t=0) for at least the duration of any function using X. It strikes me that 'dibblego' is some kind of troll or an extreme pedant from a parallel experience. I'm not sure how much communicating with it is educational. I understand all the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude. Regards, Bruce.I would like to agree with you here, on the mutable and 'dibblego' point. Everything 'dibblego' says is done in a way that he uses many big words that he understands the meaning for, but fits them together in a way that is incorrect but sounds like it is an undeniable truth. I have only come across this such graceful tactic once before, the true trolls, Jerry Lee Cooper http://jerryleecooper.com/ a fan blog of his great work.
Aug 02 2008
Bruce Adams wrote:It strikes me that 'dibblego' is some kind of troll or an extreme pedant from a parallel experience. I'm not sure how much communicating with it is educational. I understand all the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude.His post missed the point of the article by focusing on the definition of a word. At some point, who cares what the word is, it's the concept that matters.
Aug 02 2008
== Quote from Walter Bright (newshound1 digitalmars.com)'s articleBruce Adams wrote:But words represent concepts... generally very specific ones. It's why writing poetry is so darn hard. But more to the point, what if this D program: void main() { void fn( int x ) { writefln( x ); } const int x = 5; void delegate() d = &fn; fn(); } Were this instead: blue main() { blue fn( fast x ) { writefln( x ); } querulous skinflint x = V; blue refrigerator() d = &fn; fn(); } Same concepts, same syntax, but could you convince anyone to use the language? SeanIt strikes me that 'dibblego' is some kind of troll or an extreme pedant from a parallel experience. I'm not sure how much communicating with it is educational. I understand all the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude.His post missed the point of the article by focusing on the definition of a word. At some point, who cares what the word is, it's the concept that matters.
Aug 02 2008
Sean Kelly wrote:Same concepts, same syntax, but could you convince anyone to use the language?It's hard to find 3 people to agree on any one word for constant. I might as well have used "refrigerator" to mean invariant.
Aug 02 2008
On Sat, 02 Aug 2008 19:00:41 -0700, Walter Bright wrote:Sean Kelly wrote:Isn't this also because we are trying to use simple words to express subtly different concepts. One concept is of something that, once it has been given a value, can *never* have that value changed during the life of the program, and another is that of something that cannot have its value changed in certain circumstances, such as by a specific function or during a specific period of time, etc ... Simple words will never suffice, so we may as well use words which are approximately right and just learn to associated them with their exact meaning. Arguing over 'const' 'immutable', 'invariant', 'constant', 'constrained', 'fixed', 'final', 'hard', 'shell-encrusted-soft-core', ... is pretty much a waste of precious time. It really does not matter; just pick something, define it, and go with it. -- Derek Parnell Melbourne, Australia skype: derek.j.parnellSame concepts, same syntax, but could you convince anyone to use the language?It's hard to find 3 people to agree on any one word for constant. I might as well have used "refrigerator" to mean invariant.
Aug 02 2008
Derek Parnell wrote:Simple words will never suffice, so we may as well use words which are approximately right and just learn to associated them with their exact meaning. Arguing over 'const' 'immutable', 'invariant', 'constant', 'constrained', 'fixed', 'final', 'hard', 'shell-encrusted-soft-core', ... is pretty much a waste of precious time. It really does not matter; just pick something, define it, and go with it.Exactly. The rest is arguing about the color of the bicycle shed.
Aug 02 2008
Walter Bright wrote:I might as well have used [...]A problem is, that your article refers to "existing terminology confusion"---then more of the same should be avoided. -manfred -- Maybe some knowledge of some types of disagreeing and their relation can turn out to be useful: http://blog.createdebate.com/2008/04/07/writing-strong-arguments/
Aug 03 2008
Manfred_Nowak wrote:Walter Bright wrote:The thing is, nobody has actually been confused about the meaning of invariant as applied to data, as opposed to class invariants. In contrast, what 'const' means when applied to data has plenty of existing confusion.I might as well have used [...]A problem is, that your article refers to "existing terminology confusion"---then more of the same should be avoided.
Aug 03 2008
== Quote from Walter Bright (newshound1 digitalmars.com)'s articleManfred_Nowak wrote:I disagree. The meaning of 'const' is quite clear in D 1.0. At least for me :p And while I understand the redefinition of 'const' in D 2.0, it's not intuitive given its use in D 1.0. SeanWalter Bright wrote:The thing is, nobody has actually been confused about the meaning of invariant as applied to data, as opposed to class invariants. In contrast, what 'const' means when applied to data has plenty of existing confusion.I might as well have used [...]A problem is, that your article refers to "existing terminology confusion"---then more of the same should be avoided.
Aug 03 2008
On Sun, 03 Aug 2008 02:52:10 +0100, Sean Kelly <sean invisibleduck.org> wrote:== Quote from Walter Bright (newshound1 digitalmars.com)'s articleActually its quite the reverse. In normal usage (insert your definition of normal here) words have several grey, slightly overlapping and fuzzy meanings. And that's ignoring the synonyms and sounds-a-likes. Its only when you try to write in a so called technical English that meanings get narrowed down and eve then it doesn't take much to find a confusing alternate meaning for them. As programmers we are uniquely blessed/cursed with 'words' that mean precisely one thing when passed to a specific compiler in a certain context. :-) Regards, Bruce.Bruce Adams wrote:But words represent concepts... generally very specific ones. It's why writing poetry is so darn hard.It strikes me that 'dibblego' is some kind of troll or an extremepedantfrom a parallel experience. I'm not sure how much communicating with it is educational. Iunderstandall the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude.His post missed the point of the article by focusing on the definition of a word. At some point, who cares what the word is, it's the concept that matters.
Aug 03 2008
Bruce Adams Wrote:On Sun, 03 Aug 2008 02:52:10 +0100, Sean Kelly <sean invisibleduck.org> wrote:All true, but the keywords that are most controversial are ones that are overloaded to mean different things in different contexts. The best example is "enum". Walter correctly observes that, from a compiler designer's point of view, a list of enumerated values is the same as a "manifest constant", so he re-uses the keyword. To a programmer (or at least this progammer) the two things are conceptually different, used for different reasons. I find the usage confusing. This sort of thing is common when you put engineers in charge of the user interface. The aspects of the problem that are important to the implementation are paramount to the implementer and it's easy to lose sight of the fact that the user doesn't care. What's intuitive to the user is not what's intuitive to the designer. "Invariant" has a specific meaning to programmers with respect to contracts. "Invariant" as Walter uses it is the same, but different. It is illuminating that those who commented on Walter's article focussed on the keyword and not on the concept. It's the intuition of the designer not matching the intuition of the user again. I know we went round and round regarding this keyword and Walter's right -- at some point you just have to make a decision and go with it. But when there's so much complaint about the decision it may be time to reconsider. Paul== Quote from Walter Bright (newshound1 digitalmars.com)'s articleActually its quite the reverse. In normal usage (insert your definition of normal here) words have several grey, slightly overlapping and fuzzy meanings. And that's ignoring the synonyms and sounds-a-likes. Its only when you try to write in a so called technical English that meanings get narrowed down and eve then it doesn't take much to find a confusing alternate meaning for them. As programmers we are uniquely blessed/cursed with 'words' that mean precisely one thing when passed to a specific compiler in a certain context. :-) Regards, Bruce.Bruce Adams wrote:But words represent concepts... generally very specific ones. It's why writing poetry is so darn hard.It strikes me that 'dibblego' is some kind of troll or an extremepedantfrom a parallel experience. I'm not sure how much communicating with it is educational. Iunderstandall the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude.His post missed the point of the article by focusing on the definition of a word. At some point, who cares what the word is, it's the concept that matters.
Aug 03 2008
Paul D. Anderson wrote:I know we went round and round regarding this keyword and Walter's right -- at some point you just have to make a decision and go with it. But when there's so much complaint about the decision it may be time to reconsider.I guarantee it that if "invariant" is changed to something else, an alternate set of people will rise and say it's now screwed up :-) because, in reality, there is no right answer.
Aug 03 2008
Walter Bright <newshound1 digitalmars.com> wrote in news:g75lsg$1j2o$1 digitalmars.com:Paul D. Anderson wrote:I like "invariant". The expression "invariant variable" has a satisfyingly oxymoronic ring to it. :-) -- JMNorrisI know we went round and round regarding this keyword and Walter's right -- at some point you just have to make a decision and go with it. But when there's so much complaint about the decision it may be time to reconsider.I guarantee it that if "invariant" is changed to something else, an alternate set of people will rise and say it's now screwed up :-) because, in reality, there is no right answer.
Aug 04 2008
JMNorris wrote:I like "invariant". The expression "invariant variable" has a satisfyingly oxymoronic ring to it. :-)I've thought about "invariable" from time to time. :)
Aug 04 2008
Paul D. Anderson wrote:Bruce Adams Wrote:Although I think 'immutable' is preferable over 'invariant', I only think it's *slightly* preferable, and don't have much of a beef with 'invariant'. I would reckon much of the rest of the community also doesn't mind 'invariant'. The real beef was 'const', that a lot of people (myself included) thought it wasn't very adequate and other alternatives such as 'readonly' were preferred. But frankly, I cant' say this is an issue on the top list of things that I find troublesome in D. -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#DOn Sun, 03 Aug 2008 02:52:10 +0100, Sean Kelly <sean invisibleduck.org> wrote:All true, but the keywords that are most controversial are ones that are overloaded to mean different things in different contexts. The best example is "enum". Walter correctly observes that, from a compiler designer's point of view, a list of enumerated values is the same as a "manifest constant", so he re-uses the keyword. To a programmer (or at least this progammer) the two things are conceptually different, used for different reasons. I find the usage confusing. This sort of thing is common when you put engineers in charge of the user interface. The aspects of the problem that are important to the implementation are paramount to the implementer and it's easy to lose sight of the fact that the user doesn't care. What's intuitive to the user is not what's intuitive to the designer. "Invariant" has a specific meaning to programmers with respect to contracts. "Invariant" as Walter uses it is the same, but different. It is illuminating that those who commented on Walter's article focussed on the keyword and not on the concept. It's the intuition of the designer not matching the intuition of the user again. I know we went round and round regarding this keyword and Walter's right -- at some point you just have to make a decision and go with it. But when there's so much complaint about the decision it may be time to reconsider. Paul== Quote from Walter Bright (newshound1 digitalmars.com)'s articleActually its quite the reverse. In normal usage (insert your definition of normal here) words have several grey, slightly overlapping and fuzzy meanings. And that's ignoring the synonyms and sounds-a-likes. Its only when you try to write in a so called technical English that meanings get narrowed down and eve then it doesn't take much to find a confusing alternate meaning for them. As programmers we are uniquely blessed/cursed with 'words' that mean precisely one thing when passed to a specific compiler in a certain context. :-) Regards, Bruce.Bruce Adams wrote:But words represent concepts... generally very specific ones. It's why writing poetry is so darn hard.It strikes me that 'dibblego' is some kind of troll or an extremepedantfrom a parallel experience. I'm not sure how much communicating with it is educational. Iunderstandall the terms he's using but none of the meanings he is ascribing to them. And calling you a pseudo intellectual for no obvious reason strikes me as very troll-like not to mention rude.His post missed the point of the article by focusing on the definition of a word. At some point, who cares what the word is, it's the concept that matters.
Aug 11 2008
Walter Bright wrote:http://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/For what it's worth, I agree with some of the posts on the article itself that "immutable" would be a better word to describe this concept than "invariant." I've done some functional programming and I immediately understand what immutable means (and why it is good). With invariant I had to read about it first. The word invariant makes me think of class invariants and loop invariants... a somewhat different concept. Peter
Aug 02 2008
Peter C. Chapin wrote:Walter Bright wrote:I agree invariant also leads my thoughts into other things. Walter says in a comments that there is alot of momentum behind invariant. To verify that I have made a poll, please vote and let us see http://jyte.com/cl/immutable-would-be-better-than-invariant-in-the-d-programming-language -- http://crowdnews.eu - Promote yourself and your friends!http://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/For what it's worth, I agree with some of the posts on the article itself that "immutable" would be a better word to describe this concept than "invariant." I've done some functional programming and I immediately understand what immutable means (and why it is good). With invariant I had to read about it first. The word invariant makes me think of class invariants and loop invariants... a somewhat different concept. Peter
Aug 03 2008
On Sun, 03 Aug 2008 14:33:55 +0400, Knud Soerensen <4tuu4k002 sneakemail.com> wrote:Peter C. Chapin wrote:Nice idea but... I wouldn't sign up for the site just for a vote. Sorry.Walter Bright wrote:I agree invariant also leads my thoughts into other things. Walter says in a comments that there is alot of momentum behind invariant. To verify that I have made a poll, please vote and let us see http://jyte.com/cl/immutable-would-be-better-than-invariant-in-the-d-programming-languagehttp://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/For what it's worth, I agree with some of the posts on the article itself that "immutable" would be a better word to describe this concept than "invariant." I've done some functional programming and I immediately understand what immutable means (and why it is good). With invariant I had to read about it first. The word invariant makes me think of class invariants and loop invariants... a somewhat different concept. Peter
Aug 03 2008
Koroskin Denis wrote:On Sun, 03 Aug 2008 14:33:55 +0400, Knud Soerensen <4tuu4k002 sneakemail.com> wrote:The site uses openid, so if you already have a openid you can just login. A lot of big sites provide openids, so you might already have one see here http://openid.net/get/ -- Crowdnews.eu - a social news site based on sharing instead of voting.Peter C. Chapin wrote:Nice idea but... I wouldn't sign up for the site just for a vote. Sorry.Walter Bright wrote:I agree invariant also leads my thoughts into other things. Walter says in a comments that there is alot of momentum behind invariant. To verify that I have made a poll, please vote and let us see http://jyte.com/cl/immutable-would-be-better-than-invariant-in-the-d-programming-languagehttp://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/For what it's worth, I agree with some of the posts on the article itself that "immutable" would be a better word to describe this concept than "invariant." I've done some functional programming and I immediately understand what immutable means (and why it is good). With invariant I had to read about it first. The word invariant makes me think of class invariants and loop invariants... a somewhat different concept. Peter
Aug 03 2008
"Knud Soerensen" <4tuu4k002 sneakemail.com> wrote in message news:g746ne$2468$1 digitalmars.com...Koroskin Denis wrote:I avoid openid.On Sun, 03 Aug 2008 14:33:55 +0400, Knud Soerensen <4tuu4k002 sneakemail.com> wrote:The site uses openid, so if you already have a openid you can just login. A lot of big sites provide openids, so you might already have one see here http://openid.net/get/ -- Crowdnews.eu - a social news site based on sharing instead of voting.Peter C. Chapin wrote:Nice idea but... I wouldn't sign up for the site just for a vote. Sorry.Walter Bright wrote:I agree invariant also leads my thoughts into other things. Walter says in a comments that there is alot of momentum behind invariant. To verify that I have made a poll, please vote and let us see http://jyte.com/cl/immutable-would-be-better-than-invariant-in-the-d-programming-languagehttp://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/For what it's worth, I agree with some of the posts on the article itself that "immutable" would be a better word to describe this concept than "invariant." I've done some functional programming and I immediately understand what immutable means (and why it is good). With invariant I had to read about it first. The word invariant makes me think of class invariants and loop invariants... a somewhat different concept. Peter
Aug 05 2008
Walter Bright wrote:http://www.reddit.com/r/programming/comments/6ui1q/d_what_is_invariant_good_for/not here to fight the term or meaning but I think short words should be used, faster to type, shorter lines, less likely to miss type. Just like we used const in place of constant. Just my $.02 invar = invariant sync = synchronized -Wyv
Aug 04 2008