Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 23 |
Nodes: | 6 (0 / 6) |
Uptime: | 49:51:09 |
Calls: | 583 |
Files: | 1,138 |
Messages: | 111,303 |
On Sat, 23 Aug 2025 19:45:19 -0400, Arne Vajh|+j wrote:
1) VMS Basic using = for both assignment and equal comparison,
while most other languages use different symbols (= and ==,
:= and =, = and .eq., ...)
But they only apply to non VMS Basic developers.
Nearly all BASICs were like that, including I think Microsoft BASIC.
On Sat, 23 Aug 2025 23:49:14 -0000 (UTC), Lawrence DrCOOliveiro wrote:
On Sat, 23 Aug 2025 19:45:19 -0400, Arne Vajh|+j wrote:
1) VMS Basic using = for both assignment and equal comparison,
while most other languages use different symbols (= and ==,
:= and =, = and .eq., ...)
But they only apply to non VMS Basic developers.
Nearly all BASICs were like that, including I think Microsoft BASIC.
One trick they missed was allowing interval comparisons like this:
if "0" <= ch <= "9" or "a" <= ch <= "f" or "A" <= ch <= "F" :
I think only Python has that.
On 8/24/2025 10:34 PM, Lawrence D?Oliveiro wrote:
One trick they missed was allowing interval comparisons like this:
if "0" <= ch <= "9" or "a" <= ch <= "f" or "A" <= ch <= "F" :
I think only Python has that.
Yes.
But note that the feature is not "interval comparison" but
"chaining comparison operators".
The above example is very readable and makes sense.
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
On 2025-08-25, Arne Vajh|+j <arne@vajhoej.dk> wrote:
On 8/24/2025 10:34 PM, Lawrence D?Oliveiro wrote:
One trick they missed was allowing interval comparisons like this:
if "0" <= ch <= "9" or "a" <= ch <= "f" or "A" <= ch <= "F" :
I think only Python has that.
Yes.
But note that the feature is not "interval comparison" but
"chaining comparison operators".
The above example is very readable and makes sense.
Just don't try getting that code past me without first having used
brackets around the subexpressions. :-)
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
I am all for shoveling lots of parenthesis's all over the code to make
it really obvious.
On 2025-08-25, Arne Vajh|+j <arne@vajhoej.dk> wrote:
On 8/24/2025 10:34 PM, Lawrence D?Oliveiro wrote:
One trick they missed was allowing interval comparisons like this:
if "0" <= ch <= "9" or "a" <= ch <= "f" or "A" <= ch <= "F" :
I think only Python has that.
Yes.
But note that the feature is not "interval comparison" but
"chaining comparison operators".
The above example is very readable and makes sense.
Just don't try getting that code past me without first having used
brackets around the subexpressions. :-)
True1 < 3 < 4
False1 < (3 < 4)
On 2025-08-25, Arne Vajhoj <arne@vajhoej.dk> wrote:
On 8/24/2025 10:34 PM, Lawrence D?Oliveiro wrote:
One trick they missed was allowing interval comparisons like this:
if "0" <= ch <= "9" or "a" <= ch <= "f" or "A" <= ch <= "F" :
I think only Python has that.
Yes.
But note that the feature is not "interval comparison" but
"chaining comparison operators".
The above example is very readable and makes sense.
Just don't try getting that code past me without first having used
brackets around the subexpressions. :-)
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
On 2025-08-25, Arne Vajh|+j <arne@vajhoej.dk> wrote:
On 8/24/2025 10:34 PM, Lawrence D?Oliveiro wrote:
One trick they missed was allowing interval comparisons like this:
if "0" <= ch <= "9" or "a" <= ch <= "f" or "A" <= ch <= "F" :
I think only Python has that.
Yes.
But note that the feature is not "interval comparison" but
"chaining comparison operators".
The above example is very readable and makes sense.
Just don't try getting that code past me without first having used
brackets around the subexpressions. :-)
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
On 8/29/2025 9:11 AM, Dan Cross wrote:
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
On 2025-08-25, Arne Vajh|+j <arne@vajhoej.dk> wrote:
[snip]
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
Which is why I always preferred working for people with well defined
local coding (and comment) standards. And, yes, I have worked for both.
In article <mhdnkaF9t36U1@mid.individual.net>,
bill <bill.gunshannon@gmail.com> wrote:
On 8/29/2025 9:11 AM, Dan Cross wrote:
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
On 2025-08-25, Arne Vajh|+j <arne@vajhoej.dk> wrote:
[snip]
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
Which is why I always preferred working for people with well defined
local coding (and comment) standards. And, yes, I have worked for both.
Yup, though this doesn't _really_ address the question.
But yes: having a locally agreed upon style for such things is a
_huge_ boon for maintainability, particularly across a large
codebase. Sure, it's fun to belly up to the virtual bar and
debate the relative merits of different styles on USENET,
complete with contrived examples for or against different
conventions. But the reality is that if one is consistent
within a code base, it doesn't really matter all that much;
competent programmers will absorb the rules in a matter of days
or weeks.
The issue is that someone has to define the style and then
mandate its use, and it has to be enforced through rigorous
review and automated tooling. Given a sufficiently large group
of users, not everyone is going to agree with every rule; the
trick is in getting them to follow those rules regardless.
On 8/29/2025 9:24 AM, Dan Cross wrote:
In article <mhdnkaF9t36U1@mid.individual.net>,
bill <bill.gunshannon@gmail.com> wrote:
On 8/29/2025 9:11 AM, Dan Cross wrote:
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
On 2025-08-25, Arne Vajh|+j <arne@vajhoej.dk> wrote:
[snip]
But it is less obvious with other operators.
Example:
4 == 4 == True
Most languages (possible all exception Python) evaluate
that to True, because it is treated like:
(4 == 4) == True
But it is False in Python because it is treated like:
(4 == 4) and (4 == True)
Which feels less natural.
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
Which is why I always preferred working for people with well defined
local coding (and comment) standards. And, yes, I have worked for both.
Yup, though this doesn't _really_ address the question.
But yes: having a locally agreed upon style for such things is a
_huge_ boon for maintainability, particularly across a large
codebase. Sure, it's fun to belly up to the virtual bar and
debate the relative merits of different styles on USENET,
complete with contrived examples for or against different
conventions. But the reality is that if one is consistent
within a code base, it doesn't really matter all that much;
competent programmers will absorb the rules in a matter of days
or weeks.
The issue is that someone has to define the style and then
mandate its use, and it has to be enforced through rigorous
review and automated tooling. Given a sufficiently large group
of users, not everyone is going to agree with every rule; the
trick is in getting them to follow those rules regardless.
If you are an employee you either comply, find a new position
or get fired. No real trick at all.
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
On 2025-08-29, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
You write them for the people who come after you who have to
maintain and extend them. People who have a good understanding
of the language but may have your level of expertise/knowledge/skills.
You write them for the people who understand most of the algorithms
involved, but maybe not at the level you do.
You also write them for yourself a couple of years from now and who
is now looking at this code written a couple of years ago and is now wondering which &*%&^% idiot wrote this code like this in the first
place :-)
On 2025-08-29, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
You write them for the people who come after you who have to
maintain and extend them. People who have a good understanding
of the language but may have your level of expertise/knowledge/skills.
You write them for the people who understand most of the algorithms
involved, but maybe not at the level you do.
You also write them for yourself a couple of years from now and who
is now looking at this code written a couple of years ago and is now wondering which &*%&^% idiot wrote this code like this in the first
place :-)
On 2025-08-29, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
Which again, comes back to what I think is _actually_ the
interesting question: who do we write these programs for?
You write them for the people who come after you who have to
maintain and extend them. People who have a good understanding
of the language but may have your level of expertise/knowledge/skills.
You write them for the people who understand most of the algorithms
involved, but maybe not at the level you do.
You also write them for yourself a couple of years from now and who
is now looking at this code written a couple of years ago and is now >wondering which &*%&^% idiot wrote this code like this in the first
place :-)
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
On 8/29/2025 9:11 AM, Dan Cross wrote:
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
I doubt that.
I would expect with parenthesis's:
actually read expression : 2 second
thinking "nice to see good craftmanship" : 1 second
and without:
actually read expression : 1.9 second
thinking "arghh - this code looks written in hast - should I raise an
issue? No - there are probably more important issues!" : 3 seconds
:-)
In article <68b2087a$0$712$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
On 8/29/2025 9:11 AM, Dan Cross wrote:
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
I doubt that.
I would expect with parenthesis's:
actually read expression : 2 second
thinking "nice to see good craftmanship" : 1 second
if ((a == 6) || (a == 7)) {
// do the thing...
}
"Huh; I wonder why they parenthesized `a == 6` and `a == 7`....
the operator precedence is obvious, so what am I missing here?
"Huh; I wonder why they parenthesized `a == 6` and `a == 7`....
the operator precedence is obvious, so what am I missing here?
Not being an expert.
On 8/29/2025 5:44 PM, Dan Cross wrote:
In article <68b2087a$0$712$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
On 8/29/2025 9:11 AM, Dan Cross wrote:
In article <108k9de$1f69$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
And _this_ is an example of why Simon's policy of backets around
everything makes it explicitly clear what was intended. :-)
*At some expense for expert users.
I doubt that.
I would expect with parenthesis's:
actually read expression : 2 second
thinking "nice to see good craftmanship" : 1 second
if ((a == 6) || (a == 7)) {
// do the thing...
}
"Huh; I wonder why they parenthesized `a == 6` and `a == 7`....
the operator precedence is obvious, so what am I missing here?
Not being an expert.
There are experts that like to drizzle parenthesis's out
over the code.
There are experts that do not like to drizzle parenthesis's out
over the code.
There are no experts that has never heard of the practice of
drizzling parenthesis's out over the code.
On Fri, 29 Aug 2025 19:01:21 -0400, Arne Vajh|+j wrote:
"Huh; I wonder why they parenthesized `a == 6` and `a == 7`....
the operator precedence is obvious, so what am I missing here?
Not being an expert.
Not knowing how to keep docs handy?
In article <mhdnkaF9t36U1@mid.individual.net>,
bill <bill.gunshannon@gmail.com> wrote:
Which is why I always preferred working for people with well defined
local coding (and comment) standards. And, yes, I have worked for both.
Yup, though this doesn't _really_ address the question.
But yes: having a locally agreed upon style for such things is a
_huge_ boon for maintainability, particularly across a large
codebase. Sure, it's fun to belly up to the virtual bar and
debate the relative merits of different styles on USENET,
complete with contrived examples for or against different
conventions. But the reality is that if one is consistent
within a code base, it doesn't really matter all that much;
competent programmers will absorb the rules in a matter of days
or weeks.
The issue is that someone has to define the style and then
mandate its use, and it has to be enforced through rigorous
review and automated tooling. Given a sufficiently large group
of users, not everyone is going to agree with every rule; the
trick is in getting them to follow those rules regardless.
On 8/29/2025 9:24 AM, Dan Cross wrote:
In article <mhdnkaF9t36U1@mid.individual.net>,
bill <bill.gunshannon@gmail.com> wrote:
Which is why I always preferred working for people with well defined
local coding (and comment) standards. And, yes, I have worked for both.
Yup, though this doesn't _really_ address the question.
But yes: having a locally agreed upon style for such things is a
_huge_ boon for maintainability, particularly across a large
codebase. Sure, it's fun to belly up to the virtual bar and
debate the relative merits of different styles on USENET,
complete with contrived examples for or against different
conventions. But the reality is that if one is consistent
within a code base, it doesn't really matter all that much;
competent programmers will absorb the rules in a matter of days
or weeks.
Yes.
The issue is that someone has to define the style and then
mandate its use, and it has to be enforced through rigorous
review and automated tooling. Given a sufficiently large group
of users, not everyone is going to agree with every rule; the
trick is in getting them to follow those rules regardless.
It does not take that much to get coding conventions
followed.
If >5% of code is reviewed and not following coding
convention get flagged and the guilty get asked to fix
the code *and* other code that has same problem, then
in a few months everyone is following. The risk of
non compliance eventually being detected and the hassle
of doing the fixes makes it easier to do the right
thing the first time.