Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #10585

Re: Sum of squares

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Helmar Wodtke <helmwo@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Sum of squares
Date Tue, 27 Mar 2012 08:21:05 -0700 (PDT)
Organization http://groups.google.com
Lines 41
Message-ID <3875190.163.1332861665412.JavaMail.geo-discussion-forums@vbbhf3> (permalink)
References <10851509008435@frunobulax.edu> <20120327161515.705ef8f4@tiger.support.j.intershop.de> <17190721.475.1332858914383.JavaMail.geo-discussion-forums@ynlw24> <9173418.355.1332860448639.JavaMail.geo-discussion-forums@ynjc20>
NNTP-Posting-Host 62.158.126.42
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1332861778 29675 127.0.0.1 (27 Mar 2012 15:22:58 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Tue, 27 Mar 2012 15:22:58 +0000 (UTC)
In-Reply-To <9173418.355.1332860448639.JavaMail.geo-discussion-forums@ynjc20>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=62.158.126.42; posting-account=nibe3QoAAADcYL8fC0WC6vCas4By1Xgn
User-Agent G2/1.0
Xref csiph.com comp.lang.forth:10585

Show key headers only | View raw


Am Dienstag, 27. März 2012 17:00:48 UTC+2 schrieb hwf...@gmail.com:
> On Tuesday, March 27, 2012 7:35:14 AM UTC-7, Helmar Wodtke wrote:
> > 
> > Yes, but if you want a one-liner take:
> > 
> > : result  2dup > if swap then dup * -rot max dup * + ;
> > 
> And if you want it documented, set your editor's right margin to column 120. Insert the stack picture and place the \ explanation of what it does at column 65.
> 
> With comments at column 65, it's like having shadow blocks. Programmers who find comments distracting can always drag the editor window edge until only the code shows. My FHD screen (the new VGA) allows two 124-column edit windows side by side and I use them, since I don't find comments distracting.
> 
> -Brad

Bah, you really want an answer? Why I should make stack comments here?
The question had the stack comment for the single-liner.

You are right that I do not like some kind of comments. This is because it does not work in real world - there is written something like ( a -- b ) but in fact it is ( a n -- c ) .
I do not want to verify code *and* documentation if I read something from someone else.
I want to know what it is about and in some situations a comment is good - but this comment usually does not need to explain me why in C there is written "i++" inside this strange "for ()"-function that takes the arguments separated by ";" (how to do this?).

So what we are here? Pedantic persons that did not get the solution that fast, because the comments where not complete?
I personally think that Forth is very readable. You can write more readable things than in other languages. If you trace my answers, I made them to specific posts - it's not my "best solution". You know, about my solution I can not talk here, because I would get burned for using a non-ANS-system.

Regards,
-Helmar

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Sum of squares mhx@iae.nl (Marcel Hendrix) - 2012-03-26 20:50 +0200
  Re: Sum of squares "A. K." <akk@nospam.org> - 2012-03-26 21:43 +0200
  Re: Sum of squares Paul Rubin <no.email@nospam.invalid> - 2012-03-26 16:52 -0700
    Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 03:15 -0700
      Re: Sum of squares Paul Rubin <no.email@nospam.invalid> - 2012-03-28 08:16 -0700
    Re: Sum of squares BruceMcF <agila61@netscape.net> - 2012-03-28 06:06 -0700
  Re: Sum of squares Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-03-27 12:13 +0100
    Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 04:03 -0700
      Re: Sum of squares Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2012-03-27 13:55 +0100
  Re: Sum of squares Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-27 11:05 +0000
    Re: Sum of squares Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-28 11:41 +0000
      Re: Sum of squares Paul Rubin <no.email@nospam.invalid> - 2012-03-28 07:41 -0700
      Re: Sum of squares mhx@iae.nl (Marcel Hendrix) - 2012-03-29 22:06 +0200
      Re: Sum of squares Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-31 11:48 +0000
    Re: Sum of squares Alexander Adler <alexander.adler@stud.uni-frankfurt.de> - 2012-03-29 19:33 +0200
      Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-29 11:16 -0700
        Re: Sum of squares Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-04-03 09:47 +0000
    Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-28 09:42 -0700
    Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-28 11:08 -0700
  Re: Sum of squares Ecki <ecki@intershop.de> - 2012-03-27 16:15 +0200
    Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 07:35 -0700
      Re: Sum of squares hwfwguy@gmail.com - 2012-03-27 08:00 -0700
        Re: Sum of squares Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 08:21 -0700
        Re: Sum of squares Ecki <ecki@intershop.de> - 2012-03-29 09:05 +0200

csiph-web