This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, im writing a program that involves outputting the lyrics to the song "99 bits of bytes on the bus", im just wondering if theres a more effective way of putting this part of the code. Maybe into a string, to i dont have it looking all compacted together?
Stephen Foy - Microsoft Application Development Consultant
I'd put the decrementer on a line by itself for sure. Even experienced coders have to look twice when it's in a line with other stuff.
If you're in Java 5 look at PrintStream.printf() as a way to avoid all that concatenation. If you just want to make it look neater and fit in a decent margin, you can use multiple print statements. In fact you already used two, so you're on the way ...
Ooo, look how i-- fit in there this time. I'm not sure if I like mixing decrementing with printing. How about you?
PS: Just reread and saw that you're shorting out two bits at a time, not one. If that's right, i-- won't quite do it! [ October 26, 2005: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi