Hugo Mills wrote: > Yet one more reason to avoid ternary operators... (If you haven't > guessed yet, I'm not a fan of the whole concept. I've rarely met a use > of the ternary operator, in any language, that made code easier to > read.) > > Hugo. > I use the following fairly regularly when writing debug output:
object == null ? "null" : object.getText(); Or similar. But only for debug output, I don't use ternary for main line flow control, too much chance of someone else misunderstanding in the future. -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --------------------------------------------------------------