It's not a secret anymore!
The moose likes Meaningless Drivel and the fly likes code standards for smilies? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "code standards for smilies?" Watch "code standards for smilies?" New topic

code standards for smilies?

Bert Bates

Joined: Oct 14, 2002
Posts: 8898
I have a nagging suspicion that this might have been discussed a while back - but what the heck, it's MD.

If you're using smilies in an environment that, unlike JavaRanch, doesn't convert them (in other words a colon followed by a right paren doesn't turn into a yellow smiley face), how do you handle the situation when you want your smily inside a parenthetical clause?

Assume that "x)" is a smiley, what do you think of these?:

1 - What's the difference (wait for it x) ), between a duck?
2 - What's the difference (wait for it x)), between a duck?
3 - What's the difference [wait for it x)], between a duck?
4 - What's the difference (wait for it x), between a duck?
5 - What's the difference {wait for it x)}, between a duck?


(BTW, a well known wag recently commented "The baby Jesus cries when parens are unbalanced" )
[ February 22, 2008: Message edited by: Bert Bates ]

Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Gabriel Claramunt
Ranch Hand

Joined: May 26, 2007
Posts: 375

I usually go for option 1, but always with a feeling that something is not quite right

Software Surgeon
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865


[Asking smart questions] [About Bear] [Books by Bear]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
If the smiley actually contains a closing parenthesis -like :-) but unlike :-( - then I go for #4. Otherwise #1.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

You mean  ?

option 1 for me.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

There is a guy in my office who writes his smiles left-handed. For example"


this would eliminate the confusion when it comes at the end of a parenthetical:

What's the difference (wait for it (x ), between a duck?

however, it always throws me for a loop when i see it wherever it is.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

I try to avoid that situation altogether, so I don't have a personal standard. I usually do either #1 or #3 when I need to.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Option 2.

My logic is, why do we need extra space (or where it comes from) #1? Why to switch to angle bracket or curly braces #3 and #5? Where is closing parenthesis #4?

And why to think a simile is special. Let�s consider it text.
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

I used to do option 1 but now I prefer not to repeat characters (and do option 4 ;)

A good workman is known by his tools.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Option 1

[My Blog] [JavaRanch Journal]
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
I'm a frequent user of both smilies and parentheses, but I'd consider just dropping the smilie when they intersect. Otherwise I would most commonly use

6 - What's the difference (wait for it), x) between a duck?

To be fair I usually am in an environment that does convert smilies to a graphic when I do that. But I would still prefer to move the smilie away from whatever punctuation is confusing the issue.

"I'm not back." - Bill Harding, Twister
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

option 7

What's the difference -- wait for it -- between a duck?

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Bert Bates

Joined: Oct 14, 2002
Posts: 8898
I gotta say, in my book Michael scores with a big sideways leap
I agree. Here's the link:
subject: code standards for smilies?
It's not a secret anymore!