Advertisement
Nickname
vincent
Registered since:
November 13, 2002
Short bio:
Software analyst / programmer / designer / developer (whatever you want to call it) for about 20 years.
Home page:
 
Total posts:
724

Forum posts by Vincent O'Sullivan:

49 pages [ Previous 1 ... 35 36 37 38 39 40 41 42 43 44 45 Next ]
Posted in Weblogs Forum, Feb 24, 2004, 9:14 PM
By aspiring to Ghandi's famous edict: "Be the change you're trying to create."Nevertheless, if I had time to go and rewrite all the code that other's had written and I though I could improve, whilst still meeting my own deadlines then there'd be something seriously wrong with the deadlines. Not to mention the sheer vanity (and vainness) of...
Posted in Weblogs Forum, Feb 24, 2004, 10:45 AM
One assertion per test! Read this and weep.In another thread I recently posted an example of a small unit test from from I project I recently joined. Here's another (bigger but by no means the biggest). Is it a comprehensive test? Could be, but it's only one of several similar and overlapping tests in this particular TestCase. Am I going to...
Posted in Java Answers Forum, Feb 20, 2004, 10:06 AM
mmm unit tests using JUnit. That seems to imply that they're up to speed on some of the latest techniques... or does it? One thing the JUnit documentation emphasises is that, if a test passes then that's all you need to know. Green line and all that. Here's a typical test method (one of hundreds): public void testFunctionConstructor() {...
Posted in Weblogs Forum, Feb 9, 2004, 1:08 PM
> Can getBar() return null? How would you know> unless there were some javadocs or comments. While I> think javadocs and comments are useful, I hate depending> on them to communicate intent. >> Choosing good names is just one small aspect of writing> clean code -- but it's a very imporant one. > > I will labor over names, changing them again...
Posted in Java Answers Forum, Feb 6, 2004, 5:49 AM
> Something to help you on your way> > http://www.refactoring.com/> > Best of luck with that.> AdamYes indeed. I think Mr Fowler has given me a job for life.There's lots of this sort of thing...if (x > 10) { if (x { if (someOtherCondition) { doA; doB; doC; doD; } else { doA; doB; doC; doE; } } } But at least the code works, so I don't have to...
Posted in Java Answers Forum, Feb 5, 2004, 5:03 PM
> Here is an example that helped me understand polymorphism.> Imagine that you have a class called Animal which in turn> n has several subclasses - say Dog, Cat and Bird. All of> the classes have a speak() method (this is critical).It's not actually critical that all the derived classes override the speak() method in the Animal class. In...
Posted in Java Answers Forum, Feb 5, 2004, 3:30 PM
...not so much a question as an observation.I've just started my first paying java work in over two years. While IDs and JDEs are being sorted out they gave me a copy of a class to look, so I pulled it up in TextPad.First Impressions:-- The class runs to about 4,000 lines.-- The largest single method is over 700 lines, another at over 600 lines...
Posted in Java Answers Forum, Feb 5, 2004, 3:17 PM
Just looking at an answer to another question where someone had written JRE where I would have written JVM got me wondering.Are the terms Java Runtime Environment (JRE) and Java Virtual Machine(JVM) synonymous? If not, what is one referring to that the other doesn't.Vince.
Posted in Java Answers Forum, Jan 26, 2004, 12:08 PM
> Being a VB programmer by day...Two years ago, as a direct result of the September 11 fallout, the (UK) company I work for had to can over 90% of its IT projects. Mine - a Java based project - was one of the first to go. Fortunately, I fould a position on a VB project almost immediately and have been hanging in there ever since (doing VB and...
Posted in Java Answers Forum, Jan 24, 2004, 10:40 AM
Hi Sachin,No special focus, really. I was just knocking out a bit of code out the other day that included a loop that repeatedly calculated a value and stored the lowest found. Being a VB programmer by day, I tend to have an unhealthy coding style that is neither VB nor Java approved. In this case I initially wroteif (n { min = n; } else { min...
Posted in Weblogs Forum, Jan 21, 2004, 10:36 AM
This is sad news indeed. JavaWorld was one of the first Java forums that I subscribed to. For a period of time the "Hints and Tips" section appeared to be able to read my mind and had an uncanny ability to post solution to problems that I had been working on myself (splash screens, type safe enumeration), or had avoided altogether (cut, copy,...
Posted in Java Answers Forum, Jan 20, 2004, 12:01 PM
Wator
Posted in Java Answers Forum, Jan 19, 2004, 5:25 PM
> The entire code for Math.min is as followspublic static int min(int a, int b) { return (a } Good point. Although it's obvious afterwards, it hadn't occurred to me to open up the Math.min method to see what it does. I had just assumed its implementation was internal within the JVM rather than remembering that it's a library function.Vince.
Posted in Java Answers Forum, Jan 19, 2004, 3:04 PM
I'm sure it's mostly a question of style but:Given two ints (n and min), which of the lines below would you use to update min (if it is greater than n)?if (n Vince.
Posted in Weblogs Forum, Jan 19, 2004, 6:17 AM
> There is a reason for the synch blocks> :> (at least, that's the only reason I can think of)Exactly the point of the original article. Even after analysing the code it is not possible to determine for certain why it is doing what it is doing. A quick comment might easily have resolved the situation, if only to demonstrate a mismatch between...
49 pages [ Previous 1 ... 35 36 37 38 39 40 41 42 43 44 45 Next ]
Advertisement