Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #8955 > unrolled thread
| Started by | Gene Wirchenko <genew@ocis.net> |
|---|---|
| First post | 2011-12-06 18:32 -0800 |
| Last post | 2011-12-10 17:03 -0200 |
| Articles | 20 on this page of 39 — 14 participants |
Back to article view | Back to comp.lang.javascript
Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-06 18:32 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-07 08:43 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-07 10:16 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-08 21:28 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 14:36 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-08 22:39 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:10 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-09 10:13 +0000
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-08 23:41 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:15 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-09 08:59 +0000
Re: Silly Newbie Mistake Mike Duffy <Use_guestbook_page@website.in.sig> - 2011-12-09 13:03 +0000
Re: Silly Newbie Mistake Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-09 15:39 +0100
Re: Silly Newbie Mistake Mike Duffy <Use_guestbook_page@website.in.sig> - 2011-12-10 00:40 +0000
Re: Silly Newbie Mistake Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-10 13:19 +0100
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-09 15:13 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-09 10:01 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-10 15:07 +0000
Re: Silly Newbie Mistake Norman Peelman <npeelmandog@cfl.rr.com> - 2011-12-09 06:44 -0500
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-09 10:04 -0800
Re: Silly Newbie Mistake Steve Wakeford <wakeford83@gmail.com> - 2011-12-07 05:40 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-07 15:35 +0000
Re: Silly Newbie Mistake Jacob Block <jacob.block@gmail.com> - 2011-12-07 09:20 -0800
Re: Silly Newbie Mistake Jacob Block <jacob.block@gmail.com> - 2011-12-07 09:25 -0800
Re: Silly Newbie Mistake Richard Cornford <Richard@litotes.demon.co.uk> - 2011-12-08 03:56 -0800
Re: Silly Newbie Mistake "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-08 11:31 -0700
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 11:49 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-08 21:35 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:22 -0800
Re: Silly Newbie Mistake Richard Cornford <Richard@litotes.demon.co.uk> - 2011-12-09 05:04 -0800
Re: Silly Newbie Mistake Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-09 21:07 +0000
Re: Silly Newbie Mistake Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2011-12-09 09:47 +1100
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:26 -0800
Re: Silly Newbie Mistake Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2011-12-09 12:47 +1100
Re: Silly Newbie Mistake Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-08 19:40 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:24 -0800
Re: Silly Newbie Mistake Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-10 23:41 +0000
Re: Silly Newbie Mistake kiran <kiranmbadi@gmail.com> - 2011-12-08 17:18 -0800
Re: Silly Newbie Mistake "J.R." <groups_jr-1@yahoo.com.br> - 2011-12-10 17:03 -0200
Page 1 of 2 [1] 2 Next page →
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-06 18:32 -0800 |
| Subject | Silly Newbie Mistake |
| Message-ID | <nojtd7pb39ofku9j7a1bi6pog635kga2ua@4ax.com> |
Dear JavaScripters:
At the best of time, I have found debugging JavaScript code to be
such a bother. I have been using IE's F12, but it does not handle (or
I have not figured out how) debugging an included file (<script
src=...). (If you know how, would you please let me know?) As a
consequence, I did not get immediate feedback on my silly error and
wasted a couple of hours.
You see, I have done a lot of programming in Visual FoxPro. Its
line comment token is "&&". Somehow, I typed that, instead of "//",
and I did not see it as an error for some time.
Go ahead and laugh, but it could be you next time.
Sincerely,
Gene Wirchenko
[toc] | [next] | [standalone]
| From | "Evertjan." <exjxw.hannivoort@interxnl.net> |
|---|---|
| Date | 2011-12-07 08:43 +0000 |
| Message-ID | <Xns9FB462F616874eejj99@194.109.133.133> |
| In reply to | #8955 |
Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: > At the best of time, I have found debugging JavaScript code to be > such a bother. I have been using IE's F12, but it does not handle (or > I have not figured out how) debugging an included file (<script > src=...). (If you know how, would you please let me know?) Debugging can easily be done with setting breakpoints: ..... alert( 'line 12: ' + myValueToBeRead ) ..... ..... if (myValueToBeRead>12) alert( 'line 345: ' + myValueToBeRead ) ..... and commenting it out when not needed: // alert( 'line 12: ' + myValueToBeRead ) Yes, I know this is not a Remedium Totalis, breaking up time-sensitive code for instance, but using your brain's logical programme will get you there, as long as you understand your code-to-be-debugged in the first place. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-07 10:16 -0800 |
| Message-ID | <p7bvd71ncf1ufnjje0g7qaun2q7fp3fo5t@4ax.com> |
| In reply to | #8959 |
On 07 Dec 2011 08:43:43 GMT, "Evertjan."
<exjxw.hannivoort@interxnl.net> wrote:
>Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript:
>
>> At the best of time, I have found debugging JavaScript code to be
>> such a bother. I have been using IE's F12, but it does not handle (or
>> I have not figured out how) debugging an included file (<script
>> src=...). (If you know how, would you please let me know?)
>
>Debugging can easily be done with setting breakpoints:
When it works. When it does not, it is a bother.
[snip]
>Yes, I know this is not a Remedium Totalis,
>breaking up time-sensitive code for instance,
>but using your brain's logical programme will get you there,
>as long as you understand your code-to-be-debugged in the first place.
Since I am following a text to learn JavaScript, that is not
necessarily the case. I have found bugs in the code examples, too. It
is rather time-consuming at times.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exjxw.hannivoort@interxnl.net> |
|---|---|
| Date | 2011-12-08 21:28 +0000 |
| Message-ID | <Xns9FB5E4AE76AC3eejj99@194.109.133.133> |
| In reply to | #8972 |
Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: > On 07 Dec 2011 08:43:43 GMT, "Evertjan." > <exjxw.hannivoort@interxnl.net> wrote: > >>Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: >> >>> At the best of time, I have found debugging JavaScript code to be >>> such a bother. I have been using IE's F12, but it does not handle (or >>> I have not figured out how) debugging an included file (<script >>> src=...). (If you know how, would you please let me know?) >> >>Debugging can easily be done with setting breakpoints: > > When it works. When it does not, it is a bother. Why a bother? Debugging is just the way to unbother. > > [snip] > >>Yes, I know this is not a Remedium Totalis, >>breaking up time-sensitive code for instance, >>but using your brain's logical programme will get you there, >>as long as you understand your code-to-be-debugged in the first place. > > Since I am following a text to learn JavaScript, that is not > necessarily the case. I have found bugs in the code examples, too. It > is rather time-consuming at times. If you "follow a text", is understanding the code less necessary for debugging? > Sincerely, > > Gene Wirchenko > -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 14:36 -0800 |
| Message-ID | <1ae2e7lj274chonhfrmu0joiat5c1da7bd@4ax.com> |
| In reply to | #8996 |
On 08 Dec 2011 21:28:51 GMT, "Evertjan."
<exjxw.hannivoort@interxnl.net> wrote:
>Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript:
[SNIP]
>Why a bother? Debugging is just the way to unbother.
I have pages crash with no error message. It is then a bother to
hunt down errors. Perhaps, you have your browser set up with all of
the nifty settings for detecting AND REPORTING errors. Despite
looking for them repeatedly, I have been unable to find them.
[snip]
>> Since I am following a text to learn JavaScript, that is not
>> necessarily the case. I have found bugs in the code examples, too. It
>> is rather time-consuming at times.
>
>If you "follow a text",
>is understanding the code less necessary for debugging?
No. My point is that I do not necessarily understand the code at
the time I have the problem, especially right after I have typed it
in. Did I type it in wrong? Is there a bug?
I also tend to make changes to bring the code in line with the
way I prefer for formatting, naming conventions, robustness, etc. For
example, the code often uses hard references such as parent.frames[0].
I change these by naming the frame and using the name. Sometimes,
this causes problems though less than right after typing the code in.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2011-12-08 22:39 +0000 |
| Message-ID | <timstreater-E7AF91.22395208122011@news.individual.net> |
| In reply to | #8999 |
In article <1ae2e7lj274chonhfrmu0joiat5c1da7bd@4ax.com>, Gene Wirchenko <genew@ocis.net> wrote: > On 08 Dec 2011 21:28:51 GMT, "Evertjan." > <exjxw.hannivoort@interxnl.net> wrote: > > >Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: > > [SNIP] > > >Why a bother? Debugging is just the way to unbother. > > I have pages crash with no error message. It is then a bother to > hunt down errors. Perhaps, you have your browser set up with all of > the nifty settings for detecting AND REPORTING errors. Despite > looking for them repeatedly, I have been unable to find them. The browsers will report errors by default. Have you been looking in the error consoles as I have been suggesting? -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 17:10 -0800 |
| Message-ID | <6un2e798nuvb0djp8q6764kdrum80pb1fv@4ax.com> |
| In reply to | #9000 |
On Thu, 08 Dec 2011 22:39:52 +0000, Tim Streater
<timstreater@greenbee.net> wrote:
>In article <1ae2e7lj274chonhfrmu0joiat5c1da7bd@4ax.com>,
> Gene Wirchenko <genew@ocis.net> wrote:
>
>> On 08 Dec 2011 21:28:51 GMT, "Evertjan."
>> <exjxw.hannivoort@interxnl.net> wrote:
>>
>> >Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript:
>>
>> [SNIP]
>>
>> >Why a bother? Debugging is just the way to unbother.
>>
>> I have pages crash with no error message. It is then a bother to
>> hunt down errors. Perhaps, you have your browser set up with all of
>> the nifty settings for detecting AND REPORTING errors. Despite
>> looking for them repeatedly, I have been unable to find them.
>
>The browsers will report errors by default.
If that were true, I would not be having the trouble that I am
having.
>Have you been looking in the error consoles as I have been suggesting?
I can not find anything called that.
I am using IE 9.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2011-12-09 10:13 +0000 |
| Message-ID | <timstreater-7A6D54.10131409122011@news.individual.net> |
| In reply to | #9010 |
In article <6un2e798nuvb0djp8q6764kdrum80pb1fv@4ax.com>, Gene Wirchenko <genew@ocis.net> wrote: > On Thu, 08 Dec 2011 22:39:52 +0000, Tim Streater > <timstreater@greenbee.net> wrote: > > >In article <1ae2e7lj274chonhfrmu0joiat5c1da7bd@4ax.com>, > > Gene Wirchenko <genew@ocis.net> wrote: > > > >> On 08 Dec 2011 21:28:51 GMT, "Evertjan." > >> <exjxw.hannivoort@interxnl.net> wrote: > >> > >> >Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: > >> > >> [SNIP] > >> > >> >Why a bother? Debugging is just the way to unbother. > >> > >> I have pages crash with no error message. It is then a bother to > >> hunt down errors. Perhaps, you have your browser set up with all of > >> the nifty settings for detecting AND REPORTING errors. Despite > >> looking for them repeatedly, I have been unable to find them. > > > >The browsers will report errors by default. > > If that were true, I would not be having the trouble that I am > having. > > >Have you been looking in the error consoles as I have been suggesting? > > I can not find anything called that. > > I am using IE 9. But you don't have to use that for *testing*, it seems to me. Test this code with other browsers and you may get more information. In addition, it will help you avoid creating IE-specific code. -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exjxw.hannivoort@interxnl.net> |
|---|---|
| Date | 2011-12-08 23:41 +0000 |
| Message-ID | <Xns9FB66F4737E9eejj99@194.109.133.133> |
| In reply to | #8999 |
Gene Wirchenko wrote on 08 dec 2011 in comp.lang.javascript: > On 08 Dec 2011 21:28:51 GMT, "Evertjan." > <exjxw.hannivoort@interxnl.net> wrote: > >>Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: > > [SNIP] > >>Why a bother? Debugging is just the way to unbother. > > I have pages crash with no error message. It is then a bother to > hunt down errors. Perhaps, you have your browser set up with all of > the nifty settings for detecting AND REPORTING errors. Despite > looking for them repeatedly, I have been unable to find them. I mostly do not use [your nifty] browser debuggers. I just told you I set the necessary alert() breakpoints. If the code does not run for syntactical reasons, I remark out all the lines of code that could be the culprit, and reinsert them in groups, using //.... or /*...*/, or my preference when debugging clientside js on an asp-page: <script type='text/javascript'> <% debug = true %> ..... <% if not debug then %> ... ... <% end if %> ... </script> >>> Since I am following a text to learn JavaScript, that is not >>> necessarily the case. I have found bugs in the code examples, too. >>> It is rather time-consuming at times. >> >>If you "follow a text", >>is understanding the code less necessary for debugging? > > No. My point is that I do not necessarily understand the code at > the time I have the problem, especially right after I have typed it > in. Did I type it in wrong? Is there a bug? > > I also tend to make changes to bring the code in line with the > way I prefer for formatting, naming conventions, robustness, etc. For > example, the code often uses hard references such as parent.frames[0]. > I change these by naming the frame and using the name. Right > Sometimes, > this causes problems though less than right after typing the code in. Why would that cause problems [stipulating that you understand the code? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 17:15 -0800 |
| Message-ID | <g1o2e7pr9m9i8bmiokgn5rtom4jdsve4ok@4ax.com> |
| In reply to | #9003 |
On 08 Dec 2011 23:41:03 GMT, "Evertjan."
<exjxw.hannivoort@interxnl.net> wrote:
>Gene Wirchenko wrote on 08 dec 2011 in comp.lang.javascript:
>
>> On 08 Dec 2011 21:28:51 GMT, "Evertjan."
>> <exjxw.hannivoort@interxnl.net> wrote:
>>
>>>Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript:
>>
>> [SNIP]
>>
>>>Why a bother? Debugging is just the way to unbother.
>>
>> I have pages crash with no error message. It is then a bother to
>> hunt down errors. Perhaps, you have your browser set up with all of
>> the nifty settings for detecting AND REPORTING errors. Despite
>> looking for them repeatedly, I have been unable to find them.
>
>I mostly do not use [your nifty] browser debuggers.
>
>I just told you I set the necessary alert() breakpoints.
And I have said a number of times that some errors do not get
picked up by that. The page simply does not render.
>If the code does not run for syntactical reasons,
>I remark out all the lines of code that could be the culprit,
>and reinsert them in groups, using
>
>//.... or /*...*/,
I have done similarly. I think that you can understand that
having to do so is much much more effort than getting a message such
as:
Syntax error in line 47 of somepage.html
and proceeding from there.
[snip]
>> Sometimes,
>> this causes problems though less than right after typing the code in.
>
>Why would that cause problems [stipulating that you understand the code?
Oh, come on! Typos, and of course, if I am experimenting with
features, your stipulation is silly: it is not a safe bet that I
understand the code totally.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exjxw.hannivoort@interxnl.net> |
|---|---|
| Date | 2011-12-09 08:59 +0000 |
| Message-ID | <Xns9FB665A72778eejj99@194.109.133.133> |
| In reply to | #9011 |
Gene Wirchenko wrote on 09 dec 2011 in comp.lang.javascript:
> [snip]
>
>>> Sometimes,
>>> this causes problems though less than right after typing the code
>>> in.
>>
>>Why would that cause problems [stipulating that you understand the
>>code?
>
> Oh, come on! Typos, and of course,
Modular programming even on the minute scale of common browser
javascript prograsmes, will prevent that.
function tempModule(arguments) {
alert(arguments);
return tempReturnValues; // replace with absolute test-value;
};
If this works, then replace the fmodule with it's dynamic equivlent.
> if I am experimenting with features, your stipulation is silly:
This is not a stipulation, it is an advice from years of experience.
> it is not a safe bet that I understand the code totally.
It should not be a "safe bet", it should be your effort.
your code cann't be sound, if you don' understand it,
and an added bonus is that you learn from this added understanding.
Trying to debug code that you do not understand is futile,
because it is error-prone. Just testing a ununderstood code can never
reach the level of stability that you usually would expect of your
programming and that can be reached by understood and debugged code.
Total understanding is easuier if you understand your modular modules
and the compilation of those modules in your total design.
Experimenting with say! new DOM-features in a large code without first
having tested and understood that feature on a small scale on a simple
test-page seems inadvisable.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Mike Duffy <Use_guestbook_page@website.in.sig> |
|---|---|
| Date | 2011-12-09 13:03 +0000 |
| Message-ID | <Xns9FB6521286DB8invalidcom@94.75.214.39> |
| In reply to | #9020 |
"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in news:Xns9FB665A72778eejj99@194.109.133.133: > Trying to debug code that you do not understand is futile, It does force you to learn. But you do have a point. Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- http://pages.videotron.ca/duffym/index.htm
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2011-12-09 15:39 +0100 |
| Message-ID | <1348416.WGnKmheAe9@PointedEars.de> |
| In reply to | #9025 |
Mike Duffy wrote: > "Evertjan." wrote: >> Trying to debug code that you do not understand is futile, > > It does force you to learn. But you do have a point. Sometimes, what you > learn is wrong. If those wrong ideas are close to the root of the > knowledge tree you build on a particular subject, pruning the bad branches > can sometimes cause the whole tree to collapse. [x] Sigged. PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
[toc] | [prev] | [next] | [standalone]
| From | Mike Duffy <Use_guestbook_page@website.in.sig> |
|---|---|
| Date | 2011-12-10 00:40 +0000 |
| Message-ID | <Xns9FB6C82924188invalidcom@94.75.214.39> |
| In reply to | #9027 |
Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote in news:1348416.WGnKmheAe9@PointedEars.de: > [x] Sigged. Danke, Herr Lahn. -- http://pages.videotron.ca/duffym/index.htm
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2011-12-10 13:19 +0100 |
| Message-ID | <1931478.aqSPkdTlGX@PointedEars.de> |
| In reply to | #9066 |
Mike Duffy wrote: > Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote in > news:1348416.WGnKmheAe9@PointedEars.de: > >> [x] Sigged. > > Danke, Herr Lahn. It is customary in Usenet to use the informal "you", the equivalent of which is "Du" in German, not "Sie" or "Herr" (mister), unless impoliteness has been detected. This differs from common German usage, of course. Unfortunately, your From header value does not comply with RFC 5536, so I have to write this publicly, and the sig is going to be the only text I will see from you from now on. F'up2 poster PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exjxw.hannivoort@interxnl.net> |
|---|---|
| Date | 2011-12-09 15:13 +0000 |
| Message-ID | <Xns9FB6A51373B05eejj99@194.109.133.133> |
| In reply to | #9025 |
Mike Duffy wrote on 09 dec 2011 in comp.lang.javascript: > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in > news:Xns9FB665A72778eejj99@194.109.133.133: > >> Trying to debug code that you do not understand is futile, > > It does force you to learn. But you do have a point. Sometimes, what > you learn is wrong. If those wrong ideas are close to the root of the > knowledge tree you build on a particular subject, pruning the bad > branches can sometimes cause the whole tree to collapse. That depends on what you mean by "what you learn". I suggest that what you learn cannot be wrong, as aquiring wrong ideas cannot be called "learning". "Learning" is the dynamic and interactive process of aquiring knowledge and skills by hearing, discussing and finding out new ideas, and adapting those ideas to the results of those discussions, logical thinking and testing. For such learning one needs to have a firm believe in the final doubt of the scientific process. Clientside javascript is just like the real world: - there is no trustable manual. - the inner workings are not always the same but depend on partly unknown factors like place [which engine/browser?] and time [what version, what DOM/OS]. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-09 10:01 -0800 |
| Message-ID | <dii4e75affk33rto94052kvaauddlbtr8q@4ax.com> |
| In reply to | #9020 |
On 09 Dec 2011 08:59:36 GMT, "Evertjan."
<exjxw.hannivoort@interxnl.net> wrote:
>Gene Wirchenko wrote on 09 dec 2011 in comp.lang.javascript:
>
>> [snip]
>>
>>>> Sometimes,
>>>> this causes problems though less than right after typing the code
>>>> in.
>>>
>>>Why would that cause problems [stipulating that you understand the
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>code?
^^^^
>> Oh, come on! Typos, and of course,
>
>Modular programming even on the minute scale of common browser
>javascript prograsmes, will prevent that.
>
>function tempModule(arguments) {
> alert(arguments);
> return tempReturnValues; // replace with absolute test-value;
>};
>
>If this works, then replace the fmodule with it's dynamic equivlent.
>
>
>> if I am experimenting with features, your stipulation is silly:
>
>This is not a stipulation, it is an advice from years of experience.
*You* used the word "stipulating" above.
>> it is not a safe bet that I understand the code totally.
>
>It should not be a "safe bet", it should be your effort.
>your code cann't be sound, if you don' understand it,
>and an added bonus is that you learn from this added understanding.
Perhaps, you have missed the point. I am learning JavaScript.
Note the word "learning". That means that I do not know as much about
it as I would like. I have been entering code from a text and working
with it. If I already understand the code, there is little or no
point to entering it. If I do not, then there is from the opportunity
to learn.
Having entered some code, it might not work due to:
1) bugs: I have found more than one bug in the code. I am an
experienced P/A, just not in JavaScript yet.
2) language/browser/other changes since the text was published: The
copyright is 1999, but it is the best text that I have found so far as
to level of detail, and despite its minor errors, it has not flipped
the bozo bit.
3) my typos: These can be nasty.
>Trying to debug code that you do not understand is futile,
>because it is error-prone. Just testing a ununderstood code can never
>reach the level of stability that you usually would expect of your
>programming and that can be reached by understood and debugged code.
It is hardly futile. I do get it debugged, and at this point, I
also learn more about the language. Among other things, knowing
language failure patterns is useful in debugging.
>Total understanding is easuier if you understand your modular modules
>and the compilation of those modules in your total design.
Sure.
>Experimenting with say! new DOM-features in a large code without first
>having tested and understood that feature on a small scale on a simple
>test-page seems inadvisable.
How fatuous! That is exactly what I am doing. However, I am at
the point where some of these exercises are not short bits of code.
Some of them depend on the interaction of many bits. Besides, it is
not enough to be able to handle small bits of code; I need to be able
to handle larger aggregations of code.
Sincerely,
Gene Wirchenko
.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exjxw.hannivoort@interxnl.net> |
|---|---|
| Date | 2011-12-10 15:07 +0000 |
| Message-ID | <Xns9FB7A40115F69eejj99@194.109.133.133> |
| In reply to | #9076 |
Gene Wirchenko wrote on 09 dec 2011 in comp.lang.javascript:
> On 09 Dec 2011 08:59:36 GMT, "Evertjan."
>
>>Gene Wirchenko wrote on 09 dec 2011 in comp.lang.javascript:
>>
>>> [snip]
>>>
>>>>> Sometimes,
>>>>> this causes problems though less than right after typing the code
>>>>> in.
>>>>
>>>>Why would that cause problems [stipulating that you understand the
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>code?
> ^^^^
>
>>> Oh, come on! Typos, and of course,
>>
>>Modular programming even on the minute scale of common browser
>>javascript prograsmes, will prevent that.
>>
>>function tempModule(arguments) {
>> alert(arguments);
>> return tempReturnValues; // replace with absolute test-value;
>>};
>>
>>If this works, then replace the fmodule with it's dynamic equivlent.
>>
>>
>>> if I am experimenting with features, your stipulation is silly:
>>
>>This is not a stipulation, it is an advice from years of experience.
>
> *You* used the word "stipulating" above.
Quite, but not in the sense in can be called silly, as my stipulation is
just an hypothetical inference to state my hypothesis, not a statement of
fact.
>>> it is not a safe bet that I understand the code totally.
>>
>>It should not be a "safe bet", it should be your effort.
>>your code cann't be sound, if you don' understand it,
>>and an added bonus is that you learn from this added understanding.
>
> Perhaps, you have missed the point. I am learning JavaScript.
> Note the word "learning". That means that I do not know as much about
> it as I would like.
This goes for most of us. We all learn. As said I reserve the word learn
for aquiring the right knowledge and/or skill.
By "understanding your code" I mean that you understand what it *should*
do, terribly absent when copying a [voluminous] script code from the web
or book.
> I have been entering code from a text
Script code just being text,
and javascript being a scripting language??
Oh, you must mean a printed page?
> and working
> with it. If I already understand the code, there is little or no
> point to entering it. If I do not, then there is from the opportunity
> to learn.
So you are trying out script code where both [1] you you do know what it
should do and [2] needs to be debugged, because it is not a correctly
working code?
> Having entered some code, it might not work due to:
>
> 1) bugs: I have found more than one bug in the code. I am an
> experienced P/A, just not in JavaScript yet.
As I surmized.
> 2) language/browser/other changes since the text was published: The
> copyright is 1999, but it is the best text that I have found so far as
> to level of detail, and despite its minor errors, it has not flipped
> the bozo bit.
Are you sure you want to learn from code from last century?
> 3) my typos: These can be nasty.
So you don't copy from the web but from a last century book, it seems.
Sinse most present day javascript books are not of high quality, and last
century's ones are even worse, the best you can learn from them is sound
debugging.
And that is what I started to explain in this thread, how to do simple
debugging by inserting breakpoints and remarking out code lines.
>>Trying to debug code that you do not understand is futile,
>>because it is error-prone. Just testing a ununderstood code can never
>>reach the level of stability that you usually would expect of your
>>programming and that can be reached by understood and debugged code.
>
> It is hardly futile. I do get it debugged, and at this point, I
> also learn more about the language. Among other things, knowing
> language failure patterns is useful in debugging.
>
>>Total understanding is easuier if you understand your modular modules
>>and the compilation of those modules in your total design.
>
> Sure.
>
>>Experimenting with say! new DOM-features in a large code without first
>>having tested and understood that feature on a small scale on a simple
>>test-page seems inadvisable.
>
> How fatuous! That is exactly what I am doing. However, I am at
> the point where some of these exercises are not short bits of code.
> Some of them depend on the interaction of many bits. Besides, it is
> not enough to be able to handle small bits of code; I need to be able
> to handle larger aggregations of code.
At this point you should try modular programming, very feasable in
javascript, and making the testing and understanding of your programme
possible.
Declare the input to output and the interface effects of each module and
make and test that module for all values within the required range. When
satisfied treat that module as a black box and use your modules to
compile a module of the next higher level of modularity.
Is this 1999 code up to this level of loguic or is it just a Gordian knot
of interloping parts of all too linear programing?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelmandog@cfl.rr.com> |
|---|---|
| Date | 2011-12-09 06:44 -0500 |
| Message-ID | <jbssbo$2ct$1@dont-email.me> |
| In reply to | #9011 |
On 12/08/2011 08:15 PM, Gene Wirchenko wrote: > On 08 Dec 2011 23:41:03 GMT, "Evertjan." > <exjxw.hannivoort@interxnl.net> wrote: > >> Gene Wirchenko wrote on 08 dec 2011 in comp.lang.javascript: >> >>> On 08 Dec 2011 21:28:51 GMT, "Evertjan." >>> <exjxw.hannivoort@interxnl.net> wrote: >>> >>>> Gene Wirchenko wrote on 07 dec 2011 in comp.lang.javascript: >>> >>> [SNIP] >>> >>>> Why a bother? Debugging is just the way to unbother. >>> >>> I have pages crash with no error message. It is then a bother to >>> hunt down errors. Perhaps, you have your browser set up with all of >>> the nifty settings for detecting AND REPORTING errors. Despite >>> looking for them repeatedly, I have been unable to find them. >> >> I mostly do not use [your nifty] browser debuggers. >> >> I just told you I set the necessary alert() breakpoints. > > And I have said a number of times that some errors do not get > picked up by that. The page simply does not render. > Are you saying that you don't even get the "page has completed but with errors" message at the bottom of the browser window, which when clicked on brings up a small pop-up window with an error message? >> If the code does not run for syntactical reasons, >> I remark out all the lines of code that could be the culprit, >> and reinsert them in groups, using >> >> //.... or /*...*/, > > I have done similarly. I think that you can understand that > having to do so is much much more effort than getting a message such > as: > Syntax error in line 47 of somepage.html > and proceeding from there. > > [snip] > >>> Sometimes, >>> this causes problems though less than right after typing the code in. >> >> Why would that cause problems [stipulating that you understand the code? > > Oh, come on! Typos, and of course, if I am experimenting with > features, your stipulation is silly: it is not a safe bet that I > understand the code totally. > > Sincerely, > > Gene Wirchenko Googling 'ie javascript debugger' brought up links that include these links. http://www.debugbar.com/ http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18359 http://projects.nikhilk.net/WebDevHelper/ -- Norman Registered Linux user #461062 AMD64X2 6400+ Ubuntu 10.04 64bit
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-09 10:04 -0800 |
| Message-ID | <5bj4e755rb8rue191ep4086bomf4hpr4n6@4ax.com> |
| In reply to | #9023 |
On Fri, 09 Dec 2011 06:44:55 -0500, Norman Peelman
<npeelmandog@cfl.rr.com> wrote:
[snip]
> Are you saying that you don't even get the "page has completed but
>with errors" message at the bottom of the browser window, which when
>clicked on brings up a small pop-up window with an error message?
That is right. I have since solved my problem though.
[snip]
Sincerely,
Gene Wirchenko
.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web