[ajug-members] Ternary Operator - simplification or complication?

Salman Khatri khatri at macquarium.com
Thu Jun 1 15:16:55 EDT 2006


It falls upon you, Jonathan, to now evangelize the use of the ternary
conditional operator at your organization. Better start small with null
checks and zero or negative return checks as Robert pointed out. But
look forward to the day when you would be writing nested; nay, complete
methods through the exclusive use of operators. Then you can switch to
PERL.

Seriously though, attaning readability requires targetting the
particular set of people who need to read the particular document.
Languages that offer more than one way of doing something are allowing
you to meet differing readability and sharing guidelines. But those
guidelines in the end are mostly defined by the circle of people that
you work with. The ternary operator is accepted in the Java community
(at least this email list) as a valid and useful tool. But if your
fellow programmers are going to have trouble with it, is it worth the
trouble? Isn't your first objective to make sure code is readable
amongst your team?

And Bill, don't knock COBOL. You can write poetry in COBOL (and still
have it chuck out pay stubs on the side).

-----Original Message-----
From: ajug-members-bounces at ajug.org
[mailto:ajug-members-bounces at ajug.org] On Behalf Of Bill Siggelkow
Sent: Thursday, June 01, 2006 2:27 PM
To: General AJUG membership forum (100-200 messages/month)
Subject: Re: [ajug-members] Ternary Operator - simplification or
complication?

I concur with the rest of the group -- IMO, the ternary operator is
elegant. I'm wondering if your development team isn't composed of a
bunch of reformed COBOL programmers that become dumb-founded by +=

-Bill Siggelkow

On Jun 1, 2006, at 1:35 PM, Jonathan Komorek wrote:


	I just opened up a can of worms within our development community
by stating that in certain cases, I find that the Ternary Operator
simplifies code. I've been given the impression that I'm the last Java
developer alive that believes the ternary operator should ever be used.
I'm interested in hearing the opinions of users on this group. 

	Has the ternary operator helped you? Caused you great grief?
Should it even be in the language? 


	Jonathan Komorek
	Development Security Officer
	Benefitfocus.com, Inc.
	(843) 849-7476 ext. 254 (Main)
	(843) 849-9485 (Fax)
	E-mail: jonathan.komorek at benefitfocus.com 


	
************************************************************************
***************
	BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message
is intended only for the individual or entity to which it is addressed
and may contain information that is confidential and protected by law.
Unauthorized review, use, disclosure, or dissemination of this
communication or its contents in any way is prohibited and may be
unlawful. If you are not the intended recipient or a person responsible
for delivering this message to an intended recipient, please notify the
original sender immediately by e-mail or telephone, return the original
message to the original sender or to bfpostmaster at benefitfocus.com, and
destroy all copies or derivations of the original message. Thank you.
(BFeComNote Rev. 08/01/2005)
	
************************************************************************
*************** 

	_______________________________________________
	ajug-members mailing list
	ajug-members at ajug.org
	http://www.ajug.org/mailman/listinfo/ajug-members






More information about the ajug-members mailing list