View Single Post
Old Jul 6th, 2007, 10:23 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
The problem with tabs, as you might or might not have discovered in your other thread, is that they represent "tab stops". If you're not familiar with typewriters, this might mean nothing. In many, many implementations they are considered to be set at multiples of 8. People come along and dink with that number all the time.

This is fine if every number you are ever going to output is smaller than the unknown size you have to deal with. Otherwise, you've been effed without being kissed.

If you want control over the appearance of your output, you need to look to the output formatting provisions of each language you fart with. Programmers have been dealing with this since they were in diapers. Some numbers need a space for a sign, even if it's blank. Some need trailing space for possible exponential notation. Some need to be right-justified. Some need to be left justified. Some need to be aligned on the decimal point, regardless of the length to either side.

The writers of the languages considered this, but they failed to imbue the language with enough magic to read your mind. You're supposed to be the one in control. Not every language is well documented, but you at least should look before you leap.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote