FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » terminate a PHP script
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Re: terminate a PHP script [message #172591 is a reply to message #172580] Tue, 22 February 2011 02:04 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/21/2011 8:24 PM, The Natural Philosopher wrote:
> sheldonlg wrote:
>> On 2/21/2011 1:54 PM, n00m wrote:
>>>
>>>> Again, why not if-then-else?
>>>
>>> what if it's 10 nested for() stmts?
>>> And you need to break out of ALL for()'s from the innermost for()?
>>> Do you like 10 if-then-else conditionals, 1 per each for()?
>>
>> && !$exit_all
>>
>> in each of the test conditions of the for loop where $exit_all is
>> initially FALSE outside the outermost loop.
>>
>> for ($i1=0, $exit_all=FALSE; $i1 < $i1_end && !$exit_all; $i1++) {
>> for ($i2=0; $i2 < $i2_end && !$exit_allt; $i2++) {
>> ..... // and so on
>> if ($some_condition == TRUE) {
>> $exit_all = TRUE;
>> break; // or continue which does one extra check step
>> }
>> }
>> }
>>
>>
>>
> I didn't understand a word of that. ;-)

I don't understand why? It is clear as a bell.

> AND you used a BREAK. hanging is too good...

A break is not a goto. Far from it. A break says "stop processing
_this_ particular loop/test". Its scope is _clearly defined_. It
resumes immediately after that loop/test. That is nothing like a goto
which is an unconditional branch to ANYWHERE in the code. (Also, try
writing a switch statement without a break.)

But, if you don't like break here, just leave it out. As it turns out,
in my example the way I wrote it, it is not needed since it is being
tested in the while condition of the loop. It will exit the loop
anyway. The only real reason to have the break in the if test is if
there were some lines of code within that loop after the test.

--
Shelly
Re: terminate a PHP script [message #172593 is a reply to message #172588] Tue, 22 February 2011 02:08 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/21/2011 8:46 PM, The Natural Philosopher wrote:
> sheldonlg wrote:
>> On 2/21/2011 7:28 PM, The Natural Philosopher wrote:
>>> sheldonlg wrote:
>>>> On 2/21/2011 12:06 PM, Denis McMahon wrote:
>>>> > On 21/02/11 16:51, n00m wrote:
>>>> >>> No, you should not use goto! It causes more problems than it solves.
>>>> >>
>>>> >> Why on the earth???
>>>> >> "goto" can produce 10000 empty lines in no time. Like this:
>>>> >
>>>> > Because there is no structure to a program that uses goto. When it
>>>> > fails
>>>> > to work properly (and it will) it can become impossible to see how it
>>>> > arrived at the point that it fails at.
>>>> >
>>>> >> $cnt = 0;
>>>> >>
>>>> >> mm:
>>>> >> ++$cnt;
>>>> >> echo '<BR>';
>>>> >> if ($cnt< 10000) goto mm;
>>>> >
>>>> > Your goto method uses 5 lines. A while loop uses 2:
>>>> >
>>>> > $i = 10000;
>>>> > while ($i--) echo "<br>\n";
>>>> >
>>>> > and a for loop only 1:
>>>> >
>>>> > for ($cnt = 10000; $cnt--;) echo "<br>\n";
>>>> >
>>>> > or:
>>>> >
>>>> > for ($cnt = 0; $cnt< 10000; $cnt++) echo "<br>\n";
>>>> >
>>>> > Rgds
>>>> >
>>>> > Denis McMahon
>>>>
>>>> I fully agree about gotos. There is NO need for them. What is wrong
>>>> with this pseudocode?
>>>>
>>>> ===========
>>>> if (passes test for failure condition) {
>>>> ... all the rest of the code for success that is already there
>>>> --- except the footer
>>>> }
>>>>
>>>> footer stuff.
>>>> ==========
>>>>
>>>> All it does is add two lines (the if test and a closing brace) and one
>>>> level of indentation, and it does what the OP wants.
>>>>
>>>> Since seeing the if-then-else first appear in Fortran circa 1980, I
>>>> have never used a single goto in any language in which I have coded.
>>>>
>>> Well that's cos you never wrote Assembler :-)
>>>
>>
>> Correct! That was before even my time. :-) By the time I got into it
>> with Fortran IV, the compiled code looked an awful lot like Assembly
>> code. Machines should be labor saving devices. That was what the
>> compiler was for. Besides, it is much easier to debug and maintain a
>> language that is readable, and not like spaghetti code (gotos and jumps).
>>
> The art of writing assembler, is to MAKE it readable DESPITE the language.
>
> And, if you wanted to write hardware code in the 80's for them new
> fangled Micro Processors, that mate, was all there was!

I understand that. I also understand that this is three decades later.
Do you still wear leisure suits and sport an Afro or go to discos?

--
Shelly
Re: terminate a PHP script [message #172594 is a reply to message #172591] Tue, 22 February 2011 02:09 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/21/2011 9:04 PM, sheldonlg wrote:
> On 2/21/2011 8:24 PM, The Natural Philosopher wrote:
>> sheldonlg wrote:
>>> On 2/21/2011 1:54 PM, n00m wrote:
>>>>
>>>> > Again, why not if-then-else?
>>>>
>>>> what if it's 10 nested for() stmts?
>>>> And you need to break out of ALL for()'s from the innermost for()?
>>>> Do you like 10 if-then-else conditionals, 1 per each for()?
>>>
>>> && !$exit_all
>>>
>>> in each of the test conditions of the for loop where $exit_all is
>>> initially FALSE outside the outermost loop.
>>>
>>> for ($i1=0, $exit_all=FALSE; $i1 < $i1_end && !$exit_all; $i1++) {
>>> for ($i2=0; $i2 < $i2_end && !$exit_allt; $i2++) {
>>> ..... // and so on
>>> if ($some_condition == TRUE) {
>>> $exit_all = TRUE;
>>> break; // or continue which does one extra check step
>>> }
>>> }
>>> }
>>>
>>>
>>>
>> I didn't understand a word of that. ;-)
>
> I don't understand why? It is clear as a bell.
>
>> AND you used a BREAK. hanging is too good...
>
> A break is not a goto. Far from it. A break says "stop processing _this_
> particular loop/test". Its scope is _clearly defined_. It resumes
> immediately after that loop/test. That is nothing like a goto which is
> an unconditional branch to ANYWHERE in the code. (Also, try writing a
> switch statement without a break.)
>
> But, if you don't like break here, just leave it out. As it turns out,
> in my example the way I wrote it, it is not needed since it is being
> tested in the while condition of the loop. It will exit the loop anyway.
> The only real reason to have the break in the if test is if there were
> some lines of code within that loop after the test.
>

Forget it, Shelly - TNP can't tell the difference between a break (or an
if/then/else, for that matter) and a goto.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: terminate a PHP script [message #172595 is a reply to message #172589] Tue, 22 February 2011 02:10 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/21/2011 8:47 PM, The Natural Philosopher wrote:
> n00m wrote:
>> Does not it (the FORTRAN code below) look charming?
>> Btw it works perfectly (some time ago I re-wrote it
>> into VB and into Pascal;.. crowds of mad GOTOS =)
>> ==================================================================
>>
>>
>> SUBROUTINE JOVOFD(N,C,X,Y,U,V,Z)
>> INTEGER C(100,100),X(100),Y(100),U(100),V(100)
>> INTEGER H,Z,L0,V0,VJ,DJ,UP,LOW
>> INTEGER LAB(100),D(100),FREE(100),COL(100)
>> C
>> C THIS SUBROUTINE SOLVES THE FULL DENSITY LINEAR ASSIGNMENT PROBLEM
>> C ACCORDING TO
>> C
>> C "A Shortest Augmenting Path Algorithm for Dense and Sparse
>> Linear
>> C Assignment Problems," Computing 38, 325-340, 1987
>> C
>> C by
>> C
>> C R. Jonker and A. Volgenant, University of Amsterdam.
>> C
>> C INPUT PARAMETERS :
>> C N = NUMBER OF ROWS AND COLUMNS
>> C C = WEIGHT MATRIX
>> C
>> C OUTPUT PARAMETERS
>> C X = COL ASSIGNED TO ROW
>> C Y = ROW ASSIGNED TO COL
>> C U = DUAL ROW VARIABLE
>> C V = DUAL COLUMN VARIABLE
>> C Z = VALUE OF OPTIMAL SOLUTION
>> C
>> C INITIALIZATION
>> DO 10 I=1,N
>> X(I)=0
>> 10 CONTINUE
>> DO 20 J0=1,N
>> J=N-J0+1
>> VJ=C(J,1)
>> I0=1
>> DO 15 I=2,N
>> IF (C(J,I).LT.VJ) THEN
>> VJ=C(J,I)
>> I0=I
>> END IF
>> 15 CONTINUE
>> V(J)=VJ
>> COL(J)=J
>> IF (X(I0).EQ.0) THEN
>> X(I0)=J
>> Y(J)=I0
>> ELSE
>> X(I0)=-ABS(X(I0))
>> Y(J)=0
>> END IF
>> 20 CONTINUE
>> L=0
>> DO 40 I=1,N
>> IF (X(I).EQ.0) THEN
>> L=L+1
>> FREE(L)=I
>> GOTO 40
>> END IF
>> IF (X(I).LT.0) THEN
>> X(I)=-X(I)
>> ELSE
>> J1=X(I)
>> MIN=1.E14
>> DO 31 J=1,N
>> IF (J.EQ.J1) GOTO 31
>> IF (C(J,I)-V(J).LT.MIN) MIN=C(J,I)-V(J)
>> 31 CONTINUE
>> V(J1)=V(J1)-MIN
>> END IF
>> 40 CONTINUE
>> C IMPROVE THE INITIAL SOLUTION
>> CNT=0
>> IF (L.EQ.0) GOTO 1000
>> 41 L0=L
>> K=1
>> L=0
>> 50 I=FREE(K)
>> K=K+1
>> V0=C(1,I)-V(1)
>> J0=1
>> VJ=1.E14
>> DO 42 J=2,N
>> H=C(J,I)-V(J)
>> IF (H.LT.VJ) THEN
>> IF (H.GE.V0) THEN
>> VJ=H
>> J1=J
>> ELSE
>> VJ=V0
>> V0=H
>> J1=J0
>> J0=J
>> END IF
>> END IF
>> 42 CONTINUE
>> I0=Y(J0)
>> IF (V0.LT.VJ) THEN
>> V(J0)=V(J0)-VJ+V0
>> ELSE
>> IF (I0.EQ.0) GOTO 43
>> J0=J1
>> I0=Y(J1)
>> END IF
>> IF (I0.EQ.0) GOTO 43
>> IF (V0.LT.VJ) THEN
>> K=K-1
>> FREE(K)=I0
>> ELSE
>> L=L+1
>> FREE(L)=I0
>> END IF
>> 43 X(I)=J0
>> Y(J0)=I
>> IF (K.LE.L0) GOTO 50
>> CNT=CNT+1
>> IF ((L.GT.0).AND.(CNT.LT.2)) GOTO 41
>> C AUGMENTATION PART
>> L0=L
>> DO 90 L=1,L0
>> I0=FREE(L)
>> DO 51 J=1,N
>> D(J)=C(J,I0)-V(J)
>> LAB(J)=I0
>> 51 CONTINUE
>> UP=1
>> LOW=1
>> 60 LAST=LOW-1
>> MIN=D(COL(UP))
>> UP=UP+1
>> DO 52 K=UP,N
>> J=COL(K)
>> DJ=D(J)
>> IF (DJ.LE.MIN) THEN
>> IF (DJ.LT.MIN) THEN
>> MIN=DJ
>> UP=LOW
>> END IF
>> COL(K)=COL(UP)
>> COL(UP)=J
>> UP=UP+1
>> END IF
>> 52 CONTINUE
>> DO 53 H=LOW,UP-1
>> J=COL(H)
>> IF (Y(J).EQ.0) GOTO 70
>> 53 CONTINUE
>> 55 J0=COL(LOW)
>> LOW=LOW+1
>> I=Y(J0)
>> H=C(J0,I)-V(J0)-MIN
>> DO 62 K=UP,N
>> J=COL(K)
>> VJ=C(J,I)-V(J)-H
>> IF (VJ.LT.D(J)) THEN
>> D(J)=VJ
>> LAB(J)=I
>> IF (VJ.EQ.MIN) THEN
>> IF (Y(J).EQ.0) GOTO 70
>> COL(K)=COL(UP)
>> COL(UP)=J
>> UP=UP+1
>> END IF
>> END IF
>> 62 CONTINUE
>> IF (LOW.EQ.UP) GOTO 60
>> GOTO 55
>> 70 DO 71 K=1,LAST
>> J0=COL(K)
>> V(J0)=V(J0)+D(J0)-MIN
>> 71 CONTINUE
>> 80 I=LAB(J)
>> Y(J)=I
>> K=J
>> J=X(I)
>> X(I)=K
>> IF (I0.NE.I) GOTO 80
>> 90 CONTINUE
>> Z=0
>> DO 100 I=1,N
>> U(I)=C(X(I),I)-V(X(I))
>> Z=Z+C(X(I),I)
>> 100 CONTINUE
>> 1000 END
>>
>>
> were comments not a feature of FORTRAN?

They sure were, and so was (within size limitations) better naming of
variables.

--
Shelly
Re: terminate a PHP script [message #172598 is a reply to message #172595] Tue, 22 February 2011 02:45 Go to previous messageGo to next message
n00m is currently offline  n00m
Messages: 25
Registered: February 2011
Karma: 0
Junior Member
The same Assignment Problem (hungarian algorithm):
====================================================

#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <time.h>

#define N 100
int res_sum;
int res_table[N][N];
int v[N][N], u[N][N], cross[N][N];
int row[N], col[N];
int rowround[N], colround[N];
int userow[N];
int vmax = 0;
size_t n;

void pivot() {
int umin;
size_t i, j;
for (i = 0; i < n; ++i)
for (j = 0; j < n; ++j)
vmax = std::max(vmax, v[i][j]);
for (i = 0; i < n; ++i)
for (j = 0; j < n; ++j)
u[i][j] = v[i][j];
for (i = 0; i < n; ++i) {
umin = u[i][0];
for (j = 1; j < n; ++j)
umin = std::min(umin, u[i][j]);
for (j = 0; j < n; ++j)
u[i][j] -= umin;
}
for (j = 0; j < n; ++j) {
umin = u[0][j];
for (i = 1; i < n; ++i)
umin = std::min(umin, u[i][j]);
for (i = 0; i < n; ++i)
u[i][j] -= umin;
}
}

void mark() {
size_t i, j;
for (i = 0; i < n; ++i)
for (j = 0; j < n; ++j)
cross[i][j] = 0;
for (i = 0; i < n; ++i)
row[i] = col[i] = 0;
for (i = 0; i < n; ++i)
for (j = 0; j < n; ++j)
if (u[i][j] == 0)
if (row[i] == 0 && col[j] == 0) {
cross[i][j] = 1;
row[i] = col[j] = 1;
}
else
cross[i][j] = -1;
}

int findcouple(size_t k) {
size_t i, j = 0;
while (cross[k][j] != 1) ++j;
for (i = 0; i < n; ++i)
if (cross[i][j] == -1 && !userow[i]) {
if (!row[i]) {
row[i] = 1;
cross[i][j] = 1;
cross[k][j] = -1;
return 1;
}
else {
userow[i] = 1;
if (findcouple(i)) {
cross[i][j] = 1;
cross[k][j] = -1;
return 1;
}
}
}
return 0;
}

int upcouple() {
size_t i, j;
for (i = 0; i < n; ++i)
userow[i] = 0;
for (j = 0; j < n; ++j)
if (!col[j])
for (i = 0; i < n; ++i)
if (cross[i][j] == -1) {
userow[i] = 1;
if (findcouple(i)) {
col[j] = 1;
cross[i][j] = 1;
return 1;
}
else
userow[i] = 0;
}
return 0;
}

void maxcouple() {
while (upcouple());
}

int fin() {
for (size_t i = 0; i < n; ++i)
if (!row[i])
return 0;
return 1;
}

void minsupport() {
size_t i, j;
for (i = 0; i < n; ++i)
rowround[i] = colround[i] = 0;
for (i = 0; i < n; ++i)
rowround[i] = 1 - row[i];
bool b = true;
while (b) {
b = false;
for (i = 0; i < n; ++i)
if (rowround[i])
for (j = 0; j < n; ++j)
if (cross[i][j] == -1)
colround[j] = 1;
for (j = 0; j < n; ++j)
if (colround[j])
for (i = 0; i < n; ++i)
if (cross[i][j] == 1 && !rowround[i]) {
b = true;
rowround[i] = 1;
}
}
}

void rotate() {
size_t i, j;
int vmin = vmax;
for (i = 0; i < n; ++i)
if (rowround[i])
for (j = 0; j < n; ++j)
if (!colround[j])
if (vmin > u[i][j])
vmin = u[i][j];
for (i = 0; i < n; ++i)
if (!rowround[i])
for (j = 0; j < n; ++j)
u[i][j] += vmin;
for (j = 0; j < n; ++j)
if (!colround[j])
for (i = 0; i < n; ++i)
u[i][j] -= vmin;
}

void hungarian() {
pivot();
while (true) {
mark();
maxcouple();
if (fin()) break;
minsupport();
rotate();
}
for (size_t i = 0; i < n; ++i) {
for (size_t j = 0; j < n; ++j)
if (cross[i][j] == 1) {
res_table[i][j] = v[i][j];
res_sum += v[i][j];
break;
}
}
}

int main() {
n = 5;
srand(time(NULL));
for (size_t i = 0; i < n; ++i) {
for (size_t j = 0; j < n; ++j) {
v[i][j] = rand() % 100;
col[j] += v[i][j];
printf("%3d", v[i][j]);
}
putchar('\n');
}

hungarian();

putchar('\n');
for (size_t i = 0; i < n; ++i) {
for (size_t j = 0; j < n; ++j) {
printf("%3d", res_table[i][j]);
}
putchar('\n');
}
printf("\nres_sum = %d\n\n", res_sum);
system("pause");
return 0;
}


===================================================
Output:
===================================================

44 79 18 39 70
45 82 84 7 52
71 63 56 55 94
21 67 86 5 67
5 39 67 68 86

0 0 18 0 0
0 0 0 0 52
0 63 0 0 0
0 0 0 5 0
5 0 0 0 0

res_sum = 143

Press any key to continue . . .
Re: terminate a PHP script [message #172600 is a reply to message #172590] Tue, 22 February 2011 03:16 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
sheldonlg wrote:
> On 2/21/2011 8:15 PM, The Natural Philosopher wrote:
>> Peter H. Coffin wrote:
>>> On Mon, 21 Feb 2011 18:50:39 +0000, Tim Streater wrote:
>>>> Because of the incredible convolution and depth of nested
>>>> if/then/else you can get to. If I have (as it might be) a function
>>>> that's scanning a string looking for and obtaining options and their
>>>> values for some command previously scanned off the string, and I
>>>> detect an error, I want to set an error code and exit right there. I
>>>> don't want any subsequent maintainer to have to intuit that, in fact,
>>>> from this point on nested 15-deep in else clauses, no more code is
>>>> executed for that path through the function.
>>>>
>>>> That way I rarely get more than 3-deep in if/then/else. To me, it's
>>>> all about readbility.
>>>
>>> *grin* for me, it's all about comprehesibility. If you don't like how
>>> deep you're nesting, maybe you need to break something out into a
>>> function instead....
>>>
>> Yes, but how much stack do you have? Can you afford the overhead of a
>> call/return? How much does splitting a whole block of code to four pages
>> away make the comprehensibility problem worse, not better?
>
> If you have fifteen pages of code within a success bracket, then you are
> at least 8-10 times too big in the routine. It should be broken into
> smaller segments.

'Should' and 'can' are often not the same thing.
And a lot depends on the size of your page: remember when 80x25 was all
you had?

four pages is ONLY 100 lines.

Or if you were lucky in your fan fold, 320 lines or so. IIRC, Which I
probably don't.


I know that that when I have a piece of code that is
> getting lengthy, I either put some of it in functions, or I make a more
> liberal use of include files and put blocks of code in include files. It
> makes it MUCH more readable and maintainable that way.
>

I think that people today have habits derived from a lot of tools and
large screens that didn't exist when I learnt to program.


> -
> Shelly
Re: terminate a PHP script [message #172601 is a reply to message #172591] Tue, 22 February 2011 03:38 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
sheldonlg wrote:
> On 2/21/2011 8:24 PM, The Natural Philosopher wrote:
>> sheldonlg wrote:
>>> On 2/21/2011 1:54 PM, n00m wrote:
>>>>
>>>> > Again, why not if-then-else?
>>>>
>>>> what if it's 10 nested for() stmts?
>>>> And you need to break out of ALL for()'s from the innermost for()?
>>>> Do you like 10 if-then-else conditionals, 1 per each for()?
>>>
>>> && !$exit_all
>>>
>>> in each of the test conditions of the for loop where $exit_all is
>>> initially FALSE outside the outermost loop.
>>>
>>> for ($i1=0, $exit_all=FALSE; $i1 < $i1_end && !$exit_all; $i1++) {
>>> for ($i2=0; $i2 < $i2_end && !$exit_allt; $i2++) {
>>> ..... // and so on
>>> if ($some_condition == TRUE) {
>>> $exit_all = TRUE;
>>> break; // or continue which does one extra check step
>>> }
>>> }
>>> }
>>>
>>>
>>>
>> I didn't understand a word of that. ;-)
>
> I don't understand why? It is clear as a bell.
>
>> AND you used a BREAK. hanging is too good...
>
> A break is not a goto. Far from it. A break says "stop processing
> _this_ particular loop/test". Its scope is _clearly defined_. It
> resumes immediately after that loop/test. That is nothing like a goto
> which is an unconditional branch to ANYWHERE in the code.
Nope. Not in C it aint. For example. Its a branch to the same scope as
the block IIRC. Or at least the function, because i don't think you can
see the target label outside that scope. And I don't think global labels
can exist - would be a helluva mess on the stack if you DID branch
outside a function. You need longjmp() for that.

Once you introduce local stack based variables you cant use global jumps.

Only BASIC and ASSEMBLER allow that, and all bets are off in either
language if you abuse that privilege.!

I did manage howeer when trying to find another 200bytes in a ROM to
replace every instance of
POP DX
POP AX
RET

with

JMP SPACESAVER

and

SPACESAVER:
POP DX
POP AX
RET

I think it was one byte shorter, or something.


(Also, try
> writing a switch statement without a break.)
>

Exactly.
some form of limited goto is always required: teh questin is how to
wrire it best. After all consider thus staement

if ()
{
}
else...
{
}
what is the else, but a target for a conditional jump? Just because you
didn't write goto, doesn't mean there aint no jump.

In assambler thats a

CMP..something
JNE CURLY
//this is if the condition is met
JMP NEXT_CURLY
//else
CURLY:
//do else block stuff
NEXT_CURLY: // end of final brace.


ALL your precious 'structure' is simply ways of expressing those go tos
in a formal way.

If your languagee is not block structured, and has no local variables,
for sure you can write some utter spaghetti aided and abetted by
GOTOS:But that's merely a case of the language not giving you the tools
to do much else.

The moment you HAVE block structure and local variables you cant allow
GOTS to go very far. In fact as K & R realised, you need to introduce a
pretty fucking weird function pair, setjmp() and longjmp() to be able
to do it at all. Setjmp stores the stack pointer in a variable that you
can use with longjmp, to exit at the same place you called setjmp from
and restore the stack and program counter, and wipe out all the
locals.Its the ONLY way I know of to clean up the mess the jump would
otherwise make.

My point being that a goto in a block structured language merely is
another way to write a curly brace.

I rarely have had call to use it in such, its true. Return continue and
break serve much the same function as do curly braces, but its nice to
know its there, like the gimlet in the drawer next to the power drill,
in case it happens to be the easiest cleanest way to make a particular
hole..
Re: terminate a PHP script [message #172603 is a reply to message #172593] Tue, 22 February 2011 03:55 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
sheldonlg wrote:
> On 2/21/2011 8:46 PM, The Natural Philosopher wrote:
>> sheldonlg wrote:
>>> On 2/21/2011 7:28 PM, The Natural Philosopher wrote:
>>>> sheldonlg wrote:
>>>> > On 2/21/2011 12:06 PM, Denis McMahon wrote:
>>>> >> On 21/02/11 16:51, n00m wrote:
>>>> >>>> No, you should not use goto! It causes more problems than it
>>>> >>>> solves.
>>>> >>>
>>>> >>> Why on the earth???
>>>> >>> "goto" can produce 10000 empty lines in no time. Like this:
>>>> >>
>>>> >> Because there is no structure to a program that uses goto. When it
>>>> >> fails
>>>> >> to work properly (and it will) it can become impossible to see how it
>>>> >> arrived at the point that it fails at.
>>>> >>
>>>> >>> $cnt = 0;
>>>> >>>
>>>> >>> mm:
>>>> >>> ++$cnt;
>>>> >>> echo '<BR>';
>>>> >>> if ($cnt< 10000) goto mm;
>>>> >>
>>>> >> Your goto method uses 5 lines. A while loop uses 2:
>>>> >>
>>>> >> $i = 10000;
>>>> >> while ($i--) echo "<br>\n";
>>>> >>
>>>> >> and a for loop only 1:
>>>> >>
>>>> >> for ($cnt = 10000; $cnt--;) echo "<br>\n";
>>>> >>
>>>> >> or:
>>>> >>
>>>> >> for ($cnt = 0; $cnt< 10000; $cnt++) echo "<br>\n";
>>>> >>
>>>> >> Rgds
>>>> >>
>>>> >> Denis McMahon
>>>> >
>>>> > I fully agree about gotos. There is NO need for them. What is wrong
>>>> > with this pseudocode?
>>>> >
>>>> > ===========
>>>> > if (passes test for failure condition) {
>>>> > ... all the rest of the code for success that is already there
>>>> > --- except the footer
>>>> > }
>>>> >
>>>> > footer stuff.
>>>> > ==========
>>>> >
>>>> > All it does is add two lines (the if test and a closing brace) and one
>>>> > level of indentation, and it does what the OP wants.
>>>> >
>>>> > Since seeing the if-then-else first appear in Fortran circa 1980, I
>>>> > have never used a single goto in any language in which I have coded.
>>>> >
>>>> Well that's cos you never wrote Assembler :-)
>>>>
>>>
>>> Correct! That was before even my time. :-) By the time I got into it
>>> with Fortran IV, the compiled code looked an awful lot like Assembly
>>> code. Machines should be labor saving devices. That was what the
>>> compiler was for. Besides, it is much easier to debug and maintain a
>>> language that is readable, and not like spaghetti code (gotos and
>>> jumps).
>>>
>> The art of writing assembler, is to MAKE it readable DESPITE the
>> language.
>>
>> And, if you wanted to write hardware code in the 80's for them new
>> fangled Micro Processors, that mate, was all there was!
>
> I understand that. I also understand that this is three decades later.
> Do you still wear leisure suits

I never did.

and sport an Afro

Mm. almost

or go to discos?

I never did that either beyond as brief foray into running, then
building them, in the 60. and 70's..

BUT I can assure you assembler is alive and well, and still used where
the high level languages don't cut the mustard.

As I said, here we talk noddy scripts in PHP, but that's not always what
all of us have done. Or still do.

I have a project on the back burner which if I ever resurrect it, will
have to be done in PIC or ATMEL assembler, because nothing else will get
the speed at the price..

I'll probably do a lot in C as well, the scheduler and main task will be
assembler, because I have to squeeze every clock cycle out of it.


I'll bet your video card is not programmed in Pascal or PHP either :-)


And the core of whatever OS you use. Its easier to write a pre-emptive
scheduler in assembler than even in C, though I *think* its possible
given that the compiler can handle interrupt service routines.

I do know last time I did that, it got too hard, and i coded the core in
Assembler, and having done that, a lot more than I strictly needed to,
simply because it was easier to keep all that low level stuff in one set
of files.


Its a mistake to consider that the code one writes, is of the same ilk
as the code others write. Most of my programming has been at very low
level, hardware, OS, drivers, Bioses, comms code, a bi of commercial
applications, and database, but not that much till I came thisaway and
stared writing simple stuff for web sites. I mean really people make a
huge fuss over PHP, but its diddly squat compared to writing rom based
assembler to bootstrap a motherboard from cold. Its interpreted, so no
compile test debug cycles. Its block structured, so you don't have to
worry about trampling in the wrong bit of RAM, its not time critical bar
a few odd cases...basically you guys are just bored because you don't
have to work hard enough, so you spend your time arguing the niceties of
style ;-)











>
Re: terminate a PHP script [message #172624 is a reply to message #172601] Tue, 22 February 2011 11:54 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/21/2011 10:38 PM, The Natural Philosopher wrote:
> Exactly.
> some form of limited goto is always required: teh questin is how to
> wrire it best. After all consider thus staement
>
> if ()
> {
> }
> else...
> {
> }
> what is the else, but a target for a conditional jump? Just because you
> didn't write goto, doesn't mean there aint no jump.

No argument with that part. However, when I first saw if-then-else my
reaction was "Wow! That is exactly how people think. No need to do
convoluted logic with going to different labels in one case or the other
and remembering where and how I got there and what to do next."

What is done behind the scenes to implement that logic? Why jumps, of
course, to labels created by the compiler/interpreter. So what? Why
should I care? The point was to have READABLE and MAINTAINABLE code.
Since if-then-else is how people think, it is far, far, far more
readable and maintainable than jumps. That is implemented behind the
scenes that way? So what?

As for labels being confined to the scope of the function, again so
what? Jumping off a six story building will kill you just as surely as
jumping off the Empire State Building. Your blood might spatter a
little less, but you will still be dead.

--
Shelly
Re: terminate a PHP script [message #172625 is a reply to message #172603] Tue, 22 February 2011 12:06 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/21/2011 10:55 PM, The Natural Philosopher wrote:
> sheldonlg wrote:
>> On 2/21/2011 8:46 PM, The Natural Philosopher wrote:
>>> sheldonlg wrote:
>>>> On 2/21/2011 7:28 PM, The Natural Philosopher wrote:
>>>> > sheldonlg wrote:
>>>> >> On 2/21/2011 12:06 PM, Denis McMahon wrote:
>>>> >>> On 21/02/11 16:51, n00m wrote:
>>>> >>>>> No, you should not use goto! It causes more problems than it
>>>> >>>>> solves.
>>>> >>>>
>>>> >>>> Why on the earth???
>>>> >>>> "goto" can produce 10000 empty lines in no time. Like this:
>>>> >>>
>>>> >>> Because there is no structure to a program that uses goto. When it
>>>> >>> fails
>>>> >>> to work properly (and it will) it can become impossible to see
>>>> >>> how it
>>>> >>> arrived at the point that it fails at.
>>>> >>>
>>>> >>>> $cnt = 0;
>>>> >>>>
>>>> >>>> mm:
>>>> >>>> ++$cnt;
>>>> >>>> echo '<BR>';
>>>> >>>> if ($cnt< 10000) goto mm;
>>>> >>>
>>>> >>> Your goto method uses 5 lines. A while loop uses 2:
>>>> >>>
>>>> >>> $i = 10000;
>>>> >>> while ($i--) echo "<br>\n";
>>>> >>>
>>>> >>> and a for loop only 1:
>>>> >>>
>>>> >>> for ($cnt = 10000; $cnt--;) echo "<br>\n";
>>>> >>>
>>>> >>> or:
>>>> >>>
>>>> >>> for ($cnt = 0; $cnt< 10000; $cnt++) echo "<br>\n";
>>>> >>>
>>>> >>> Rgds
>>>> >>>
>>>> >>> Denis McMahon
>>>> >>
>>>> >> I fully agree about gotos. There is NO need for them. What is wrong
>>>> >> with this pseudocode?
>>>> >>
>>>> >> ===========
>>>> >> if (passes test for failure condition) {
>>>> >> ... all the rest of the code for success that is already there
>>>> >> --- except the footer
>>>> >> }
>>>> >>
>>>> >> footer stuff.
>>>> >> ==========
>>>> >>
>>>> >> All it does is add two lines (the if test and a closing brace) and
>>>> >> one
>>>> >> level of indentation, and it does what the OP wants.
>>>> >>
>>>> >> Since seeing the if-then-else first appear in Fortran circa 1980, I
>>>> >> have never used a single goto in any language in which I have coded.
>>>> >>
>>>> > Well that's cos you never wrote Assembler :-)
>>>> >
>>>>
>>>> Correct! That was before even my time. :-) By the time I got into it
>>>> with Fortran IV, the compiled code looked an awful lot like Assembly
>>>> code. Machines should be labor saving devices. That was what the
>>>> compiler was for. Besides, it is much easier to debug and maintain a
>>>> language that is readable, and not like spaghetti code (gotos and
>>>> jumps).
>>>>
>>> The art of writing assembler, is to MAKE it readable DESPITE the
>>> language.
>>>
>>> And, if you wanted to write hardware code in the 80's for them new
>>> fangled Micro Processors, that mate, was all there was!
>>
>> I understand that. I also understand that this is three decades later.
>> Do you still wear leisure suits
>
> I never did.
>
> and sport an Afro
>
> Mm. almost
>
> or go to discos?
>
> I never did that either beyond as brief foray into running, then
> building them, in the 60. and 70's..
>
> BUT I can assure you assembler is alive and well, and still used where
> the high level languages don't cut the mustard.
>
> As I said, here we talk noddy scripts in PHP, but that's not always what
> all of us have done. Or still do.
>
> I have a project on the back burner which if I ever resurrect it, will
> have to be done in PIC or ATMEL assembler, because nothing else will get
> the speed at the price..
>
> I'll probably do a lot in C as well, the scheduler and main task will be
> assembler, because I have to squeeze every clock cycle out of it.
>
>
> I'll bet your video card is not programmed in Pascal or PHP either :-)
>
>
> And the core of whatever OS you use. Its easier to write a pre-emptive
> scheduler in assembler than even in C, though I *think* its possible
> given that the compiler can handle interrupt service routines.
>
> I do know last time I did that, it got too hard, and i coded the core in
> Assembler, and having done that, a lot more than I strictly needed to,
> simply because it was easier to keep all that low level stuff in one set
> of files.
>
>
> Its a mistake to consider that the code one writes, is of the same ilk
> as the code others write. Most of my programming has been at very low
> level, hardware, OS, drivers, Bioses, comms code, a bi of commercial
> applications, and database, but not that much till I came thisaway and
> stared writing simple stuff for web sites. I mean really people make a
> huge fuss over PHP, but its diddly squat compared to writing rom based
> assembler to bootstrap a motherboard from cold. Its interpreted, so no
> compile test debug cycles. Its block structured, so you don't have to
> worry about trampling in the wrong bit of RAM, its not time critical bar
> a few odd cases...basically you guys are just bored because you don't
> have to work hard enough, so you spend your time arguing the niceties of
> style ;-)

The point I, and others, are making is that we are talking about coding
where a high level language is appropriate. We are not talking about
the cases you mention above. I would not even attempt some of those
things because I never learned assembler and that arena did not interest
me. Not all programming is for everyone. Does an artist have to worry
about the manufacturing process of the brushes he uses? All he needs is
to know that he has a good brush to do his job. All we need to know is
that we have a good, structured, high level language to do the job we
need to do. We do not have to separate all the bristles in the brush
and then use them one at a time.

Do you own a car? If you do, then then next time you get into it to go
somewhere why don't you ask yourself "Why am I doing this? I guess it
is because I don't have to work hard enough to walk there. So, I ride
and am bored so I turn on the radio and scan through the stations."

High level languages are labor saving devices, both in the creation AND
the maintenance of code. That is why they were created!

It ain't just niceties!



--
Shelly
Re: terminate a PHP script [message #172629 is a reply to message #172576] Tue, 22 February 2011 16:59 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <ijv2mp$3tc$2(at)news(dot)albasani(dot)net>,
The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

> Peter H. Coffin wrote:
>> On Mon, 21 Feb 2011 18:50:39 +0000, Tim Streater wrote:
>>> Because of the incredible convolution and depth of nested if/then/else
>>> you can get to. If I have (as it might be) a function that's scanning a
>>> string looking for and obtaining options and their values for some
>>> command previously scanned off the string, and I detect an error, I want
>>> to set an error code and exit right there. I don't want any subsequent
>>> maintainer to have to intuit that, in fact, from this point on nested
>>> 15-deep in else clauses, no more code is executed for that path through
>>> the function.
>>>
>>> That way I rarely get more than 3-deep in if/then/else. To me, it's all
>>> about readbility.
>>
>> *grin* for me, it's all about comprehesibility. If you don't like how
>> deep you're nesting, maybe you need to break something out into a
>> function instead....
>>
> Yes, but how much stack do you have? Can you afford the overhead of a
> call/return?

Shitloads, and yes.

> How much does splitting a whole block of code to four pages
> away make the comprehensibility problem worse, not better?

Not at all, if you think about what you're doing. Here is an actual
piece of code from my application (OK, it's JavaScript and not PHP, but
the idea's the same):

switch (subItems[0])
{

case "C":
composeMail (subItems[1], tabstr);
break;

case "L":
writeLogmsg (subItems[1]);
break;

case "N":
addNewMail (subItems[1]);
break;

case "R":
replaceMail (subItems[1]);
break;

case "T":
tabstr = subItems[1];
break;

case "X":
writeLog ("RC", "failed to generate reply mail");
break;

case "Z":
break;

default:
alert ("replyContinue: " + subItems);
return;

}

Each of the functions referred to has a well-defined purpose - and in
some instances is called from more than one place. But even if there was
just the one place where a call is made, I'd still be likely to do it
this way.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: terminate a PHP script [message #172630 is a reply to message #172600] Tue, 22 February 2011 17:01 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <ijv9q5$ba1$1(at)news(dot)albasani(dot)net>,
The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

> sheldonlg wrote:
>> On 2/21/2011 8:15 PM, The Natural Philosopher wrote:
>>> Peter H. Coffin wrote:
>>>> On Mon, 21 Feb 2011 18:50:39 +0000, Tim Streater wrote:
>>>> > Because of the incredible convolution and depth of nested
>>>> > if/then/else you can get to. If I have (as it might be) a function
>>>> > that's scanning a string looking for and obtaining options and their
>>>> > values for some command previously scanned off the string, and I
>>>> > detect an error, I want to set an error code and exit right there. I
>>>> > don't want any subsequent maintainer to have to intuit that, in fact,
>>>> > from this point on nested 15-deep in else clauses, no more code is
>>>> > executed for that path through the function.
>>>> >
>>>> > That way I rarely get more than 3-deep in if/then/else. To me, it's
>>>> > all about readbility.
>>>>
>>>> *grin* for me, it's all about comprehesibility. If you don't like how
>>>> deep you're nesting, maybe you need to break something out into a
>>>> function instead....
>>>>
>>> Yes, but how much stack do you have? Can you afford the overhead of a
>>> call/return? How much does splitting a whole block of code to four pages
>>> away make the comprehensibility problem worse, not better?
>>
>> If you have fifteen pages of code within a success bracket, then you are
>> at least 8-10 times too big in the routine. It should be broken into
>> smaller segments.
>
> 'Should' and 'can' are often not the same thing.
> And a lot depends on the size of your page: remember when 80x25 was all
> you had?

I remember when 80 x 1 was all I had - an 026 or 029 card punch. Hmm,
and before that it was paper tape.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: terminate a PHP script [message #172631 is a reply to message #172575] Tue, 22 February 2011 17:04 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <ijv2h3$3tc$1(at)news(dot)albasani(dot)net>,
The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

> Tim Streater wrote:
>> In article <ijub3f$cqn$2(at)news(dot)eternal-september(dot)org>,
>> sheldonlg <sheldonlg(at)thevillages(dot)net> wrote:
>>
>>> On 21/2/2011 1:04 PM, Tim Streater wrote:
>>>> In article <iju7sd$9fc$1(at)news(dot)eternal-september(dot)org>,
>>>> Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:
>>>>
>>>> > goto is NEVER needed, and SELDOM a good thing to use. It completely
>>>> > violates structured programming practices and causes more problems
>>>> > than it solves.
>>>>
>>>> By and large this is true. With one exception, I haven't used one since
>>>> 1978 when I stopped using FORTRAN.
>>>>
>>>> The exception was when doing some Pascal under RSX-11M. There was no
>>>> "return" statement, so I had to fake one up by putting a 999: label at
>>>> the end of any procedure where I wanted an early return, and then
>>> goto 999.
>>>
>>> Again, why not if-then-else?
>>
>> You mean, as in SESE?
>>
>> Because of the incredible convolution and depth of nested if/then/else
>> you can get to. If I have (as it might be) a function that's scanning a
>> string looking for and obtaining options and their values for some
>> command previously scanned off the string, and I detect an error, I want
>> to set an error code and exit right there. I don't want any subsequent
>> maintainer to have to intuit that, in fact, from this point on nested
>> 15-deep in else clauses, no more code is executed for that path through
>> the function.
>>
>> That way I rarely get more than 3-deep in if/then/else. To me, it's all
>> about readbility.
>>
> +100
>
> Its easy to recognise people who actually write code, as opposed to
> those who tell other people how they ought to write it.
>
> Its probably easier these days with editing tools that collapse things
> with curly braces round them..but those tools wouldn't need to exist if
> people learnt to code properly, as opposed to simply in some
> academically defined 'good ' way.

Yar fine I have an editor that does this collapsing but I never use it.
Partly because my closing brace is always underneath the opening one.

> When I started in C the first thing I wrote was a program that could
> print onto a dot matrix in condensed characters, simply so the nesting
> did not run off the right hand side of the paper: with the editors then,
> a paper printout was a lot easier to follow than onscreen.

I just make the window wider :-) Even today I still see people doing
white-text-on-black in a 25x80 window. Fuck knows why.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: terminate a PHP script [message #172632 is a reply to message #172630] Tue, 22 February 2011 17:05 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/22/2011 12:01 PM, Tim Streater wrote:
>
>>>> > that's scanning a string looking for and obtaining options and their

Hmm. I remember that but in the opposite order.

--
Shelly
Re: terminate a PHP script [message #172633 is a reply to message #172632] Tue, 22 February 2011 17:07 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/22/2011 12:05 PM, sheldonlg wrote:
> On 2/22/2011 12:01 PM, Tim Streater wrote:
>>
>>>> >> that's scanning a string looking for and obtaining options and their
>
> Hmm. I remember that but in the opposite order.
>

That made no sense. Bad cut and paste. I was referring to that I
remember punch cards first and then paper tape.

--
Shelly
Re: terminate a PHP script [message #172634 is a reply to message #172570] Tue, 22 February 2011 17:18 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <ijv1cm$qeb$1(at)news(dot)eternal-september(dot)org>,
sheldonlg <sheldonlg(at)thevillages(dot)net> wrote:

> On 2/21/2011 7:28 PM, The Natural Philosopher wrote:

>> Well that's cos you never wrote Assembler :-)
>>
>
> Correct! That was before even my time. :-) By the time I got into it
> with Fortran IV, the compiled code looked an awful lot like Assembly
> code. Machines should be labor saving devices. That was what the
> compiler was for. Besides, it is much easier to debug and maintain a
> language that is readable, and not like spaghetti code (gotos and jumps).

What do you mean "[Assembler] was before even my time". Last year I
bought a 68000 single board computer [1], cranked the RAM up from
0.5Mbytes to 2Mbytes, and have spent a happy time writing a
multi-tasking kernel for it - in assembler.

And yes, you can write spaghetti in assembler too - but you don't have
to.

[1] Actually, if I'd known about the Arduino at the time I might have
bought one of those.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: terminate a PHP script [message #172635 is a reply to message #172634] Tue, 22 February 2011 17:26 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/22/2011 12:18 PM, Tim Streater wrote:
> In article <ijv1cm$qeb$1(at)news(dot)eternal-september(dot)org>,
> sheldonlg <sheldonlg(at)thevillages(dot)net> wrote:
>
>> On 2/21/2011 7:28 PM, The Natural Philosopher wrote:
>
>>> Well that's cos you never wrote Assembler :-)
>>>
>>
>> Correct! That was before even my time. :-) By the time I got into it
>> with Fortran IV, the compiled code looked an awful lot like Assembly
>> code. Machines should be labor saving devices. That was what the
>> compiler was for. Besides, it is much easier to debug and maintain a
>> language that is readable, and not like spaghetti code (gotos and jumps).
>
> What do you mean "[Assembler] was before even my time". Last year I

For applications, not for the low level board stuff. Way back before my
time, all they had was Assembler. By the time I got into it (1964),
Fortran was already there (and, ugh!, Cobol). No one I knew wrote
applications in Assembler by then.

> bought a 68000 single board computer [1], cranked the RAM up from
> 0.5Mbytes to 2Mbytes, and have spent a happy time writing a
> multi-tasking kernel for it - in assembler.
> And yes, you can write spaghetti in assembler too - but you don't have to.
>
> [1] Actually, if I'd known about the Arduino at the time I might have
> bought one of those.
>


--
Shelly
Re: terminate a PHP script [message #172638 is a reply to message #172542] Tue, 22 February 2011 22:59 Go to previous messageGo to next message
Curtis Dyer is currently offline  Curtis Dyer
Messages: 34
Registered: January 2011
Karma: 0
Member
n00m <n00m(at)narod(dot)ru> wrote:

> You, guys, are so funny puristical pureeest purists =)

It may be just me, but I thought your responses were pretty
entertaining. The Internet is srs business, I guess.

--
Curtis Dyer
<?$x='<?$x=%c%s%c;printf($x,39,$x,39);?>';printf($x,39,$x,39);?>
Re: terminate a PHP script [message #172641 is a reply to message #172624] Wed, 23 February 2011 08:15 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
sheldonlg wrote:
> On 2/21/2011 10:38 PM, The Natural Philosopher wrote:
>> Exactly.
>> some form of limited goto is always required: teh questin is how to
>> wrire it best. After all consider thus staement
>>
>> if ()
>> {
>> }
>> else...
>> {
>> }
>> what is the else, but a target for a conditional jump? Just because you
>> didn't write goto, doesn't mean there aint no jump.
>
> No argument with that part. However, when I first saw if-then-else my
> reaction was "Wow! That is exactly how people think. No need to do
> convoluted logic with going to different labels in one case or the other
> and remembering where and how I got there and what to do next."
>
> What is done behind the scenes to implement that logic? Why jumps, of
> course, to labels created by the compiler/interpreter. So what? Why
> should I care? The point was to have READABLE and MAINTAINABLE code.
> Since if-then-else is how people think, it is far, far, far more
> readable and maintainable than jumps. That is implemented behind the
> scenes that way? So what?

I think that is ultimately the whole point.

The language is a mapping between human logic and the actual hardwired
logic of the processor.

If you DO think like 'if then else', that's a good mapping.

But if your way of expressing the action required is 'if you land here,
go directly to gaol. do not pass GO, do not collect £200' then what I am
saying is that a construction that reflects that is sometimes easier.

It doesn't have to be a goto, as we have seen, a break, return, continue
or even a brace, represents the same thing in a more retysricted way.


>
> As for labels being confined to the scope of the function, again so
> what? Jumping off a six story building will kill you just as surely as
> jumping off the Empire State Building. Your blood might spatter a
> little less, but you will still be dead.
>
By definition a function is less than the whole code, so at least you
don't have to scan the whole code looking for the target.


In the end that's what this is all about: how far you have to search the
source code for that label, curly brace or whatever, to find out where
that condition takes you.

A six page if statement which then turns out to have no else is merely a
lot of nesting you can get rid of by a simple 'if not, then return;',
for example.

Likewise the solution of putting everything in nested functions, is no
solution when you are so deeply nested that an error at the bottom
level that needs to be a complete abort of all the calling functions as
well, means you have to add error processing all the way up the chain so
the original function knows that something has gone wrong in the Mariana
trench, and deal with it.

In such case a construction that can cut across and bypass all the
normal program flow is useful.

That's the setjmp/longjmp.

Of course you need to be careful. Any local stack variables will be
automatically cleaned up, but if you have .. used malloc() all bets are
off as to whether stuff will be 'free()ed.

And local static variables will remain where you left them, of course.
So you had better initialise them before you use them again.


Its a nasty piece of code to write whichever way you tackle it, but all
I am saying is that when you occasionally have to, it's better to have a
full toolbox, than one that is deliberately restricted because someone
somewhere took a purist attitude to the basic consideration of program
flow. He doesn't have to solve this problem: You do.


Lets face it, even a modern WinPeeCee has a key sequence that is thge
ultimate incarnation is 'please jump to reset, and sod everything else'

Ctrl-Alt-Del..

When I was(briefly) involved with military stuff, the practice was to
fill the ROM code with blocks of JMP RESET code in between actual
functions and statements, on the basis that of a strong EMP came along
and knocked the program stack and data registers and RAM to kingdom
come, you had some chance of being able to restart the machine. That
could also be invoked by the failure of a watchdog timer, to be reset,
which it would be if normal program flow was operational.. you really
don't want a missile flying around with its software in an indeterminate
state..

Really GOTOS are deprecated because they allow you to create
unmaintainable code too easily. They also can allow you to create MORE
maintainable code. The problem is not on the construct itself, its in
its deployment.

You don't use a chainsaw to prune. But its a useful thing to remove a
whole tree.
Re: terminate a PHP script [message #172642 is a reply to message #172625] Wed, 23 February 2011 08:18 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
sheldonlg wrote:
> On 2/21/2011 10:55 PM, The Natural Philosopher wrote:
>> sheldonlg wrote:
>>> On 2/21/2011 8:46 PM, The Natural Philosopher wrote:
>>>> sheldonlg wrote:
>>>> > On 2/21/2011 7:28 PM, The Natural Philosopher wrote:
>>>> >> sheldonlg wrote:
>>>> >>> On 2/21/2011 12:06 PM, Denis McMahon wrote:
>>>> >>>> On 21/02/11 16:51, n00m wrote:
>>>> >>>>>> No, you should not use goto! It causes more problems than it
>>>> >>>>>> solves.
>>>> >>>>>
>>>> >>>>> Why on the earth???
>>>> >>>>> "goto" can produce 10000 empty lines in no time. Like this:
>>>> >>>>
>>>> >>>> Because there is no structure to a program that uses goto. When it
>>>> >>>> fails
>>>> >>>> to work properly (and it will) it can become impossible to see
>>>> >>>> how it
>>>> >>>> arrived at the point that it fails at.
>>>> >>>>
>>>> >>>>> $cnt = 0;
>>>> >>>>>
>>>> >>>>> mm:
>>>> >>>>> ++$cnt;
>>>> >>>>> echo '<BR>';
>>>> >>>>> if ($cnt< 10000) goto mm;
>>>> >>>>
>>>> >>>> Your goto method uses 5 lines. A while loop uses 2:
>>>> >>>>
>>>> >>>> $i = 10000;
>>>> >>>> while ($i--) echo "<br>\n";
>>>> >>>>
>>>> >>>> and a for loop only 1:
>>>> >>>>
>>>> >>>> for ($cnt = 10000; $cnt--;) echo "<br>\n";
>>>> >>>>
>>>> >>>> or:
>>>> >>>>
>>>> >>>> for ($cnt = 0; $cnt< 10000; $cnt++) echo "<br>\n";
>>>> >>>>
>>>> >>>> Rgds
>>>> >>>>
>>>> >>>> Denis McMahon
>>>> >>>
>>>> >>> I fully agree about gotos. There is NO need for them. What is wrong
>>>> >>> with this pseudocode?
>>>> >>>
>>>> >>> ===========
>>>> >>> if (passes test for failure condition) {
>>>> >>> ... all the rest of the code for success that is already there
>>>> >>> --- except the footer
>>>> >>> }
>>>> >>>
>>>> >>> footer stuff.
>>>> >>> ==========
>>>> >>>
>>>> >>> All it does is add two lines (the if test and a closing brace) and
>>>> >>> one
>>>> >>> level of indentation, and it does what the OP wants.
>>>> >>>
>>>> >>> Since seeing the if-then-else first appear in Fortran circa 1980, I
>>>> >>> have never used a single goto in any language in which I have coded.
>>>> >>>
>>>> >> Well that's cos you never wrote Assembler :-)
>>>> >>
>>>> >
>>>> > Correct! That was before even my time. :-) By the time I got into it
>>>> > with Fortran IV, the compiled code looked an awful lot like Assembly
>>>> > code. Machines should be labor saving devices. That was what the
>>>> > compiler was for. Besides, it is much easier to debug and maintain a
>>>> > language that is readable, and not like spaghetti code (gotos and
>>>> > jumps).
>>>> >
>>>> The art of writing assembler, is to MAKE it readable DESPITE the
>>>> language.
>>>>
>>>> And, if you wanted to write hardware code in the 80's for them new
>>>> fangled Micro Processors, that mate, was all there was!
>>>
>>> I understand that. I also understand that this is three decades later.
>>> Do you still wear leisure suits
>>
>> I never did.
>>
>> and sport an Afro
>>
>> Mm. almost
>>
>> or go to discos?
>>
>> I never did that either beyond as brief foray into running, then
>> building them, in the 60. and 70's..
>>
>> BUT I can assure you assembler is alive and well, and still used where
>> the high level languages don't cut the mustard.
>>
>> As I said, here we talk noddy scripts in PHP, but that's not always what
>> all of us have done. Or still do.
>>
>> I have a project on the back burner which if I ever resurrect it, will
>> have to be done in PIC or ATMEL assembler, because nothing else will get
>> the speed at the price..
>>
>> I'll probably do a lot in C as well, the scheduler and main task will be
>> assembler, because I have to squeeze every clock cycle out of it.
>>
>>
>> I'll bet your video card is not programmed in Pascal or PHP either :-)
>>
>>
>> And the core of whatever OS you use. Its easier to write a pre-emptive
>> scheduler in assembler than even in C, though I *think* its possible
>> given that the compiler can handle interrupt service routines.
>>
>> I do know last time I did that, it got too hard, and i coded the core in
>> Assembler, and having done that, a lot more than I strictly needed to,
>> simply because it was easier to keep all that low level stuff in one set
>> of files.
>>
>>
>> Its a mistake to consider that the code one writes, is of the same ilk
>> as the code others write. Most of my programming has been at very low
>> level, hardware, OS, drivers, Bioses, comms code, a bi of commercial
>> applications, and database, but not that much till I came thisaway and
>> stared writing simple stuff for web sites. I mean really people make a
>> huge fuss over PHP, but its diddly squat compared to writing rom based
>> assembler to bootstrap a motherboard from cold. Its interpreted, so no
>> compile test debug cycles. Its block structured, so you don't have to
>> worry about trampling in the wrong bit of RAM, its not time critical bar
>> a few odd cases...basically you guys are just bored because you don't
>> have to work hard enough, so you spend your time arguing the niceties of
>> style ;-)
>
> The point I, and others, are making is that we are talking about coding
> where a high level language is appropriate. We are not talking about
> the cases you mention above. I would not even attempt some of those
> things because I never learned assembler and that arena did not interest
> me. Not all programming is for everyone. Does an artist have to worry
> about the manufacturing process of the brushes he uses? All he needs is
> to know that he has a good brush to do his job. All we need to know is
> that we have a good, structured, high level language to do the job we
> need to do. We do not have to separate all the bristles in the brush
> and then use them one at a time.
>
> Do you own a car? If you do, then then next time you get into it to go
> somewhere why don't you ask yourself "Why am I doing this? I guess it
> is because I don't have to work hard enough to walk there. So, I ride
> and am bored so I turn on the radio and scan through the stations."
>
> High level languages are labor saving devices, both in the creation AND
> the maintenance of code. That is why they were created!
>
> It ain't just niceties!
>
>

You miss my point.

Which was that coding is simply not challenging enough for you so you
have time to talk about niceties. :-)

That doesn't mean I advocate writing in assembler to make the job harder.

Merely that sadly for many people coding is simply the tedious and dull
job of turning specifications into 'bits in silicon' that will do a job.

Of which sometimes the only pleasure is imagining how it might be done
slightly differently.









>
Re: terminate a PHP script [message #172643 is a reply to message #172629] Wed, 23 February 2011 08:19 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Tim Streater wrote:
> In article <ijv2mp$3tc$2(at)news(dot)albasani(dot)net>,
> The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:
>
>> Peter H. Coffin wrote:
>>> On Mon, 21 Feb 2011 18:50:39 +0000, Tim Streater wrote:
>>>> Because of the incredible convolution and depth of nested
>> if/then/else >> you can get to. If I have (as it might be) a function
>> that's scanning a >> string looking for and obtaining options and
>> their values for some >> command previously scanned off the string,
>> and I detect an error, I want >> to set an error code and exit right
>> there. I don't want any subsequent >> maintainer to have to intuit
>> that, in fact, from this point on nested >> 15-deep in else clauses,
>> no more code is executed for that path through >> the function.
>>>>
>>>> That way I rarely get more than 3-deep in if/then/else. To me, it's
>> all >> about readbility.
>>>> *grin* for me, it's all about comprehesibility. If you don't like how
>>> deep you're nesting, maybe you need to break something out into a
>>> function instead....
>>> Yes, but how much stack do you have? Can you afford the overhead of
>> a call/return?
>
> Shitloads, and yes.
>
>> How much does splitting a whole block of code to four pages away make
>> the comprehensibility problem worse, not better?
>
> Not at all, if you think about what you're doing. Here is an actual
> piece of code from my application (OK, it's JavaScript and not PHP, but
> the idea's the same):
>
> switch (subItems[0])
> {
>
> case "C":
> composeMail (subItems[1], tabstr);
> break;
>
> case "L":
> writeLogmsg (subItems[1]);
> break;
>
> case "N":
> addNewMail (subItems[1]);
> break;
>
> case "R":
> replaceMail (subItems[1]);
> break;
>
> case "T":
> tabstr = subItems[1];
> break;
>
> case "X":
> writeLog ("RC", "failed to generate reply mail");
> break;
>
> case "Z":
> break;
>
> default:
> alert ("replyContinue: " + subItems);
> return;
>
> }
>
> Each of the functions referred to has a well-defined purpose - and in
> some instances is called from more than one place. But even if there was
> just the one place where a call is made, I'd still be likely to do it
> this way.
>

Yes, and I usually do it that way as well.

But not always and not slavishly.
Re: terminate a PHP script [message #172644 is a reply to message #172634] Wed, 23 February 2011 08:21 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Tim Streater wrote:
> In article <ijv1cm$qeb$1(at)news(dot)eternal-september(dot)org>,
> sheldonlg <sheldonlg(at)thevillages(dot)net> wrote:
>
>> On 2/21/2011 7:28 PM, The Natural Philosopher wrote:
>
>>> Well that's cos you never wrote Assembler :-)
>>>
>>
>> Correct! That was before even my time. :-) By the time I got into it
>> with Fortran IV, the compiled code looked an awful lot like Assembly
>> code. Machines should be labor saving devices. That was what the
>> compiler was for. Besides, it is much easier to debug and maintain a
>> language that is readable, and not like spaghetti code (gotos and jumps).
>
> What do you mean "[Assembler] was before even my time". Last year I
> bought a 68000 single board computer [1], cranked the RAM up from
> 0.5Mbytes to 2Mbytes, and have spent a happy time writing a
> multi-tasking kernel for it - in assembler.
> And yes, you can write spaghetti in assembler too - but you don't have to.
>
Yay! a real old time hacker.


> [1] Actually, if I'd known about the Arduino at the time I might have
> bought one of those.
>
Do. They are the dogs bollocks according to a mate. I have yet to plumb
the depths..
Re: terminate a PHP script [message #172651 is a reply to message #172641] Wed, 23 February 2011 13:05 Go to previous messageGo to next message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma: 0
Senior Member
On 2/23/2011 3:15 AM, The Natural Philosopher wrote:
> Likewise the solution of putting everything in nested functions, is no
> solution when you are so deeply nested that an error at the bottom
> level that needs to be a complete abort of all the calling functions as
> well, means you have to add error processing all the way up the chain so
> the original function knows that something has gone wrong in the Mariana
> trench, and deal with it.

throw new Exception('Fotta get outta here');

--
Shelly
Re: terminate a PHP script [message #172659 is a reply to message #172470] Thu, 24 February 2011 01:59 Go to previous messageGo to next message
Twayne is currently offline  Twayne
Messages: 135
Registered: September 2010
Karma: 0
Senior Member
In news:ijppa5$5vk$1(at)news(dot)eternal-september(dot)org,
Jerry Stuckle <jstucklex(at)attglobal(dot)net> typed:
:: On 2/19/2011 7:38 PM, The Natural Philosopher wrote:
::: bob wrote:
:::: how do you terminate a PHP script and ensure the footer
:::: still gets printed?
::::
:::: When i use a return statement, the HTML footer doesn't
:::: go out.
:::
::: Try:
:::
::::
::: </body>
::: </html>
::: <?
::: exit();
::::
:::
::: ;-)
::

ROFLMAO! Typical stoopid response... . You're dependable, you are; just
not for anything useful!

::
:: --
:: ==================
:: Remove the "x" from my email address
:: Jerry Stuckle
:: JDS Computer Training Corp.
:: jstucklex(at)attglobal(dot)net
:: ==================
Re: terminate a PHP script [message #172666 is a reply to message #172659] Thu, 24 February 2011 04:04 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/23/2011 8:59 PM, Twayne wrote:
> In news:ijppa5$5vk$1(at)news(dot)eternal-september(dot)org,
> Jerry Stuckle<jstucklex(at)attglobal(dot)net> typed:
> :: On 2/19/2011 7:38 PM, The Natural Philosopher wrote:
> ::: bob wrote:
> :::: how do you terminate a PHP script and ensure the footer
> :::: still gets printed?
> ::::
> :::: When i use a return statement, the HTML footer doesn't
> :::: go out.
> :::
> ::: Try:
> :::
> ::::
> :::</body>
> :::</html>
> :::<?
> ::: exit();
> ::::
> :::
> ::: ;-)
> ::
>
> ROFLMAO! Typical stoopid response... . You're dependable, you are; just
> not for anything useful!
>

A lot more useful than your shit responses - as indicated in virtually
EVERY post you make.

But then trolls only post to make themselves heard.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: terminate a PHP script [message #172670 is a reply to message #172659] Thu, 24 February 2011 12:51 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Twayne wrote:
> In news:ijppa5$5vk$1(at)news(dot)eternal-september(dot)org,
> Jerry Stuckle <jstucklex(at)attglobal(dot)net> typed:
> :: On 2/19/2011 7:38 PM, The Natural Philosopher wrote:
> ::: bob wrote:
> :::: how do you terminate a PHP script and ensure the footer
> :::: still gets printed?
> ::::
> :::: When i use a return statement, the HTML footer doesn't
> :::: go out.
> :::
> ::: Try:
> :::
> ::::
> ::: </body>
> ::: </html>
> ::: <?
> ::: exit();
> ::::
> :::
> ::: ;-)
> ::
>
> ROFLMAO! Typical stoopid response... . You're dependable, you are; just
> not for anything useful!
>
> ::
> :: --
> :: ==================
> :: Remove the "x" from my email address
> :: Jerry Stuckle
> :: JDS Computer Training Corp.
> :: jstucklex(at)attglobal(dot)net
> :: ==================
>
>
>
First of all, why repeat Jerries suitably dumb comment.

Secondly, did you not see the smiley?
Re: terminate a PHP script [message #172683 is a reply to message #172670] Thu, 24 February 2011 17:26 Go to previous messageGo to next message
Twayne is currently offline  Twayne
Messages: 135
Registered: September 2010
Karma: 0
Senior Member
In news:ik5k85$h46$2(at)news(dot)albasani(dot)net,
The Natural Philosopher <tnp(at)invalid(dot)invalid> typed:
:: Twayne wrote:
::: In news:ijppa5$5vk$1(at)news(dot)eternal-september(dot)org,
::: Jerry Stuckle <jstucklex(at)attglobal(dot)net> typed:
::::: On 2/19/2011 7:38 PM, The Natural Philosopher wrote:
:::::: bob wrote:
::::::: how do you terminate a PHP script and ensure the
::::::: footer still gets printed?
:::::::
::::::: When i use a return statement, the HTML footer doesn't
::::::: go out.
::::::
:::::: Try:
::::::
:::::::
:::::: </body>
:::::: </html>
:::::: <?
:::::: exit();
:::::::
::::::
:::::: ;-)
:::::
:::
::: ROFLMAO! Typical stoopid response... . You're
::: dependable, you are; just not for anything useful!
:::
:::::
::::: --
::::: ==================
::::: Remove the "x" from my email address
::::: Jerry Stuckle
::::: JDS Computer Training Corp.
::::: jstucklex(at)attglobal(dot)net
::::: ==================
:::
:::
:::
:: First of all, why repeat Jerries suitably dumb comment.
::
:: Secondly, did you not see the smiley?

First: Saved on typing? Just pushed his own words back on him, because he's
often an extremely poor representative for one who puts his company ad spam
in every signature. When he did have decent responses, he still managed to
get little details into them whose only purpose can only be to keep the OP
confused. That's far from being a good 'netizen so sometimes will get a
response from me on the first round, especially when he's done nothing to
help the OP but make a snide comment instead to the OP.

Two, no, I did not see any smiley. I read in Plain Text and don't translate
ANY graphic representation onscreen, so it's easy to not see them. In fact,
I still don't see the text for a smiley - looks like he might actually
insert a graphic of the smiley, not sure. Doesn't matter a whit though.

And third, since I don't normally read his posts unless I need a comedic
break, I like to watch his return responses trying to goad me into
re-replying to him, which I don't. His ego is his worst enemy and
occasionally his weaseling into exception areas is funny.

I'll also freely admit to not being the best 'netizen I could be but it's
not to a particular name; those responses could be from anyone and I'd be
likely to respond in the same manner after seeing it happen a number of
times. People have bad days, but this character seems to have quite a bit of
internal turmoil. In other words I will agitate those who respond to OP's
but provide nothing useful in the response and displays such a bold lack of
interpersonal skills. Looking at his spam-sig just now, I had the thought
that I hoped he didn't have to deal much with the public. I can just imagine
how he'd treat clients/customers.

This probably isn't what you really wanted to hear from me, but it's a
spare-time moment so I decided to respond to you. I'm the kind that says
what I mean and mean what I say, that's all. But I don't hold grudges and
never feel the need to "get even" with anyone although it may seem that way
sometimes. After all, this is usenet so you can't let other people bother
you. Anyone bothered by that sort of thing should look for venues other than
usenet type groups/mailing lists.

Regards,

Twayne`
Re: terminate a PHP script [message #172684 is a reply to message #172683] Thu, 24 February 2011 17:51 Go to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
Twayne wrote:
> In news:ik5k85$h46$2(at)news(dot)albasani(dot)net,
> The Natural Philosopher <tnp(at)invalid(dot)invalid> typed:
> :: Twayne wrote:
> ::: In news:ijppa5$5vk$1(at)news(dot)eternal-september(dot)org,
> ::: Jerry Stuckle <jstucklex(at)attglobal(dot)net> typed:
> ::::: On 2/19/2011 7:38 PM, The Natural Philosopher wrote:
> :::::: bob wrote:
> ::::::: how do you terminate a PHP script and ensure the
> ::::::: footer still gets printed?
> :::::::
> ::::::: When i use a return statement, the HTML footer doesn't
> ::::::: go out.
> ::::::
> :::::: Try:
> ::::::
> :::::::
> :::::: </body>
> :::::: </html>
> :::::: <?
> :::::: exit();
> :::::::
> ::::::
> :::::: ;-)
> :::::
> :::
> ::: ROFLMAO! Typical stoopid response... . You're
> ::: dependable, you are; just not for anything useful!
> :::
> :::::
> ::::: --
> ::::: ==================
> ::::: Remove the "x" from my email address
> ::::: Jerry Stuckle
> ::::: JDS Computer Training Corp.
> ::::: jstucklex(at)attglobal(dot)net
> ::::: ==================
> :::
> :::
> :::
> :: First of all, why repeat Jerries suitably dumb comment.
> ::
> :: Secondly, did you not see the smiley?
>
> First: Saved on typing? Just pushed his own words back on him,

Ah. That was not obvious to me.

because he's
> often an extremely poor representative for one who puts his company ad spam
> in every signature. When he did have decent responses, he still managed to
> get little details into them whose only purpose can only be to keep the OP
> confused. That's far from being a good 'netizen so sometimes will get a
> response from me on the first round, especially when he's done nothing to
> help the OP but make a snide comment instead to the OP.
>
> Two, no, I did not see any smiley. I read in Plain Text and don't translate
> ANY graphic representation onscreen, so it's easy to not see them. In fact,
> I still don't see the text for a smiley - looks like he might actually
> insert a graphic of the smiley, not sure. Doesn't matter a whit though.
>

No, I thought you were enodrsing his comment, and agreeing with him,
when I put a smiley in my original because it was only meant to be light
relief. Jerry of course Took It Seriously. In order to launch into his
usual diatribe.



> And third, since I don't normally read his posts unless I need a comedic
> break, I like to watch his return responses trying to goad me into
> re-replying to him, which I don't. His ego is his worst enemy and
> occasionally his weaseling into exception areas is funny.

Agreed. But even then it got boring, so I don't see his posts at all
unless someone else responds..

>
> I'll also freely admit to not being the best 'netizen I could be but it's
> not to a particular name; those responses could be from anyone and I'd be
> likely to respond in the same manner after seeing it happen a number of
> times. People have bad days, but this character seems to have quite a bit of
> internal turmoil.

Understatement is your forte, it seems.

> In other words I will agitate those who respond to OP's
> but provide nothing useful in the response and displays such a bold lack of
> interpersonal skills. Looking at his spam-sig just now, I had the thought
> that I hoped he didn't have to deal much with the public. I can just imagine
> how he'd treat clients/customers.
>

If you bother to trace the accounts for his company, you can answer that
question for yourself.

It is precisely what you would expect.

> This probably isn't what you really wanted to hear from me, but it's a
> spare-time moment so I decided to respond to you. I'm the kind that says
> what I mean and mean what I say, that's all. But I don't hold grudges and
> never feel the need to "get even" with anyone although it may seem that way
> sometimes. After all, this is usenet so you can't let other people bother
> you. Anyone bothered by that sort of thing should look for venues other than
> usenet type groups/mailing lists.
>

I only hold grudges insofar as I can justify them on social grounds.
I.e. being harmed personally is forgettable, but not allowing the same
person to do the same to others over and over and staying silent.

Jerry it has to be said, has never hurt me, so there could be no case of
grudge to answer. At most irritation, but once I realised that his
condition was in fact pathological,. the amusement factor of trapping
him into making a public ass of himself was too much to resist.

Having succeeded twice or three times, I got bored, but I probably did
hurt him, because he has never ceased to stalk me, here and in other
groups, to try and do the same in return. But with him being a bear of
limited brain, it's not been a huge issue.


Over the last year or so his condition seems to have deteriorated, to
the point where almost no one is prepared to support his increasingly
manic outbursts, and what little content of value he might once have
provided has eroded to almost none.

It's sad and embarrassing to watch a fellow human being humiliate
themselves, but what can one do?

Killfile is the best solution yet. At least then its a private issue.



> Regards,
>
> Twayne`
>
>
Pages (2): [ «    1  2]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Extralight browser-webserver communication via cookies (+)
Next Topic: Storing multiple character set types (or a representation of em) in a table column
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 09 00:58:28 GMT 2024

Total time taken to generate the page: 0.02320 seconds