469,951 Members | 2,392 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Inquiry about an etiquette for this forum

I have questions on a long code. Do I just place its url, or have to
paste the whole code, in my message to this forum? Thanks.

Dung Ping

Sep 13 '05 #1
2 1215
Dung Ping wrote:
I have questions on a long code. Do I just place its url, or have to
paste the whole code, in my message to this forum? Thanks.


First, do some debugging and testing and isolate your problem. Problems
happen in very specific pieces of code, not long code listings. If you first
isolate your problem to the smallest possible test case that will
demonstrate the problem, you have a much better chance of a) finding the
solution yourself, or b) getting an answer here.

At that point, a url demonstrating the code is most appreciated because it
can be easily loaded and tested.
If the code is sufficiently short, posting it in the message is helpful also
for those who may be reading offline.

Hope that helps,

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 13 '05 #2
JRS: In article <dg*********@news1.newsguy.com>, dated Tue, 13 Sep 2005
11:13:46, seen in news:comp.lang.javascript, Matt Kruse
<ne********@mattkruse.com> posted :
Dung Ping wrote:
I have questions on a long code. Do I just place its url, or have to
paste the whole code, in my message to this forum? Thanks.
First, do some debugging and testing and isolate your problem. Problems
happen in very specific pieces of code, not long code listings. If you first
isolate your problem to the smallest possible test case that will
demonstrate the problem, you have a much better chance of a) finding the
solution yourself, or b) getting an answer here.


Indeed. I once had a failing Pascal program of thousands of lines. By
reduction and simplification, I ended up with a still-failing
var X : extended ; begin X := Sqrt(2) end.
or similar. The cause turned out to be that a newly-installed quad
serial port card was also responding when the 80287 FPU was being
addressed (or similar).
At that point, a url demonstrating the code is most appreciated because it
can be easily loaded and tested.
If the code is sufficiently short, posting it in the message is helpful also
for those who may be reading offline.

If the test case is a completely self-contained piece of javascript
code, or a function with obvious parameters; or if (maybe to provide a
Form) it is a complete HTML page, then those who have made appropriate
preparations can very easily test it by copy'n'paste from News. The
following HTML page - adequate but non-compliant - can be prepared for
test here by just Select Copy Drag Click Paste Click , which is not a
lot (the Drag is only to expose the Click target, which is set to open a
local copy of my page js-quick.htm).

<script>
Z = 0
function X(Y) { alert(Y) }
</script>
<input type=button onClick="X(Z++)">

It is IMPORTANT that, when putting code in News, it is an EXACT copy of
the actual minimised failing code - so use copy'n'paste ; and it is
IMPORTANT that it not be line-wrapped by the posting agent - so write
with short lines, or expand your margins. To be sure, copy'n'paste the
material out of the draft news article and re-test it, before posting.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Sep 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Berislav Lopac | last post: by
14 posts views Thread by Toronto Web Designer | last post: by
5 posts views Thread by CHRISM | last post: by
4 posts views Thread by segue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.