This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Simon Roberts

+ Follow
since Oct 24, 2000
Simon likes ...
Scala Netbeans IDE Java Ubuntu Linux
Denver, Colorado
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Simon Roberts

My publisher told me that they're having a sale through 12/31

Offer: Save 65% on Video and Simulators Save 40% on books, ebooks, and practice tests

Enter to win Kindle fire 8HD (32 GB) + 2,000 in Cisco Press / Pearson IT Certification Learning.

Cisco Press:

2 years ago
This help?

Tim Cooke wrote:

Campbell Ritchie wrote:A hoofed panda

I don't get it.

2 years ago
This clearly went to sleep a while ago, and has many very imaginative answers. I also don't know what you deem "elegant", but I didn't notice the "obvious" (I could have missed it, given so many) among them (which I hope has the merit of being readily understood by junior programmers, something I think we tend to undervalue in the corporate world!). Herewith, and hoping I didn't misunderstand the requirements:

2 years ago
Hmm, can't work out how to edit that, but please send Breanne email at

Sorry about the confusion!

2 years ago
Ahhhh whoops, that's embarrassing, I just assumed the link had what was needed. Sigh!

I have asked how she'd prefer to be contacted... I'll post that as soon as she gets back to me.

2 years ago
Hi all,

A colleague of mine at Oracle is looking for people who would like to write material for an Oracle blog and asked me if I could share this message here on JavaRanch. I hope it's OK to post this here, but here is her message:


My name is Breanne Wilson. I'm the editor of the Oracle University blog:

We're looking for Java related content to help educate our technical audience. I'd like to invite you to guest post on our blog.

You can of course link directly back to your website or LinkedIn Profile within the post. We will also share the guest post on our Facebook page, which has over 94,000 followers, as well as our Twitter, which has 36,000+ followers.

Please let me know if you're interested.

Thank you!

2 years ago

Campbell Ritchie wrote:As long as you don't breach that important principle:-

If it ain't broke, don't fix it.

But as a counterpoint--if it's messy, hard to understand, inflexible, low performance, or unscalable, it might very well be "broke" even if it works properly ;)

However, to the original point, I have it on reliable authority (Mark Reinhold) that more than half the effort involved in creating a new version of Java goes into ensuring it's backward compatible. You might come across something that doesn't work, but a) that's pretty darn rare, and b) it's quite likely that your code used something that wasn't "recommended" in the first place.

I have one piece of code that's caused me trouble, and that was using a pre-released version of transparent windows in Java 6. The code specifically used classes in packages sun.blahblah, rather than exclusively using java... and javax...

So, yeah, try it, you might like it.

And, you might even find you can get directly to Java 9, though I've not kept up so can't comment with confidence on whether things like the command line might change for that.

Hi all,

If you're thinking of getting certified, and you would like a pretty cool T shirt into the bargain (OK, I think it's cool, because it has Duke on it now would be a good time to push ahead:

Oracle's Certification T Shirt

Good luck!
Indeed, certainly the discussions that ensued regarding all the possible interpretations were probably far more valuable than the single question in isolation.

Anyway, I hope you're enjoying the guide (btw, this might have no relevance for you since you said explicitly that you were studying for the Java 7 version of the exam, but I did release a Java 8 exam study guide that's an update of what you're watching. Both are available on O'Reilly's SafariBooks site, as well as through Pearson's InformIT, although Safari doesn't offer the quiz questions (it's a books platform, not a "training" platform per-se).

Good luck with the test, and happy studying in the meantime.

The question asks for the value of d, not b.

Interesting question, however. It serves as a good reminder that it's really easy to mislead a candidate. In this case, the answers being labeled a, b, c, d, and the variables being the same, undoubtedly lent confusion.

On the one hand, I apologize, I didn't intend to "trick" you. On the other hand, such insane attention to detail is indeed a necessary part of the exam. I will say that I think the Oracle exams went through a patch of being less candidate-friendly than they should have been. But I know that a new (returned to the team after long absence) manager has taken over the development of these exams, and she, like I, is very anxious to improve this aspect. I know that the Java 8 Programmer II exam is much improved in that respect.

All that said, attention to detail behooves a programmer--I can't count how many times I've spent hours saying "that can't happen" about some behavior (bug!) only to discover that what I'd written wasn't actually what I thought I'd written, and what I'd been "reading" all along

Anyway, hope this helps.

Thanks for the heads-up Roel! (I'd give you a cow as a thank you if I had one--but hey, it's the thought that counts, right?)

Sean Corfield wrote:If your process changes, you need to modify your objects. If your data changes, you need to modify your objects. But with either kind of change, you're changing your fundamental building blocks in a way that is intertwined.

While hoping to keep this on the topic of FP, I have to say that seems to reflect what I see as one of the most common errors in typical OO implementations. Mixing _business_ process with domain entities. Very wrong, but fantastically common. Heck, even the "FP for the rest of us" (or something like that) article that's cited in a useful post in this forum blatantly makes that error when the author suggests that the only reason that adapter and facade are different patterns might be to fulfill a page-count requirement in the contract! Failure to factor out the unrelated (how the business uses customers, accounts, etc, is a totally different concern from "being an account") is nearly universal. Unfortunately, I see that our teaching institutions--from universities on down to the shop-floor--fail to teach "why" we do things in particular ways in OO, only teaching "what to do" which is a near useless recipe. I also think that the reusability thing was surely overblown. Maintainability is the promise that is more relevant, and should be achievable if we'd only approach it right.

But, that's not what I'm hoping to get a discussion about--rather I'm still hoping our visiting author will find time (amongst what are surely a great many questions demanding long, complex, answers!) to put his $0.03 in on the original question.

(oops, and on that basis, I'm still parsing the rest of your comments. I suspect this might not be the kind of question that can be addressed without several weeks of examples!)
One of the things I've long held regarding software design starts with the idea that some aspects of a problem domain are more stable than others. For example, in a typical business system, business domain entities like Customer, Invoice, Product, have significantly more stability than business processes such as how to process a sale. Now, if one arranges that the fundamental building blocks of the software are the more stable parts, then there's a better chance the software will have sufficient flexibility to allow growth and change over time. This notion suggests to me that OO, carefully applied (which is a lot rarer in the real world than one might hope!), makes good sense for business systems, but that procedural design might make more sense for software that models systems where the "business processes" are intrinsically stable (such as computational problems in physics, where presumably the process--the laws of physics--are totally stable).

Assuming you accept a useful degree of merit in that position (which is of course very briefly stated, and not "black vs. white" anyway, so you might reasonably not), then would you care to comment, with that as a backdrop, on how you see the flexibility of functional software designs? Keep in mind, if you would, that while I'm completely comfortable with some ideas of FP (specifically functions as first-class elements of a language, higher order functions, partial application, currying, immutable data, and in particular, the notion of functions that take functions as arguments and return modified functions as results) and I was writing LISP 30+ years ago, I do not claim to be an FP practitioner. Consequently, it might be helpful if you could include some level of examples; what you would do to achieve flexibility, alongside why you see any given technique or approach as providing flexibility.

Hope that rather rambling question makes some sense, I look forward to any insight you can share.
Welcome, and congratulations. Getting a book out is always a major achievement!
Gach, my friend who works there just asked me to mention it. Didn't realize it wasn't new, sorry! Ah well, at least it got a bump
3 years ago
Hi, y'all might know this already, but I didn't see a post, sorry if this is duplicate. Anyway, Oracle has a "special" on certification.

Hope it might help some of you.

I understand that although the code makes it look like it's specific to upgrade exams, it's not restricted like that. It's good for anything on that page.

3 years ago