Frustrating doesn't even start to describe the experience that wanting to post a well formated snip of code is at times.
e.g
Example
Spent quite sometime aligning expressions and clicking the darn "preview bottom". When everything seems to look more or less what I wanted, I pressed "Submit" and what did I get?
Garbage!
Tabs from code are over-exaggerated, expressions are wrapped to the next line; defeating the purpose of clear formated code in first place. And what is it that the preview doesn't look like the final result?

Recommended Answers

All 12 Replies

Use spaces instead of tabs, and this problem will pretty much go away. I know that's not a "real" solution, but it's a workaround until Dani admits that there's a problem. ;)

>but it's a workaround until Dani admits that there's a problem
I am hoping for more than admission, since it is more than just the tabs.

I know that's not a "real" solution, but it's a workaround until Dani admits that there's a problem.

i think the problem is that unix-like and windows systems handle tabs differently.

> Use spaces instead of tabs, and this problem will pretty much go away.

In the example provided, Aia used tabs in the first snippet and spaces in the second snippet.

It's unfair to say that I refuse to admit there's a problem. I know that the tabs are overexaggerated and am still investigating possible solutions (I'm not happy with the brute force method of converting tabs to spaces which only works 5% of the time).

Basically what happened is we used to have a font size for the code snippets that allowed for 80 characters per line. But then there were multiple complaints that the code was too small and way too hard to read, and so I enlarged the font size, and now 80 characters per line don't fit anymore. It's a give and take. The font was only enlarged by one size, so if I reduce it by one size again, we'll have the same complaints we had before.

>In the example provided, Aia used tabs in the first snippet and spaces in the second snippet.
Yes, I spent time trying to figure how the whole thing ticked. Still it was annoying that no matter how I try to "squish" the expressions it would wrap around into the next line. I suppose that's the most frustrating part.

I find ironic we spend a lot of energy transmitting the message to the new posters of how to properly tag their code and have proper spacing; and when I want to show a good example, I can't. As soon as I make an explanatory comment into it, or I indent once and the statement has more that two evaluations (&&,||), the whole format goes "down hill".

>It's unfair to say that I refuse to admit there's a problem.
Admitting or not admitting for me it is irrelevant. I always look forward to the solution of the problem. I have found it more productive.

Just follow the golden rule of never using TABS in your source code along with following the 70/80 column limit by using good source code formatters and you should be good to go without having to rely on which algorithm is used to format/render your code.

Just follow the golden rule of never using TABS in your source code along with following the 70/80 column limit by using good source code formatters and you should be good to go without having to rely on which algorithm is used to format/render your code.

Without wanting to contradict you ~s.o.s~. That's what you may think. However make it more like 62 positions maximum limit without TABS. At least this is the case.

80 characters per line would fit if there were not a stripe down the side for ads.

My post was not meant to open up a whole new can of worms regarding the font size and the column limit currently used; the only point I wanted to make was that one of the way to do away with the frustrating experience when posting code was to use spaces instead of tabs and follow the ?? column limit Daniweb has.

Frustrating doesn't even start to describe the experience that wanting to post a well formated snip of code is at times.
e.g
Example
Spent quite sometime aligning expressions and clicking the darn "preview bottom". When everything seems to look more or less what I wanted, I pressed "Submit" and what did I get?
Garbage!
Tabs from code are over-exaggerated, expressions are wrapped to the next line; defeating the purpose of clear formated code in first place. And what is it that the preview doesn't look like the final result?

Code now appears the same way when being previewed as in the actual post. Also, code blocks now support 80 characters per line.

commented: Oh, Thou magnanimous one. +7

Code now appears the same way when being previewed as in the actual post. Also, code blocks now support 80 characters per line.

Hail to the Queen!!!! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.