Here's something that I'd like to propose for the style guide, based
on my teaching experience:
dynamically set
A lot of people find the [; foo( syntax confusing, and since it is
commonly used, it often gets in the way of newbies understanding the
patch. While the [; foo( syntax is definitely useful for dynamic
sends, I don't think there is an advantage to using for the regular
sends. So for example:
[dsp 1( | [send pd]
instead of
|; / |pd dsp 1 \
This change highlights the dataflow aspect of the messages over the
text-style programming with syntax of the message box. At the very
least, I think that the help patches should use this style, and I have
started to use this style in my regular programming and it feels quite
natural once you are used to it. I find it easier to read.
(as for [s foo] versus [send foo] that's an issue I want to avoid in
this discussion).
.hc
The arc of history bends towards justice. - Dr. Martin Luther
King, Jr.
hmm.. generally this could be a good idea, but message sending is most useful when initialising a number of receives ie:
[loadbang] | |; init-1 6 / |; init-2 symbol foo | |; init-3 -2 \
which is far more elegant than the the trigger/send replacement, especially with more fields..
i think its important for students to recognise that this feature of messaging has a role to play, rather than trying to veil its use. in my experience people will tend to use [send foo] more often when they start pd, then begin abbreviating to [s foo] before they appreciate the msg shorthand [; foo[. but you are right it is a little confusing for new users..
perhaps this just needs clearer documenting? 'what does a semi-colon at the start of a message mean?' in the FAQ?
dmotd
On Friday 20 March 2009 10:38:06 Hans-Christoph Steiner wrote:
Here's something that I'd like to propose for the style guide, based on my teaching experience:
- use [send foo] instead of [; foo( for all sends that aren't
dynamically set
A lot of people find the [; foo( syntax confusing, and since it is commonly used, it often gets in the way of newbies understanding the patch. While the [; foo( syntax is definitely useful for dynamic sends, I don't think there is an advantage to using for the regular sends. So for example:
[dsp 1(
[send pd]
instead of
|; / |pd dsp 1 \
This change highlights the dataflow aspect of the messages over the text-style programming with syntax of the message box. At the very least, I think that the help patches should use this style, and I have started to use this style in my regular programming and it feels quite natural once you are used to it. I find it easier to read.
(as for [s foo] versus [send foo] that's an issue I want to avoid in this discussion).
.hc
The arc of history bends towards justice. - Dr. Martin Luther King, Jr.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I am not proposing to limit the use of dollar args in message boxes
for dynamic sends, that is a very useful feature. The example you give
here, though, is an example of a shortcut for typing, there is no
other benefit that I can see.
And at the risk of sounding pedantic, I am going to quote one of my
favorite ideas relating to code: "Programs should be written for
people to read, and only incidentally for machines to execute".
Typing shortcuts like this message box below almost never save time
when you look at the whole picture. Code is read far more times than
it is written, so really we should be optimizing for reading rather
than writing.
In Pd, [trigger] is the central mechanism for specifying execution
order. Therefore, in the interest of readability, [trigger] should be
used as much as possible.
Clearer documentation of the messages boxes would also be a great
thing. But you almost anything without ever using a semi-colon in a
message box, they are mostly used as a typing shortcut, and many
people are confused by them, so I think we should really be limiting
them to things like dynamic sends, since that is hard to do in other
ways.
.hc
On Mar 20, 2009, at 1:32 AM, dmotd wrote:
hmm.. generally this could be a good idea, but message sending is
most useful when initialising a number of receives ie:[loadbang] | |; init-1 6 / |; init-2 symbol foo | |; init-3 -2 \
which is far more elegant than the the trigger/send replacement,
especially with more fields..i think its important for students to recognise that this feature of
messaging has a role to play, rather than trying to veil its use. in my
experience people will tend to use [send foo] more often when they start pd,
then begin abbreviating to [s foo] before they appreciate the msg shorthand [;
foo[. but you are right it is a little confusing for new users..perhaps this just needs clearer documenting? 'what does a semi-colon
at the start of a message mean?' in the FAQ?dmotd
On Friday 20 March 2009 10:38:06 Hans-Christoph Steiner wrote:
Here's something that I'd like to propose for the style guide, based on my teaching experience:
- use [send foo] instead of [; foo( for all sends that aren't
dynamically set
A lot of people find the [; foo( syntax confusing, and since it is commonly used, it often gets in the way of newbies understanding the patch. While the [; foo( syntax is definitely useful for dynamic sends, I don't think there is an advantage to using for the regular sends. So for example:
[dsp 1(
[send pd]
instead of
|; / |pd dsp 1 \
This change highlights the dataflow aspect of the messages over the text-style programming with syntax of the message box. At the very least, I think that the help patches should use this style, and I
have started to use this style in my regular programming and it feels
quite natural once you are used to it. I find it easier to read.(as for [s foo] versus [send foo] that's an issue I want to avoid in this discussion).
.hc
The arc of history bends towards justice. - Dr. Martin Luther King, Jr.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Programs should be written for people to read, and only incidentally
for machines to execute.
--- On Fri, 3/20/09, Hans-Christoph Steiner hans@eds.org wrote:
From: Hans-Christoph Steiner hans@eds.org Subject: Re: [PD] style guide idea: [send foo] versus [; foo( To: "dmotd" dmotd@gmx.net Cc: pd-list@iem.at Date: Friday, March 20, 2009, 5:25 PM I am not proposing to limit the use of dollar args in message boxes for dynamic sends, that is a very useful feature. The example you give here, though, is an example of a shortcut for typing, there is no other benefit that I can see.
And at the risk of sounding pedantic, I am going to quote one of my favorite ideas relating to code: "Programs should be written for people to read, and only incidentally for machines to execute". Typing shortcuts like this message box below almost never save time when you look at the whole picture. Code is read far more times than it is written, so really we should be optimizing for reading rather than writing.
Could you give an example that is more readable than the message box below?
-Jonathan
In Pd, [trigger] is the central mechanism for specifying execution order. Therefore, in the interest of readability, [trigger] should be used as much as possible.
Clearer documentation of the messages boxes would also be a great thing. But you almost anything without ever using a semi-colon in a message box, they are mostly used as a typing shortcut, and many people are confused by them, so I think we should really be limiting them to things like dynamic sends, since that is hard to do in other ways.
.hc
On Mar 20, 2009, at 1:32 AM, dmotd wrote:
hmm.. generally this could be a good idea, but message
sending is most useful
when initialising a number of receives ie:
[loadbang] | |; init-1 6 / |; init-2 symbol foo | |; init-3 -2 \
which is far more elegant than the the trigger/send
replacement, especially
with more fields..
i think its important for students to recognise that
this feature of messaging
has a role to play, rather than trying to veil its
use. in my experience
people will tend to use [send foo] more often when
they start pd, then begin
abbreviating to [s foo] before they appreciate the msg
shorthand [; foo[. but
you are right it is a little confusing for new users..
perhaps this just needs clearer documenting? 'what
does a semi-colon at the
start of a message mean?' in the FAQ?
dmotd
On Friday 20 March 2009 10:38:06 Hans-Christoph
Steiner wrote:
Here's something that I'd like to propose
for the style guide, based
on my teaching experience:
- use [send foo] instead of [; foo( for all sends
that aren't
dynamically set
A lot of people find the [; foo( syntax confusing,
and since it is
commonly used, it often gets in the way of newbies
understanding the
patch. While the [; foo( syntax is definitely
useful for dynamic
sends, I don't think there is an advantage to
using for the regular
sends. So for example:
[dsp 1(
[send pd]
instead of
|; / |pd dsp 1 \
This change highlights the dataflow aspect of the
messages over the
text-style programming with syntax of the message
box. At the very
least, I think that the help patches should use
this style, and I have
started to use this style in my regular
programming and it feels quite
natural once you are used to it. I find it easier
to read.
(as for [s foo] versus [send foo] that's an
issue I want to avoid in
this discussion).
.hc
The arc of history bends towards justice. -
Dr. Martin Luther
King, Jr.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Programs should be written for people to read, and only incidentally for machines to execute.
- from Structure and Interpretation of Computer Programs
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mar 20, 2009, at 5:51 PM, Jonathan Wilkes wrote:
--- On Fri, 3/20/09, Hans-Christoph Steiner hans@eds.org wrote:
From: Hans-Christoph Steiner hans@eds.org Subject: Re: [PD] style guide idea: [send foo] versus [; foo( To: "dmotd" dmotd@gmx.net Cc: pd-list@iem.at Date: Friday, March 20, 2009, 5:25 PM I am not proposing to limit the use of dollar args in message boxes for dynamic sends, that is a very useful feature. The example you give here, though, is an example of a shortcut for typing, there is no other benefit that I can see.
And at the risk of sounding pedantic, I am going to quote one of my favorite ideas relating to code: "Programs should be written for people to read, and only incidentally for machines to execute". Typing shortcuts like this message box below almost never save time when you look at the whole picture. Code is read far more times than it is written, so really we should be optimizing for reading rather than writing.
Could you give an example that is more readable than the message box
below?
The key part is that [trigger] is the essential way in Pd to represent
execution order. As Frank says: "use [trigger]s everywhere". Then by
breaking out the messages into their own message boxes, you can
clearly see what the messages that are being send separately from
their destination.
Having lines of text execute in top-to-bottom may be more readable for
code like Java, C, etc., but Pd uses right-to-left to represent
execution order, hence trigger.
.hc
-Jonathan
In Pd, [trigger] is the central mechanism for specifying execution order. Therefore, in the interest of readability, [trigger] should be used as much as possible.
Clearer documentation of the messages boxes would also be a great thing. But you almost anything without ever using a semi-colon in a message box, they are mostly used as a typing shortcut, and many people are confused by them, so I think we should really be limiting them to things like dynamic sends, since that is hard to do in other ways.
.hc
On Mar 20, 2009, at 1:32 AM, dmotd wrote:
hmm.. generally this could be a good idea, but message
sending is most useful
when initialising a number of receives ie:
[loadbang] | |; init-1 6 / |; init-2 symbol foo | |; init-3 -2 \
which is far more elegant than the the trigger/send
replacement, especially
with more fields..
i think its important for students to recognise that
this feature of messaging
has a role to play, rather than trying to veil its
use. in my experience
people will tend to use [send foo] more often when
they start pd, then begin
abbreviating to [s foo] before they appreciate the msg
shorthand [; foo[. but
you are right it is a little confusing for new users..
perhaps this just needs clearer documenting? 'what
does a semi-colon at the
start of a message mean?' in the FAQ?
dmotd
On Friday 20 March 2009 10:38:06 Hans-Christoph
Steiner wrote:
Here's something that I'd like to propose
for the style guide, based
on my teaching experience:
- use [send foo] instead of [; foo( for all sends
that aren't
dynamically set
A lot of people find the [; foo( syntax confusing,
and since it is
commonly used, it often gets in the way of newbies
understanding the
patch. While the [; foo( syntax is definitely
useful for dynamic
sends, I don't think there is an advantage to
using for the regular
sends. So for example:
[dsp 1(
[send pd]
instead of
|; / |pd dsp 1 \
This change highlights the dataflow aspect of the
messages over the
text-style programming with syntax of the message
box. At the very
least, I think that the help patches should use
this style, and I have
started to use this style in my regular
programming and it feels quite
natural once you are used to it. I find it easier
to read.
(as for [s foo] versus [send foo] that's an
issue I want to avoid in
this discussion).
.hc
The arc of history bends towards justice. -
Dr. Martin Luther
King, Jr.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Programs should be written for people to read, and only incidentally for machines to execute.
- from Structure and Interpretation of Computer Programs
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Computer science is no more related to the computer than astronomy is
related to the telescope. -Edsger Dykstra
--- On Sat, 3/21/09, Hans-Christoph Steiner hans@eds.org wrote:
From: Hans-Christoph Steiner hans@eds.org Subject: Re: [PD] style guide idea: [send foo] versus [; foo( To: jancsika@yahoo.com Cc: "dmotd" dmotd@gmx.net, pd-list@iem.at Date: Saturday, March 21, 2009, 2:48 AM On Mar 20, 2009, at 5:51 PM, Jonathan Wilkes wrote:
--- On Fri, 3/20/09, Hans-Christoph Steiner
hans@eds.org wrote:
From: Hans-Christoph Steiner hans@eds.org Subject: Re: [PD] style guide idea: [send foo]
versus [; foo(
To: "dmotd" dmotd@gmx.net Cc: pd-list@iem.at Date: Friday, March 20, 2009, 5:25 PM I am not proposing to limit the use of dollar args
in
message boxes for dynamic sends, that is a very
useful
feature. The example you give here, though, is an
example of
a shortcut for typing, there is no other benefit
that I can
see.
And at the risk of sounding pedantic, I am going
to quote
one of my favorite ideas relating to code:
"Programs
should be written for people to read, and only
incidentally
for machines to execute". Typing shortcuts
like this
message box below almost never save time when you
look at
the whole picture. Code is read far more times
than it is
written, so really we should be optimizing for
reading
rather than writing.
Could you give an example that is more readable than
the message box below?
The key part is that [trigger] is the essential way in Pd to represent execution order. As Frank says: "use [trigger]s everywhere". Then by breaking out the messages into their own message boxes, you can clearly see what the messages that are being send separately from their destination.
Having lines of text execute in top-to-bottom may be more readable for
code like Java, C, etc., but Pd uses right-to-left to represent
execution order, hence trigger..hc
Pd also uses top-to-bottom to represent execution order. Maybe I've just gotten really used to msg-boxes spanning multiple lines-- they seem perfectly readable. But I can see how a single liner like [; pd-some-window clear( might confuse a student where using a msg-box -> [send] would not.
-Jonathan
-Jonathan
In Pd, [trigger] is the central mechanism for
specifying
execution order. Therefore, in the interest of
readability,
[trigger] should be used as much as possible.
Clearer documentation of the messages boxes would
also be a
great thing. But you almost anything without ever
using a
semi-colon in a message box, they are mostly used
as a
typing shortcut, and many people are confused by
them, so I
think we should really be limiting them to things
like
dynamic sends, since that is hard to do in other
ways.
.hc
On Mar 20, 2009, at 1:32 AM, dmotd wrote:
hmm.. generally this could be a good idea, but
message
sending is most useful
when initialising a number of receives ie:
[loadbang] | |; init-1 6 / |; init-2 symbol foo | |; init-3 -2 \
which is far more elegant than the the
trigger/send
replacement, especially
with more fields..
i think its important for students to
recognise that
this feature of messaging
has a role to play, rather than trying to veil
its
use. in my experience
people will tend to use [send foo] more often
when
they start pd, then begin
abbreviating to [s foo] before they appreciate
the msg
shorthand [; foo[. but
you are right it is a little confusing for new
users..
perhaps this just needs clearer documenting?
'what
does a semi-colon at the
start of a message mean?' in the FAQ?
dmotd
On Friday 20 March 2009 10:38:06
Hans-Christoph
Steiner wrote:
Here's something that I'd like to
propose
for the style guide, based
on my teaching experience:
- use [send foo] instead of [; foo( for
all sends
that aren't
dynamically set
A lot of people find the [; foo( syntax
confusing,
and since it is
commonly used, it often gets in the way of
newbies
understanding the
patch. While the [; foo( syntax is
definitely
useful for dynamic
sends, I don't think there is an
advantage to
using for the regular
sends. So for example:
[dsp 1(
[send pd]
instead of
|; / |pd dsp 1 \
This change highlights the dataflow aspect
of the
messages over the
text-style programming with syntax of the
message
box. At the very
least, I think that the help patches
should use
this style, and I have
started to use this style in my regular
programming and it feels quite
natural once you are used to it. I find
it easier
to read.
(as for [s foo] versus [send foo]
that's an
issue I want to avoid in
this discussion).
.hc
The arc of history bends towards justice.
Dr. Martin Luther
King, Jr.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
Programs should be written for people to read, and
only
incidentally for machines to execute.
- from Structure and Interpretation of Computer
Programs
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Computer science is no more related to the computer than astronomy is
related to the telescope. -Edsger Dykstra
On Fri, 20 Mar 2009, Hans-Christoph Steiner wrote:
I am not proposing to limit the use of dollar args in message boxes for dynamic sends, that is a very useful feature. The example you give here, though, is an example of a shortcut for typing, there is no other benefit that I can see.
Shortcuts for typing are also usually shortcuts for reading for people who are willing to accept them.
And at the risk of sounding pedantic, I am going to quote one of my favorite ideas relating to code: "Programs should be written for people to read, and only incidentally for machines to execute".
I'd generally agree with your position, but I think that the «only incidentally» part is quite dismissive of the reason why programmes are written in the first place. Programming languages didn't develop significantly until there were machines to run them. At the very least it waited until that there were expectations of future machines that would be able to handle them, or expectations of future projects that would benefit from newer languages. The code doesn't really exist in a bubble.
But most of all, readability doesn't necessarily mean longer code, and I'd even dare say it more often means shorter code.
In Pd, [trigger] is the central mechanism for specifying execution order. Therefore, in the interest of readability, [trigger] should be used as much as possible.
Excuse me: by opposition to what???
Clearer documentation of the messages boxes would also be a great thing. But you almost anything without ever using a semi-colon in a message box, they are mostly used as a typing shortcut,
In the internals of Pd, the semicolon in messages is definitely the original feature, and [s foo] was afterwards added as a "longcut". What makes [s] the appropriate default way of doing something, such that the semicolon becomes a "mere shortcut"?
and many people are confused by them, so I think we should really be limiting them to things like dynamic sends, since that is hard to do in other ways.
People are confused by Pd... should we be limiting everybody to some other software... because there are people who might not understand Pd. If that's not the same thing as removing features that "might be confusing", I don't see how.
« the GNOME policy is "If you find a feature, it might confuse a user, so remove it." » -- Uncyclopedia
The next version of GNOME: http://uncyclopedia.wikia.com/wiki/Image:Next-gnome.png
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec