Re: Is there a programming language that is combination of PythonandBasic?

2009-04-20 Thread Rhodri James
On Sun, 19 Apr 2009 19:25:25 +0100, Scott David Daniels  
 wrote:



Chris Jones wrote:

...
Intellectually, assembler programming is the less demanding since its
level of abstraction does not go any further than mapping a few binary
numbers to a small set of usually well-chosen mnemonics.  Unless it  
features a powerful macro-language that lets the apprentice

create his own high-level patois on top of the assembler, that is.


No, I've dealt with an assembler named 'SLOE' that had an elaborate
mechanism for laying out code in memory in a way that the CPU would
be happy with.  Between that and the instruction prefect, the thing
was famously called "immune to programming."


Similarly, TI's DSP products come with a very competant "linear
assembler" that puts you at one remove from the actual assembly
language.  This allows it to re-order your code to take advantage of
sets of instructions that can be executed in parallel, shield you
from the fact that the results of some instructions take several
cycles to arrive, and do some wonderfully bizarre loop optimisations.
I have written hand-optimised assembly for those chips, but it's
not for the faint of heart.

--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a programming language that is combination of PythonandBasic?

2009-04-19 Thread Scott David Daniels

Chris Jones wrote:

...
Intellectually, assembler programming is the less demanding since its
level of abstraction does not go any further than mapping a few binary
numbers to a small set of usually well-chosen mnemonics. 


Unless it features a powerful macro-language that lets the apprentice
create his own high-level patois on top of the assembler, that is.


No, I've dealt with an assembler named 'SLOE' that had an elaborate
mechanism for laying out code in memory in a way that the CPU would
be happy with.  Between that and the instruction prefect, the thing
was famously called "immune to programming."

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a programming language that is combination of PythonandBasic?

2009-04-19 Thread MRAB

Chris Jones wrote:

On Sun, Apr 19, 2009 at 04:35:27AM EDT, Hendrik van Rooyen wrote:

 Brian Blais   wrote:


[snip]

In my defense of the goto, I would like to make clear that I do not
support its use to produce spaghetti.  In general, muddled thinking,
coupled with expediency, is what I think are the true precursors of
spaghetti code.  The goto is an innocent tool that can be used for
good or evil.


How true.

At least goto's have the merit of naming their target.


Except in (classic) Pascal where they are unsigned integers (they still
need to be declared).


I have dealt with C code built on the original author's partiality for
200-line+ nested loops where it looked like every other line or so was
either a "break" or a "continue", goto's without the name that don't
clearly state where they are going.

Thank goodness he was not familiar with setjmp/longjmp.


--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a programming language that is combination of PythonandBasic?

2009-04-19 Thread Chris Jones
On Sun, Apr 19, 2009 at 04:35:27AM EDT, Hendrik van Rooyen wrote:
>  Brian Blais   wrote:
> 
> >On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote:

> >>to untangle some spaghetti code.  He did not mention if the
> >>spaghetti was actually doing it's job, bug free, which IMO is the
> >>only rational test for the quality of a piece of code, because it is
> >>the reason for its existence.  The aesthetics are, like all
> >>aesthetics, a matter of opinion.

> >Actually, I strongly disagree with this statement.  In my experience,
> >there has been very very few pieces of  code that I've written that I
> >hadn't wanted to *modify* at some point: extend it to a new set of
> >circumstances,  cover a different case, change the output, etc...
> >The quality of a piece of code is not just if it works right  now,
> >but if you can reasonably extend it for the future.  

+1 .. obfuscated code never remains bug-free for long.

> Your experience is different from mine - in what I mostly do, which is
> struggling around in embedded assembler, by the time the thing "works"
> it is stable, and I very seldom have to go back to fiddle with it. 

Intellectually, assembler programming is the less demanding since its
level of abstraction does not go any further than mapping a few binary
numbers to a small set of usually well-chosen mnemonics. 

Unless it features a powerful macro-language that lets the apprentice
create his own high-level patois on top of the assembler, that is.

> On the other hand, I understand what you are talking about, but I
> think that the origen of the frustration that one feels when having to
> battle with some old code, is actually inside oneself - the code is
> the same, but I have changed, and I am no longer the same as I was
> when I wrote it.

> >I toyed with Perl for a year or so, but couldn't give it my full
> >attention.  As a result, every few weeks when I wanted to modify what
> >I wrote, I had to re-learn the code all over again because the syntax
> >was so terse.  The same is true for the typical use of a goto: you
> >have to relearn the program, because the flow jumps around.  It's not
> >just about aesthetics, but about being able to work with a piece of
> >code.

> In my defense of the goto, I would like to make clear that I do not
> support its use to produce spaghetti.  In general, muddled thinking,
> coupled with expediency, is what I think are the true precursors of
> spaghetti code.  The goto is an innocent tool that can be used for
> good or evil.

How true.

At least goto's have the merit of naming their target.

I have dealt with C code built on the original author's partiality for
200-line+ nested loops where it looked like every other line or so was
either a "break" or a "continue", goto's without the name that don't
clearly state where they are going.

Thank goodness he was not familiar with setjmp/longjmp.

:-)

CJ

--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a programming language that is combination of PythonandBasic?

2009-04-19 Thread Scott David Daniels

Hendrik van Rooyen wrote:

In my defense of the goto, I would like to make clear
that I do not support its use to produce spaghetti.
In general, muddled thinking, coupled with expediency,
is what I think are the true precursors of spaghetti code.
The goto is an innocent tool that can be used for good
or evil.


The goto is a sharp, spiky dangerous tool that seduces
people into thinking of using it far too often.  It should
be used with the same respect you approach beautiful well-
armed people of questionable morals who you find attractive.

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a programming language that is combination of PythonandBasic?

2009-04-19 Thread Brian Blais

On Apr 19, 2009, at 4:35 , Hendrik van Rooyen wrote:


 Brian Blais   wrote:


On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote:



to untangle some spaghetti code.  He did not mention if
the spaghetti was actually doing it's job, bug free, which
IMO is the only rational test for the quality of a piece
of code, because it is the reason for its existence.
The aesthetics are, like all aesthetics, a matter of opinion.



Actually, I strongly disagree with this statement.
In my experience, there has been very very few
pieces of  code that I've written that I hadn't wanted
to *modify* at some point: extend it to a new set of
circumstances,  cover a different case, change the
output, etc...  The quality of a piece of code is not just
if it works right  now, but if you can reasonably extend
it for the future.


Your experience is different from mine - in what I mostly
do, which is struggling around in embedded assembler,
by the time the thing "works" it is stable, and I very
seldom have to go back to fiddle with it.

On the other hand, I understand what you are talking about,
but I think that the origen of the frustration that one feels
when having to battle with some old code, is actually inside
oneself - the code is the same, but I have changed, and I am
no longer the same as I was when I wrote it.


You're right about the person changing, not the code...for me it's  
mostly forgetting.  :)  I have found that python lets me re-learn my  
old code much faster (usually there is no re-learning necessary -  
just re-reading) then Perl, C, and Matlab.


As for fiddling with code, most of the code I write for work is for  
exploring ideas in theoretical neuroscience.  Once you have something  
that works, and you understand the problem, the next things out of  
your mouth is "I wonder what happens if this is changed?".  Change is  
the norm




In my defense of the goto, I would like to make clear
that I do not support its use to produce spaghetti.
In general, muddled thinking, coupled with expediency,
is what I think are the true precursors of spaghetti code.
The goto is an innocent tool that can be used for good
or evil.



as is true of any tool, but I think that the goto is a little too  
convenient for the sloppy thinker, and shouldn't be lying around to  
be picked up by just anyone.  :)



bb


--
Brian Blais
bbl...@bryant.edu
http://web.bryant.edu/~bblais



--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a programming language that is combination of PythonandBasic?

2009-04-19 Thread Hendrik van Rooyen
 Brian Blais   wrote:

>On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote:

>>to untangle some spaghetti code.  He did not mention if
>>the spaghetti was actually doing it's job, bug free, which
>>IMO is the only rational test for the quality of a piece
>>of code, because it is the reason for its existence.  
>>The aesthetics are, like all aesthetics, a matter of opinion.
>
>
>Actually, I strongly disagree with this statement.  
>In my experience, there has been very very few 
>pieces of  code that I've written that I hadn't wanted 
>to *modify* at some point: extend it to a new set of 
>circumstances,  cover a different case, change the 
>output, etc...  The quality of a piece of code is not just 
>if it works right  now, but if you can reasonably extend 
>it for the future.  

Your experience is different from mine - in what I mostly
do, which is struggling around in embedded assembler,
by the time the thing "works" it is stable, and I very
seldom have to go back to fiddle with it. 

On the other hand, I understand what you are talking about,
but I think that the origen of the frustration that one feels
when having to battle with some old code, is actually inside
oneself - the code is the same, but I have changed, and I am 
no longer the same as I was when I wrote it.

>I toyed with Perl for a year or so, but couldn't give it 
>my full attention.  As a result, every few weeks when I 
>wanted to modify what I wrote, I had to re-learn the 
>code all over again because the syntax was so terse.
>The same is true for the typical use of a goto: you have 
>to relearn the program, because the flow jumps around.
>It's not just about aesthetics, but about being able to 
>work with a piece of code.

In my defense of the goto, I would like to make clear
that I do not support its use to produce spaghetti.
In general, muddled thinking, coupled with expediency,
is what I think are the true precursors of spaghetti code.
The goto is an innocent tool that can be used for good
or evil.

- Hendrik


--
http://mail.python.org/mailman/listinfo/python-list