From: Arne Vajhøj on 23 May 2010 19:30 On 23-05-2010 14:53, Rhino wrote: > Lew<noone(a)lewscanon.com> wrote in news:hta0s6$dmk$1(a)news.albasani.net: >> I strongly advise you, again!, to stick with SSCCEs until you stop >> making that kind of mistake. That you have not learned your lesson >> about posting uncompilable code is starting to make you look careless >> and lazy. >> > Honestly, I think you're being just a little too rigid now. > > I was trying to get across the idea that, at first glance, Map<String, > Locale> sorted Locales = new SortedMap<String, Locale>() might be > something I would CONSIDER writing to address the suggestion that was > made to me. I was trying to get across the idea that these statements all > start to look alike and interchangeable at some point, at least to me. I > know that this is not actually the case but it SEEMS like it sometimes. > Fundamentally, I'm just expressing frustration with myself that it isn't > more intuitive by now which of these statements is the one to use and > which ones don't even make sense. > > I know (now) that the statement in question wouldn't actually compile or > make sense and I didn't actually try to compile it anywhere. It was > strictly a hypothetical and I truly think it is reasonable to toss out a > hypothetical now and again even if it is only to dismiss it very quickly > as the responders rightly did. I will continue to do that - very > sparingly I expect - and do so at my own peril. Maybe some of you will > disgusted with me for doing so and stop responding to me. If so, that's > life. I'll do what penance is needed to get back into everyone's good > graces or move on to some other discussion group if I have to. The problem with pseudo code outlines is that there are no well-defined syntax and semantics for it. So you can not communicate efficiently with other, because you may think X means one thing, but the readers may think X means something else. Java has a well-defined syntax and semantics that makes it unambiguous for communication. And if there are any doubt then the compiler and the JLS well help sort it out. Posting pseudo-code that is very similar to Java is very very bad, because that quickly changes the topic of discussion from your real problem to the syntax errors. Arne
From: Jeff Higgins on 23 May 2010 19:35 On 5/23/2010 7:30 PM, Arne Vajh�j wrote: > The problem with pseudo code outlines is that there are > no well-defined syntax and semantics for it. > > So you can not communicate efficiently with other, because > you may think X means one thing, but the readers may > think X means something else. > > Java has a well-defined syntax and semantics that makes > it unambiguous for communication. And if there are any > doubt then the compiler and the JLS well help sort it out. > > Posting pseudo-code that is very similar to Java is very > very bad, because that quickly changes the topic of > discussion from your real problem to the syntax errors. > Thank you.
From: Lionel on 28 May 2010 18:26 On 22/05/10 10:14, Arne Vajh�j wrote: > On 21-05-2010 19:23, Rhino wrote: >> Arne Vajh�j<arne(a)vajhoej.dk> wrote in > But no methods > 3 lines is not good either. public class SomeContainer { int attribute1; int attribute2; bool isAttribute3; public SomeContainter() { attribute1 = 0; attribute2 = 0; isAttribute3 = false; } public void setAttribute1(final int newValue) { attribute1 = newValue; } public void setAttribute2(final int newValue) { attribute2 = newValue; } public void setIsAttribute3(final bool newValue) { isAttribute3 = newValue; } public int getAttribute1() { return attribute1; } public int getAttribute2() { return attribute2; } public int isAttribute3() { return isAttribute3; } } ???
From: Arne Vajhøj on 28 May 2010 20:34 On 28-05-2010 18:26, Lionel wrote: > On 22/05/10 10:14, Arne Vajh�j wrote: >> On 21-05-2010 19:23, Rhino wrote: >>> Arne Vajh�j<arne(a)vajhoej.dk> wrote in >> But no methods > 3 lines is not good either. > > public class SomeContainer { > int attribute1; > int attribute2; > bool isAttribute3; > > public SomeContainter() { > attribute1 = 0; > attribute2 = 0; > isAttribute3 = false; > } > > public void setAttribute1(final int newValue) { > attribute1 = newValue; > } > > public void setAttribute2(final int newValue) { > attribute2 = newValue; > } > > public void setIsAttribute3(final bool newValue) { > isAttribute3 = newValue; > } > > public int getAttribute1() { > return attribute1; > } > > public int getAttribute2() { > return attribute2; > } > > public int isAttribute3() { > return isAttribute3; > } > } > > ??? Yes. It is a very bad application. No logic at all. Due to no main method, then i can not even be ran. :-) Arne
From: Lew on 28 May 2010 23:16
Arne Vajhøj wrote in >> But no methods > 3 lines is not good either. Lionel wrote [a good example of Arne's point]: > public class SomeContainer { > int attribute1; > int attribute2; > bool isAttribute3; > > public SomeContainter() { > attribute1 = 0; > attribute2 = 0; > isAttribute3 = false; > } You don't even need this constructor. > public void setAttribute1(final int newValue) { > attribute1 = newValue; > } Getters and setters model attributes, not behaviors. Arne's comment applied to behaviors. > public void setAttribute2(final int newValue) { > attribute2 = newValue; > } > > public void setIsAttribute3(final bool newValue) { > isAttribute3 = newValue; > } > > public int getAttribute1() { > return attribute1; > } > > public int getAttribute2() { > return attribute2; > } > > public int isAttribute3() { > return isAttribute3; > } > } > > ??? Exactly, "???". What are you supposed to do with this class? -- Lew |