![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Oh wow. 42 years later, it still exists:
http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
"Go to considered harmful."
Well there we are. I have to say, not the most convincing description of
the problem I've ever seen.
I also note, with some interest, what looks suspiciously like Haskell
syntax, in a letter typed 42 years ago. Obviously it's not after
Haskell, but rather whatever mathematical formalism Haskell borrowed the
notation from. Still, interesting none the less...)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Orchid XP v8 wrote:
> Oh wow. 42 years later, it still exists:
>
> http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
>
> "Go to considered harmful."
I must say, I love how steampunk he sounds.
> Well there we are. I have to say, not the most convincing description of
> the problem I've ever seen.
It's the difference between programming and computer science, is all. Plus,
you probably grew up after things like while statements and if statements
with actual bodies were common. Where do you think that came from? :-)
> I also note, with some interest, what looks suspiciously like Haskell
> syntax, in a letter typed 42 years ago. Obviously it's not after
> Haskell, but rather whatever mathematical formalism Haskell borrowed the
> notation from. Still, interesting none the less...)
Did you look at that link I posted about the semantics of programming
langauges?
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 15-10-2010 23:52, Orchid XP v8 wrote:
> Oh wow. 42 years later, it still exists:
>
> http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
>
> "Go to considered harmful."
also not the last paragraph in
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/EWD1308.html
> Well there we are. I have to say, not the most convincing description of
> the problem I've ever seen.
That may be because you know what happened next *and* were not living at
that time. Sort of like blaming Darwin that he failed to acknowledge the
ribosome as evidence for evolution.
> I also note, with some interest, what looks suspiciously like Haskell
> syntax, in a letter typed 42 years ago. Obviously it's not after
> Haskell, but rather whatever mathematical formalism Haskell borrowed the
> notation from. Still, interesting none the less...)
What syntax specifically?
I think (but I was not yet part of the scene then) that people were
looking for good notation. They knew that programming and mathematics
had a lot in common. Yet things that were obvious in von Neumann
machines (assignments and control flow statements in particular) did not
have a direct counterpart in maths.
A problem that is not entirely solved even today. Haskell and other
languages try to deal with it by restriction to a a paradigm that is
closer to math than the imperative way of thinking. The downside of that
is that problems that are easier solved in another paradigm become more
complicated. Perhaps there are also people working on extending maths to
include time-dependent behaviour.
Fact is that we as humans solve problems using a lot of techniques.
Choosing whatever seems appropriate at the time. That is why I think a
good programmer needs to be familiar with at least three or four
different languages.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
andrel wrote:
> at least three or four different languages.
Noting that C, C++, C#, Java, and Pascal are all "the same language" for
these purposes. ;-)
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Orchid XP v8 <voi### [at] dev null> wrote:
> Oh wow. 42 years later, it still exists:
>
> http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
>
> "Go to considered harmful."
a classic! I'm glad you've been interested in the evolution of programming
formalisms -- and all by yourself! Next on, the lambda papers! ;)
> I also note, with some interest, what looks suspiciously like Haskell
> syntax, in a letter typed 42 years ago. Obviously it's not after
> Haskell, but rather whatever mathematical formalism Haskell borrowed the
> notation from. Still, interesting none the less...)
bwahahahaha
you must be talking about `conditional expressions as introduced by J.McCarthy
("B1 -> E1, B2 -> E2,....., Bn -> En")'... although it looks like currying
haskell notation, it's actually what it's told: John McCarthy's conditional
expressions for Lisp!
(cond
((null? ls) 0)
((zero? (car ls)) 0)
(#t (/ n (car ls))))
cond was blowderized and adapted to all other programming languages in the
simplified form if-then-else... even Lisp provides it as well as cond!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> andrel wrote:
> > at least three or four different languages.
>
> Noting that C, C++, C#, Java, and Pascal are all "the same language" for
> these purposes. ;-)
they are all Algol.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"nemesis" <nam### [at] gmail com> wrote:
> Orchid XP v8 <voi### [at] dev null> wrote:
> > Oh wow. 42 years later, it still exists:
> >
> > http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
> >
> > "Go to considered harmful."
>
> a classic! I'm glad you've been interested in the evolution of programming
> formalisms -- and all by yourself! Next on, the lambda papers! ;)
>
> > I also note, with some interest, what looks suspiciously like Haskell
> > syntax, in a letter typed 42 years ago. Obviously it's not after
> > Haskell, but rather whatever mathematical formalism Haskell borrowed the
> > notation from. Still, interesting none the less...)
>
> bwahahahaha
>
> you must be talking about `conditional expressions as introduced by J.McCarthy
> ("B1 -> E1, B2 -> E2,....., Bn -> En")'... although it looks like currying
> haskell notation, it's actually what it's told: John McCarthy's conditional
> expressions for Lisp!
>
> (cond
> ((null? ls) 0)
> ((zero? (car ls)) 0)
> (#t (/ n (car ls))))
>
> cond was blowderized and adapted to all other programming languages in the
> simplified form if-then-else... even Lisp provides it as well as cond!
in other words: "I am your father!" :D
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Orchid XP v8 <voi### [at] dev null> wrote:
> "Go to considered harmful."
Some people go to (pun semi-intended) extremes with the structured
programming paradigm and have the firm stance that anything even resembling
'goto' should be avoided, such as 'break', 'continue' and early returns
(iow. the only 'return' that a function can have is at the end of the
function, nowhere else). Likewise no "fall-through" in switch-case blocks
in languages like C (although this has less to do with goto-like statements
and more to do with structured programming).
Sometimes this principle is good and leads in a natural way to imperative
code that is cleaner, simpler and easier to read. Othertimes, however, it
leads to the contrary. My favorite example is this (C++-like code, but the
same could be written in any imperative language supporting early returns):
Value* MyClass::searchForValue(const Value& value)
{
for(size_t x = 0; x < mValues.size(); ++x)
for(size_t y = 0; y < mValues[x].size(); ++y)
for(size_t z = 0; z < mValues[x][y].size(); ++z)
if(mValues[x][y][z] == value)
return &mValues[x][y][z];
return 0;
}
If you want to avoid the early return in that function, you have to
jump through quite many hoops, all of which make the code more complicated,
without making it any more readable.
As a personal preference, I also prefer writing code like this:
int someFunction(param1, param2, param3)
{
if(param1_is_not_ok) return error_code1;
some_code; // code needed to see if param2 is ok
if(param2_is_not_ok) return error_code2;
more_code; // needed to see if param3 is ok
if(param3_is_not_ok) return error_code3;
significant_amount_of_code;
return ok_code;
}
Even though it could perfectly well be written without the early returns:
int someFunction(param1, param2, param3)
{
int retval = ok_code;
if(param1_is_not_ok) retval = error_code1;
else
{
some_code; // code needed to see if param2 is ok
if(param2_is_not_ok) retval = error_code2;
else
{
more_code; // needed to see if param3 is ok
if(param3_is_not_ok) retval = error_code3;
else
{
significant_amount_of_code;
}
}
}
return retval;
}
The more such error situations there could be, the more indentation the
code would require which is not only inconvenient but also IMO makes the
code less readable. (After all, in my preferred form all the error checking
is nicely at the same indentation level, rather than each subsequent check
being indented more than the previous.)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> "Go to considered harmful."
>
> I must say, I love how steampunk he sounds.
With a name like "Edsger W. Dijkstra", I'm guessing English isn't his
first language.
>> Well there we are. I have to say, not the most convincing description
>> of the problem I've ever seen.
>
> It's the difference between programming and computer science, is all.
> Plus, you probably grew up after things like while statements and if
> statements with actual bodies were common. Where do you think that came
> from? :-)
I don't pretend to know much about history. It just seems fairly
self-evident that having formally organised stuff makes it easier to
comprehend than unorganised stuff. Hell, if you said that phrase to
somebody who knows nothing about computers, they'd probably agree with you.
> Did you look at that link I posted about the semantics of programming
> langauges?
When?
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Orchid XP v8 wrote:
>>> "Go to considered harmful."
>>
>> I must say, I love how steampunk he sounds.
>
> With a name like "Edsger W. Dijkstra", I'm guessing English isn't his
> first language.
Yes, I had considered that as well. He still gives a lovely victorian
wording to high-tech building-automated-machinery, hence my observation.
> I don't pretend to know much about history. It just seems fairly
> self-evident that having formally organised stuff makes it easier to
> comprehend than unorganised stuff.
Dijkstra is one of the few who figured out what "formally organized" means
for imperative computer programs. He's the one who figured out how you can
look at a program and say "this one will be easy to understand because it is
well organized, and that one will be difficult because it is not well
organized." Indeed, "formally organized" is what he's defining in that paper.
>> Did you look at that link I posted about the semantics of programming
>> langauges?
>
> When?
Probably a couple weeks back. Let me see if I can find it again.
Ah. There.
http://web.archive.org/web/20040410154109/cs.wwc.edu/~aabyan/PLBook/HTML/Semantics.html
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |