From: Thomas 'PointedEars' Lahn on 18 Jan 2010 17:53 Scott Sauyet wrote: > Thomas 'PointedEars' Lahn wrote: >> nick wrote: >>> During the display routine, Box will draw itself according to Top and >>> Left. The spinner control will show "Value" in a text box. >>> Now, say vSpinner.Value and myBox.Top point at the same int, >> Nothing points to an int. Same value does not mean same memory >> location. > > In any language? You know what I mean. >>> and hSpinner.Value and myBox.Left point at the same value... >> This is rather insane application design. Either one property is >> superfluous or it should have a getter that retrieves the other >> property's value. > > Not if you need to be able to use spinners and boxes independently of > one another. Why not a Spinner class that takes an int pointer in one > of its constructors? It could be used like this: > > Spinner vSpinner = new Spinner(myBox.Top); > > What is fundamentally wrong with this? Nothing. You miss the point. >>> and lets say you can drag Box around, which will modify its Top and >>> Left properties. Spinning the spinners will now move the box, moving >>> the box will update the spinners, and everything is kept in sync. There >>> you have it, useful pointers to primitive types in OOP. I hope that >>> example helps? >> >> No, your example is bogus. The primitive value that the property holds >> can be easily modified with modifying the property value directly, with >> user- defined setters of *the object that is the owner of the property*. >> That is, the method that modifies the property value should _not_ be a >> method of the value but of *the object that has it as a property*. > > What do you mean by "bogus"? Do you simply think that this is a poor > design that a programmer should not implement, or that it is so > egregious that the language should not support it? It is poor design, to say the least. > C++ certainly supports this pattern. A burning match supports that you hold it right below your hand. > [...] > But if you are arguing a matter of programming taste, I am not. I have made my argument, now you only need to recognize it. > perhaps your tone should be somewhat less peremptory. Perhaps you should talk less and read more. PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tm Berners-Lee
From: Scott Sauyet on 18 Jan 2010 18:03 On Jan 18, 5:53 pm, Thomas 'PointedEars' Lahn <PointedE...(a)web.de> wrote: > Perhaps you should talk less and read more. Me? LOL -- Scott
From: nick on 18 Jan 2010 19:41 On Jan 18, 5:53 pm, Thomas 'PointedEars' Lahn <PointedE...(a)web.de> wrote: > Scott Sauyet wrote: > > Thomas 'PointedEars' Lahn wrote: > ... > > What is fundamentally wrong with this? > > Nothing. You miss the point. > No. You missed the point. More like avoided it, in fact. > > > C++ certainly supports this pattern. > > A burning match supports that you hold it right below your hand. > You missed the point. A few lines of example code demonstrating a basic programming concept is not a demonstration of a pattern. > > [...] > > But if you are arguing a matter of programming taste, > > I am not. I have made my argument, now you only need to recognize it. > > > perhaps your tone should be somewhat less peremptory. > > Perhaps you should talk less and read more. > Perhaps you should talk less toss some *JavaScript* code in a console somewhere to see what it actually does before you make all kinds of assumptions based on things you read. I don't care who you are, half of what you said in this thread was downright incorrect, not useful, negative, and generally unappealing. Pretty much the only useful things you have contributed were pointed out by Garrett in like 2 lines of text (thanks Garrett). In fact I'll reiterate them here; the main problems with this are (1) Object.prototype is off-limits due to 'in' and (2) nobody likes $ in the identifier. Thanks for pointing out some of the minor details in your original post, I guess, but really your tone is quite rude. Also, you missed the point. > PointedEars > -- > Anyone who slaps a 'this page is best viewed with Browser X' label on > a Web page appears to be yearning for the bad old days, before the Web, > when you had very little chance of reading a document written on another > computer, another word processor, or another network. -- Tm Berners-Lee .. <----- The point ----------------------------------------------> D:< You -- Nick
First
|
Prev
|
Pages: 1 2 3 4 Prev: knowing what and when to feature test Next: iscontenteditable browser support |