Which form do you prefer?

  1. Old Default:
    #include <stdio.h>
    
    int main(void)
    {
       printf("Hello world\n");
       return 0;
    }
  2. Default:
    #include <stdio.h>
    
    int main(void)
    {
       printf("Hello world\n");
       return 0;
    }
  3. Language Syntax:
    #include <stdio.h>
    
    int main(void)
    {
       printf("Hello world\n");
       return 0;
    }

Also, enclosed in a box or no?

Recommended Answers

All 26 Replies

The default because I type code tags manually and I'm too lazy to add the language. And yes, I'd prefer a box as it clearly separates two different code blocks without having to add text between them. Why do you ask?

I think Dave means that for code that isn't syntax highlighted, would you prefer the font in black or green. I like the green better because I think it easily distinguishes code from the rest of the text (eliminating the need for a box around it IMO, as the primary purpose for a box around code is to separate it out). And not having lots of boxes all over the dev forums makes the pages look a lot cleaner.

Yes I would still like a box (like the quote box)

The default because I type code tags manually and I'm too lazy to add the language. And yes, I'd prefer a box as it clearly separates two different code blocks without having to add text between them. Why do you ask?

I personally find green text difficult to read. It sinks into the background; some default comment colors are green; overall, to me it says, "ignore this".

I prefer the box and black text. Easier for copy and paste, and easier to read as-is.

But the question is not about my preference, it is in search of others' opinions.

>I personally find green text difficult to read. It sinks into the background;
>some default comment colors are green; overall, to me it says, "ignore this".
Boohoo. Highlight it. ;) Personally I prefer a black background and teal text, but I doubt Dani would cater to my text editor whims. ;)

>I personally find green text difficult to read. It sinks into the background;
>some default comment colors are green; overall, to me it says, "ignore this".
Boohoo. Highlight it. ;) Personally I prefer a black background and teal text, but I doubt Dani would cater to my text editor whims. ;)

Gimme the box.

I want to know why I'm the only one who voted in the poll.

There's a poll?

Yeah, some crazy person started it and never even voted until someone reminded him to. :)

I don't vote on my own polls so as not to tip my hat. At least early on. Generally speaking. I don't care to influence the results.

I like the keyword highlighting, but I'm also too lazy to type the language so that doesn't work too well... unless each forum had the code blocks default to the appropriate language for that forum? That said, I prefer the green text because it's easier to distinguish than black. And a surrounding box is nice too.

I like it the way it is now -- especially the line numbers. The only language syntax I've used is C, such as [ code=c ], which isn't very difficult to type. As for the box, yes I miss that too but I can live without it.

The poll is biased, there is no option for 'none of them'. Really speaking, with the kind of font size currently used, it doesn't make a difference which of the options is selected -- all the three look the same.

The coloring scheme which I personally like the most is the one used by Devshed. Reading code could never have been simpler, not to mention linking to Javadocs in case of Java code.

The poll is biased, there is no option for 'none of them'.

I did consider that. It's more, "if you use code tags, what is your preferred rendering?" If you don't use them, [edit]or have a preference,[/edit] this isn't your poll.

'None of them' doesn't mean no code tags, it just means some other type of code tags. I guess my reply wasn't the kind you were looking for.

> this isn't your poll.
Of course it isn't, its yours.

Ooooooo! Haaaaa! I really like the new color of the code tags. Great job Dani.:)

yes yellow is lovely

I prefer the color syntax, but without line numbers. And I do like the yellow box to differentiate code from post.

I also use exclusively.[code=c] exclusively.

I didn't like line numbers at first either but I have grown to like them because they make it very easy to dicsuss specific lines in the posted code. Its a lot easier and safer to reference a line number then it is to quote the line and hope the OP can find it in his code.

I like the language syntax. Although I would like if you changed the preprocessor directive colors ( #include ... )
What I don't get is, why does the line numbers get copied when I copy the code?

> why does the line numbers get copied when I copy the code?
Click the toggle plain text link at the bottom of code and it will remove the line numbers for easy copying.

ah thanks dani that helps alot!

It jumps down below the poll. You have to scroll up to read it.

> why does the line numbers get copied when I copy the code?
Click the toggle plain text link at the bottom of code and it will remove the line numbers for easy copying.

My question was, why are the line numbers copied by default? When you select the code, the line numbers are not selected. So naturally you would expect only the selected text to be copied without the line numbers. I noticed that toggling the code worked, but I am lazy, and tend to forget to toggle the code before copying the first time, resulting in having to copy and paste the code twice.

It's an OS/browser issue. The line numbers are created with regular HTML list mark-up. Different platforms copy/paste lists differently. For example, for me, it works fine in IE but requires me to not use the line number version to copy from FF.

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.