<< Read before posting! Use code tags! >>

Cogman

Lifer
Sep 19, 2000
10,277
125
106
Abstract

Use code tags, like this [code]Insert code here[/code].

Why we care

We are programmers here. We love programming, and we love helping people with their programming problems. There is, however, one thing that you can do over anything else to make us cringe and look away from your code (and hence, not help you) that is not using code tags.

Code tags (with proper indentation) will make your code easier and more enjoyable for us to read. They make a BIG difference in the code.

Example

With code tags
Code:
int foo(void* bar)
{
   int val = *(int*)bar;
   switch(val)
   {
      case WM_COMMAND:
         if (val > 7)
         {
            throw "*bar is too big!";
         }
         break;
      case WM_SIZE:
         resizeWin(bar);
         break;
      case SOME_CASE:
         switch(bar)
         {
            case NULL:
               saySomething();
            default:
               finishUp();
         }
         break;
      default:
         doThings();
   }
   return false;
}
Compare that to this:
int foo(void* bar)
{
int val = *(int*)bar;
switch(val)
{
case WM_COMMAND:
if (val > 7)
{
throw "*bar is too big!";
}
break;
case WM_SIZE:
resizeWin(bar);
break;
case SOME_CASE:
switch(bar)
{
case NULL:
saySomething();
default:
finishUp();
}
break;
default:
doThings();
}
return false;
}

(I didn't even remove the spaces). See the difference? Well, if you don't, we do.

Conclusion

Use code blocks. It makes a huge difference. In case you didn't read the abstract, its [code]Insert code here[/code].Please use them. They make a big difference.
 
Reactions: Ken g6

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,255
3,853
75
Edit: [thread=2428081]Here is a good example[/thread] of using code tags in a homework help question.

Furthermore, did you know that there are a couple of different types of code blocks that do syntax highlighting? One is [HTML]:

HTML:
<font size="5"><b>Abstract</b></font><br />
<br />
Use code tags, like this <b>[</b><b>code]</b>Insert code here<b>[</b><b>/code]</b>.<br />

<br />
<b><font size="5">Why we care<br />
</font></b><br />
We are programmers here. We love programming, and we love helping people with their programming problems. There is, however, one thing that you can do over anything else to make us cringe and look away from your code (and hence, not help you) that is not using code tags.<br />
<br />
Code tags (with proper indentation) will make your code easier and more enjoyable for us to read. They make a BIG difference in the code.<br />
<br />
<b><font size="5">Example </font></b><br />
<br />
With code tags<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>

	<pre class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 6px;
		border: 1px inset;
		width: 640px;
		height: 466px;
		text-align: left;
		overflow: auto">int foo(void* bar)

There's a PHP one too. Also, if your source has anything that looks like BBCode, you may have to put [noparse] tags inside your [code] tags.
 
Last edited:

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
very true.
I ran into something yesterday though trying to post and couldn't understand the problem. It was saying my post had 14 images and the limit was 10, yet it contained no images.
I had posted a list of names for .dll files. Apparently it thinks they are image files. Once I put the .dll list in a
Code:
 block it worked.

Names like:
winsock.dll 
win32.dll
home.dll

It is seeing as images.
 

Tr4nd

Member
Oct 27, 2014
40
0
0
You mean WM_COMMAND:

isn't what you like to see?


haha was surprised to see this

Furthermore, did you know that there are a couple of different types of code blocks that do syntax highlighting? One is [HTML]:

HTML:
<font size="5"><b>Abstract</b></font><br />
<br />
Use code tags, like this <b>[</b><b>code]</b>Insert code here<b>[</b><b>/code]</b>.<br />

<br />
<b><font size="5">Why we care<br />
</font></b><br />
We are programmers here. We love programming, and we love helping people with their programming problems. There is, however, one thing that you can do over anything else to make us cringe and look away from your code (and hence, not help you) that is not using code tags.<br />
<br />
Code tags (with proper indentation) will make your code easier and more enjoyable for us to read. They make a BIG difference in the code.<br />
<br />
<b><font size="5">Example </font></b><br />
<br />
With code tags<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>

	<pre class="alt2" dir="ltr" style="
		margin: 0px;
		padding: 6px;
		border: 1px inset;
		width: 640px;
		height: 466px;
		text-align: left;
		overflow: auto">int foo(void* bar)

There's a PHP one too. Also, if your source has anything that looks like BBCode, you may have to put [noparse] tags inside your [code] tags.

Quick question, does the HTML and PHP block quote work with all forums, or just vBulletin ?
 
Last edited:
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |