Discussion:
Programming Corner - Programming vs Code - Thinking Exercise
(too old to reply)
Steve Carroll
2025-02-03 21:13:03 UTC
Permalink
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...

'Rodney Allen Rippy'

... extract from it the first letter of each of the three subnames, put
a period in between each and end up with a set of initials for the name:

R.A.R

This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?

Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
fridge, you'd need to take the following steps (at the least):

1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass

Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.

The question is:

For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?

Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Kelly Phillips
2025-02-03 23:59:24 UTC
Permalink
On Mon, 3 Feb 2025 21:13:03 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
I would treat 'Rodney Allen Rippy' as a string, minus the single quotes.
I'd loop through the string and build a new string, taking the first
letter, adding the period, then taking the letter that immediately
follows a space, add a period, and so on until I reach the end of the
string.

Such a simplistic approach falls flat when prefixes and suffixes are
introduced, such as Mr./Mrs./Ms. and or Jr./Sr./Esq. I presume that
those all need to be ignored, which is something that people might take
for granted but computers need to be told what to do.
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
I think I just heard my mother asking, "Were you planning on putting the
milk back in the fridge and closing the door?"
Post by Steve Carroll
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
For me, string handling would be an important aspect, so I'd check to
see what's available there. How much of a typical language does this
exercise need? Not much, I'd say. It feels like it's close to entry
level.
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Brock McNuggets
2025-02-04 00:42:41 UTC
Permalink
Post by Kelly Phillips
On Mon, 3 Feb 2025 21:13:03 -0000 (UTC), Steve Carroll
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
I would treat 'Rodney Allen Rippy' as a string, minus the single quotes.
I'd loop through the string and build a new string, taking the first
letter, adding the period, then taking the letter that immediately
follows a space, add a period, and so on until I reach the end of the
string.
This would add a period at the end... which he does not have.

My method... tested in ApplesScript:

1) Set a variable (theName) to the name.
2) Set the initial string to blank
3) Loop with i for each word of theName
a) add the first letter of word i to the initial string
b) if i <> count of words in theName then add a period
4) display or save or return the initials.
Post by Kelly Phillips
Such a simplistic approach falls flat when prefixes and suffixes are
introduced, such as Mr./Mrs./Ms. and or Jr./Sr./Esq. I presume that
those all need to be ignored, which is something that people might take
for granted but computers need to be told what to do.
There could be a check to see if the word is one of those words.
Post by Kelly Phillips
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
I think I just heard my mother asking, "Were you planning on putting the
milk back in the fridge and closing the door?"
Post by Steve Carroll
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
For me, string handling would be an important aspect, so I'd check to
see what's available there. How much of a typical language does this
exercise need? Not much, I'd say. It feels like it's close to entry
level.
Very much so. Here is my full and very simple AppleScript solution.

repeat with i from 1 to count of words in theName
end repeat
Post by Kelly Phillips
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
--
Specialist in unnecessary details and overcomplicated solutions.
Kelly Phillips
2025-02-04 01:08:28 UTC
Permalink
Post by Brock McNuggets
Post by Kelly Phillips
On Mon, 3 Feb 2025 21:13:03 -0000 (UTC), Steve Carroll
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
I would treat 'Rodney Allen Rippy' as a string, minus the single quotes.
I'd loop through the string and build a new string, taking the first
letter, adding the period, then taking the letter that immediately
follows a space, add a period, and so on until I reach the end of the
string.
This would add a period at the end... which he does not have.
It would not because there is no letter following a space at the end.

<snip>

An alternative would be to split the string on the spaces, creating an
array, then loop through the array to grab the first letter and add the
required periods, building a new string.

Both methods described above are nondestructive to the original string,
which I think is generally important.
Brock McNuggets
2025-02-04 01:26:40 UTC
Permalink
Post by Kelly Phillips
Post by Brock McNuggets
Post by Kelly Phillips
On Mon, 3 Feb 2025 21:13:03 -0000 (UTC), Steve Carroll
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
I would treat 'Rodney Allen Rippy' as a string, minus the single quotes.
I'd loop through the string and build a new string, taking the first
letter, adding the period, then taking the letter that immediately
follows a space, add a period, and so on until I reach the end of the
string.
This would add a period at the end... which he does not have.
It would not because there is no letter following a space at the end.
Fair enough. My mistake.
Post by Kelly Phillips
<snip>
An alternative would be to split the string on the spaces, creating an
array, then loop through the array to grab the first letter and add the
required periods, building a new string.
Both methods described above are nondestructive to the original string,
which I think is generally important.
Oh, definitely. Mine does not alter the name string.
--
Specialist in unnecessary details and overcomplicated solutions.
ANTONIO LEON ROMO
2025-02-04 01:58:40 UTC
Permalink
Post by Brock McNuggets
Post by Kelly Phillips
Post by Brock McNuggets
Post by Kelly Phillips
On Mon, 3 Feb 2025 21:13:03 -0000 (UTC), Steve Carroll
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
I would treat 'Rodney Allen Rippy' as a string, minus the single quotes.
I'd loop through the string and build a new string, taking the first
letter, adding the period, then taking the letter that immediately
follows a space, add a period, and so on until I reach the end of the
string.
This would add a period at the end... which he does not have.
It would not because there is no letter following a space at the end.
Fair enough. My mistake.
That's what your father said when he didn't pull out,
Michael.
Your parents hated you didn't they Michael Glasser.
Steve Carroll
2025-02-04 15:44:43 UTC
Permalink
Post by Kelly Phillips
On Mon, 3 Feb 2025 21:13:03 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
I would treat 'Rodney Allen Rippy' as a string, minus the single quotes.
I'd loop through the string and build a new string, taking the first
letter, adding the period, then taking the letter that immediately
follows a space, add a period, and so on until I reach the end of the
string.
If I'm following you correctly (and I adhere to what 'editor' FTR caught
me on ;) - in JS it'd be something like:

function createInitials(name) {
let initials = ''

for (let i = 0; i < name.length; i++) {
if (i === 0 || name[i - 1] === ' ') {
initials += name[i] + '.'
}
}

return initials
}

That's probably one of the fastest ways in JS, albeit harder to 'see'
(Apd will now give me 'the side-eye' ;)
Post by Kelly Phillips
Such a simplistic approach falls flat when prefixes and suffixes are
introduced, such as Mr./Mrs./Ms. and or Jr./Sr./Esq. I presume that
those all need to be ignored, which is something that people might take
for granted but computers need to be told what to do.
Those last 9 words are really 'the thing' here. You just answered the
why (people might take things for granted) but the how... 'How does it
differ from a 'human' list?'... is the real question. The human list may
not contain enough granularity to make the connections between
programming and coding 'easy enough' to see, especially for those new to
programming languages, it's 'a big disconnect' for many.

The disconnect comes in varying levels. Your approach probably uses
things similar to what I used in that function above, but people who are
newer to writing these 'modern' scripting languages are more likely to
use things with additional layers of abstraction:

let createInitials = name => name.split(' ').map(i => i[0]).join('.') + '.'

That's slower than the above. There's a method called 'match':

function createInitials(name, tp = true) {
let res = (name.match(/\b\w/g) || []).join('.')
return tp ? res + '.' : res
}

That one's for the 'editor' as it cover 'tp' or 'no tp' (and that
doesn't stand for 'toilet paper' ;)

There are other ways this can be done is JS, as well (i.e. 'reduce',
'exec', 'matchAll', etc.).

Unless you're doing a million names, speed probably won't be an issue so
these 'modern tradeoffs' have become popular. Even 'matchAll', probably
the slowest (I think I once clocked it at ~10 times slower than the for
loop version) isn't slow unless you're pounding it. There's also 'the
'readability factor', with the exception of 'map', the fat arrow version
is quite 'English-like'. IMO that one is arguably the most likely to
jibe with someone's 'human' list' if they thought of 'splitting' the
words up in order to easily 'isolate' the first char of each.
Post by Kelly Phillips
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
I think I just heard my mother asking, "Were you planning on putting the
milk back in the fridge and closing the door?"
;)
Post by Kelly Phillips
Post by Steve Carroll
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
For me, string handling would be an important aspect, so I'd check to
see what's available there. How much of a typical language does this
exercise need? Not much, I'd say. It feels like it's close to entry
level.
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
That gets back to what I mentioned above: How granular is your 'human'
list? Too coarse and you'll start the hair pulling ;)
Apd
2025-02-04 19:17:24 UTC
Permalink
Post by Steve Carroll
If I'm following you correctly (and I adhere to what 'editor' FTR caught
function createInitials(name) {
let initials = ''
for (let i = 0; i < name.length; i++) {
if (i === 0 || name[i - 1] === ' ') {
initials += name[i] + '.'
}
}
return initials
}
That's probably one of the fastest ways in JS, albeit harder to 'see'
(Apd will now give me 'the side-eye' ;)
Will I? You could replace the C-style "for" loop to be more readable
with:

for (let i in name)

but you'd have to change the comparison of the first element because
"i" is a string representation of the index. It needs to be:

i === "0"

or:

Number(i) === 0

or, using loose equality:

i == 0

"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Post by Steve Carroll
[...] people who are newer to writing these 'modern' scripting
languages are more likely to use things with additional layers of
let createInitials = name => name.split(' ').map(i => i[0]).join('.') + '.'
That's slower than the above.
As is likely for the way I suggested.
Post by Steve Carroll
function createInitials(name, tp = true) {
let res = (name.match(/\b\w/g) || []).join('.')
return tp ? res + '.' : res
}
That one's for the 'editor' as it cover 'tp' or 'no tp' (and that
doesn't stand for 'toilet paper' ;)
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
Post by Steve Carroll
There's also 'the 'readability factor', with the exception of 'map',
the fat arrow version is quite 'English-like'.
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Steve Carroll
2025-02-04 20:22:18 UTC
Permalink
Post by Apd
Post by Steve Carroll
If I'm following you correctly (and I adhere to what 'editor' FTR caught
function createInitials(name) {
let initials = ''
for (let i = 0; i < name.length; i++) {
if (i === 0 || name[i - 1] === ' ') {
initials += name[i] + '.'
}
}
return initials
}
That's probably one of the fastest ways in JS, albeit harder to 'see'
(Apd will now give me 'the side-eye' ;)
Will I? You could replace the C-style "for" loop to be more readable
for (let i in name)
but you'd have to change the comparison of the first element because
i === "0"
Number(i) === 0
i == 0
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
Post by Apd
Post by Steve Carroll
[...] people who are newer to writing these 'modern' scripting
languages are more likely to use things with additional layers of
let createInitials = name => name.split(' ').map(i => i[0]).join('.') + '.'
That's slower than the above.
As is likely for the way I suggested.
Post by Steve Carroll
function createInitials(name, tp = true) {
let res = (name.match(/\b\w/g) || []).join('.')
return tp ? res + '.' : res
}
That one's for the 'editor' as it cover 'tp' or 'no tp' (and that
doesn't stand for 'toilet paper' ;)
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
Post by Apd
Post by Steve Carroll
There's also 'the 'readability factor', with the exception of 'map',
the fat arrow version is quite 'English-like'.
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.

It forms a 'pipeline' (JS is getting this and other stuff, tuples,
records, I think) of I/O. It's a nice 'ltr' visual representation:

name.split(' ').map(i => i[0]).join('.')

It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.

It's concise as it can get while still conveying what's going on.




using dots.
Steve Carroll
2025-02-04 21:05:54 UTC
Permalink
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
Breaking it down into steps in the lower left:

<Loading Image...>

Key for anyone who may need it:

n = name
sn = split names
gfc = get firs chars
jc = joing chars
Apd
2025-02-04 21:51:19 UTC
Permalink
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
Post by Steve Carroll
Post by Apd
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
I thought so.
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
using dots.
I improved my sentence finding routine. As a one-liner, it's:

sentences = joinParts(joinPairs(txt.split(/([.!?])\s+/))).filter((elem)=>elem.length>0);

As a function, it's easier to show the stages:

function makeSentences(txt) {
const regex = /([.!?])\s+/ // Will split on ". ", "! ", or "? "
const pairs = txt.split(regex) // Split, saving the split and the splitter
const parts = joinPairs(pairs) // Reconnect the pairs
const sents = joinParts(parts) // Reconnect parts that shouldn't split
return sents.filter( (elem) => elem.length > 0 ) // Remove any empty
}

sentences = makeSentences(`Is Dr. L. McCoy a Jr. or a Sr. medic? He's a Sr.`)

That becomes two sentences. I can post the code in the text generator
thread if interested.
Steve Carroll
2025-02-05 16:52:47 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<Loading Image...>

I win!
Post by Apd
Post by Steve Carroll
Post by Apd
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
I thought so.
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
using dots.
sentences = joinParts(joinPairs(txt.split(/([.!?])\s+/))).filter((elem)=>elem.length>0);
function makeSentences(txt) {
const regex = /([.!?])\s+/ // Will split on ". ", "! ", or "? "
const pairs = txt.split(regex) // Split, saving the split and the splitter
const parts = joinPairs(pairs) // Reconnect the pairs
const sents = joinParts(parts) // Reconnect parts that shouldn't split
return sents.filter( (elem) => elem.length > 0 ) // Remove any empty
}
sentences = makeSentences(`Is Dr. L. McCoy a Jr. or a Sr. medic? He's a Sr.`)
That becomes two sentences. I can post the code in the text generator
thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
%
2025-02-05 18:20:00 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
Post by Apd
Post by Steve Carroll
Post by Apd
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
I thought so.
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
using dots.
sentences = joinParts(joinPairs(txt.split(/([.!?])\s+/))).filter((elem)=>elem.length>0);
function makeSentences(txt) {
const regex = /([.!?])\s+/ // Will split on ". ", "! ", or "? "
const pairs = txt.split(regex) // Split, saving the split and the splitter
const parts = joinPairs(pairs) // Reconnect the pairs
const sents = joinParts(parts) // Reconnect parts that shouldn't split
return sents.filter( (elem) => elem.length > 0 ) // Remove any empty
}
sentences = makeSentences(`Is Dr. L. McCoy a Jr. or a Sr. medic? He's a Sr.`)
That becomes two sentences. I can post the code in the text generator
thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
then you can run all over saying look what i did
Brock McNuggets
2025-02-05 18:23:34 UTC
Permalink
Post by %
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
Post by Apd
Post by Steve Carroll
Post by Apd
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
I thought so.
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
using dots.
sentences =
joinParts(joinPairs(txt.split(/([.!?])\s+/))).filter((elem)=>elem.length>0)
;
function makeSentences(txt) {
const regex = /([.!?])\s+/ // Will split on ". ", "! ", or "? "
const pairs = txt.split(regex) // Split, saving the split and the splitter
const parts = joinPairs(pairs) // Reconnect the pairs
const sents = joinParts(parts) // Reconnect parts that shouldn't split
return sents.filter( (elem) => elem.length > 0 ) // Remove any empty
}
sentences = makeSentences(`Is Dr. L. McCoy a Jr. or a Sr. medic? He's a Sr.`)
That becomes two sentences. I can post the code in the text generator
thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
then you can run all over saying look what i did
Carroll is trying to get his circus going again. The joy.
--
Specialist in unnecessary details and overcomplicated solutions.
%
2025-02-05 18:42:57 UTC
Permalink
Post by Brock McNuggets
Post by %
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
Post by Apd
Post by Steve Carroll
Post by Apd
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
I thought so.
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
using dots.
sentences =
joinParts(joinPairs(txt.split(/([.!?])\s+/))).filter((elem)=>elem.length>0)
;
function makeSentences(txt) {
const regex = /([.!?])\s+/ // Will split on ". ", "! ", or "? "
const pairs = txt.split(regex) // Split, saving the split and the splitter
const parts = joinPairs(pairs) // Reconnect the pairs
const sents = joinParts(parts) // Reconnect parts that shouldn't split
return sents.filter( (elem) => elem.length > 0 ) // Remove any empty
}
sentences = makeSentences(`Is Dr. L. McCoy a Jr. or a Sr. medic? He's a Sr.`)
That becomes two sentences. I can post the code in the text generator
thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
then you can run all over saying look what i did
Carroll is trying to get his circus going again. The joy.
he's been trying for 3 days , well today is day three ,
but it looks like david knows how to handle stevie weavie
Brock McNuggets
2025-02-05 18:48:12 UTC
Permalink
Post by %
Post by Brock McNuggets
Post by %
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
Post by Apd
Post by Steve Carroll
Post by Apd
"TP for my bunghole" -- Beavis (of Beavis & Butthead fame)
LOL! tp = trailing period.
I thought so.
Post by Steve Carroll
Post by Apd
Those last two examples aren't so readable, especially for those
familiar will older programming languages.
Once you get used to looking at a fat arrow it's pretty good.
It forms a 'pipeline' (JS is getting this and other stuff, tuples,
name.split(' ').map(i => i[0]).join('.')
It gets 'split' (returns an array), which is then looped over via 'map',
where the first char 'i[0]' of each element is 'return'ed (=>) into
another array... and finally 'join'ed back into a string using dots.
It's concise as it can get while still conveying what's going on.
using dots.
sentences =
joinParts(joinPairs(txt.split(/([.!?])\s+/))).filter((elem)=>elem.length>0)
;
function makeSentences(txt) {
const regex = /([.!?])\s+/ // Will split on ". ", "! ", or "? "
const pairs = txt.split(regex) // Split, saving the split and the splitter
const parts = joinPairs(pairs) // Reconnect the pairs
const sents = joinParts(parts) // Reconnect parts that shouldn't split
return sents.filter( (elem) => elem.length > 0 ) // Remove any empty
}
sentences = makeSentences(`Is Dr. L. McCoy a Jr. or a Sr. medic? He's a Sr.`)
That becomes two sentences. I can post the code in the text generator
thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
then you can run all over saying look what i did
Carroll is trying to get his circus going again. The joy.
he's been trying for 3 days , well today is day three ,
but it looks like david knows how to handle stevie weavie
I have happily seen very little of it... though I saw the transparent sock.
--
Specialist in unnecessary details and overcomplicated solutions.
Steve Carroll
2025-02-06 15:40:45 UTC
Permalink
Post by Brock McNuggets
Post by %
Post by Steve Carroll
Post by Apd
I can post the code in the text generator thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
then you can run all over saying look what i did
Carroll is trying to get his circus going again. The joy.
Stop lying and projecting, fool.
Apd
2025-02-05 19:38:56 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
There's no calculation being done. I'm not sure what is going on
there. Is it that if a key is numeric you can refer to it by a string
representation?
Post by Steve Carroll
Post by Apd
I can post the code in the text generator thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
I'll say (again).
Steve Carroll
2025-02-05 20:08:00 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
There's no calculation being done. I'm not sure what is going on
there.
I think you are... it's coercion without calculation ;)

(and it's not limited to numbers)
Post by Apd
Is it that if a key is numeric you can refer to it by a string
representation?
Yes, and people have gotten 'bit' by it.
Post by Apd
Post by Steve Carroll
Post by Apd
I can post the code in the text generator thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
I'll say (again).
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
%
2025-02-05 20:17:01 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
There's no calculation being done. I'm not sure what is going on
there.
I think you are... it's coercion without calculation ;)
(and it's not limited to numbers)
Post by Apd
Is it that if a key is numeric you can refer to it by a string
representation?
Yes, and people have gotten 'bit' by it.
Post by Apd
Post by Steve Carroll
Post by Apd
I can post the code in the text generator thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
I'll say (again).
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
here comes the part where stevie weavie flips things ,
and tries to make it look like he did it
Brock McNuggets
2025-02-05 23:42:56 UTC
Permalink
Post by %
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
"i - 1" is ok because of coercion but "i + 1" would fail because of
concatenation!
Oh that wacky language creator ;)
I'll say! VB will coerce to numbers for + or - if one is a number. For
string concatenation, they reccomend "&" to be sure. Logical operators
are the words "And" and "Or", and also work for bitwise operations on
numbers.
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
There's no calculation being done. I'm not sure what is going on
there.
I think you are... it's coercion without calculation ;)
(and it's not limited to numbers)
Post by Apd
Is it that if a key is numeric you can refer to it by a string
representation?
Yes, and people have gotten 'bit' by it.
Post by Apd
Post by Steve Carroll
Post by Apd
I can post the code in the text generator thread if interested.
Please do (it's better than the queens attempting to kick-start their
BS back up again).
I'll say (again).
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
here comes the part where stevie weavie flips things ,
and tries to make it look like he did it
He will ALWAYS play victim.
--
Specialist in unnecessary details and overcomplicated solutions.
David
2025-02-05 20:25:17 UTC
Permalink
Post by Steve Carroll
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
This is EXACTLY the sort of thing I was explaining to Apd!

<SIGH>
%
2025-02-05 22:03:38 UTC
Permalink
Post by David
Post by Steve Carroll
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
This is EXACTLY the sort of thing I was explaining to Apd!
<SIGH>
did he understand it
Brock McNuggets
2025-02-05 23:42:14 UTC
Permalink
Post by David
Post by Steve Carroll
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
This is EXACTLY the sort of thing I was explaining to Apd!
<SIGH>
Carroll is VERY controlling.
--
Specialist in unnecessary details and overcomplicated solutions.
Steve Carroll
2025-02-06 15:43:11 UTC
Permalink
Post by David
Post by Steve Carroll
That's what DB was 'doing' with his irrelevant, red herring BS (he had
no reason to veer away from the task he pretended he'd work with you
on).
This is EXACTLY the sort of thing I was explaining to Apd!
No, my calling you out on your OBVIOUS red herring is not what you were
"explaining to Apd". Your 'explanation' was bullsh*t, of the same kind
you used to avoid doing what you suggested (read: LIED) you'd do with
Apd on this file.

Apd
2025-02-05 22:04:56 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
<https://i.postimg.cc/WT18sstH/hmmm.gif>
I win!
There's no calculation being done. I'm not sure what is going on
there.
I think you are... it's coercion without calculation ;)
Right.
Post by Steve Carroll
(and it's not limited to numbers)
Post by Apd
Is it that if a key is numeric you can refer to it by a string
representation?
Yes, and people have gotten 'bit' by it.
I was under the impression that all keys in an object were expected to
be textual. There's a lot I don't know or haven't thought about.
FromTheRafters
2025-02-04 01:03:14 UTC
Permalink
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
Or R.A.R. even.
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
1) Discern uppercase from lowercase using eyes.
2) Collect the uppercase characters together in mind.
3) Follow each character with the period character in mind.

That name would work, but some names would not. R.M.D. would come from
Ronald McDonald. Too simplistic an algorithm really.
Post by Steve Carroll
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
You would have to know how ASCII is coded. Almost any language can
manipulate strings. Need branch instructions (or an input sanitizing
routine) for names which don't adhere to the norm and some fixes for
them before returning to main program flow.

It gets complicated.
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Well, you don't 'need' Prolog, but AI is probably good for this sort of
thing. To me, coming up with an algorithm is the first part of
programming.
Brock McNuggets
2025-02-04 01:25:56 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
Or R.A.R. even.
I made mine without the final period. Easy to fix if he meant having it.
Post by FromTheRafters
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
1) Discern uppercase from lowercase using eyes.
2) Collect the uppercase characters together in mind.
3) Follow each character with the period character in mind.
That name would work, but some names would not. R.M.D. would come from
Ronald McDonald. Too simplistic an algorithm really.
Interesting. I did it per word.

AppleScript is pretty easy to read:

if i ≠ (count of words in theName) then set theInits to theInits & "."
display dialog theInits
Post by FromTheRafters
Post by Steve Carroll
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
You would have to know how ASCII is coded.
Would you check if "A" = "65"? :)
Post by FromTheRafters
Almost any language can
manipulate strings. Need branch instructions (or an input sanitizing
routine) for names which don't adhere to the norm and some fixes for
them before returning to main program flow.
It gets complicated.
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Well, you don't 'need' Prolog, but AI is probably good for this sort of
thing. To me, coming up with an algorithm is the first part of
programming.
--
Specialist in unnecessary details and overcomplicated solutions.
Steve Carroll
2025-02-04 15:58:37 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
Or R.A.R. even.
In my response to KP, I wrote you a function that addresses this.

But you are right! So, as the 'editor' (I wasn't joking about that), you
get a raise, too ;)
Post by FromTheRafters
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
1) Discern uppercase from lowercase using eyes.
All words at once? Or would you first 'isolate' (like the milk) the
first word and then isolate it's first letter?
Post by FromTheRafters
2) Collect the uppercase characters together in mind.
3) Follow each character with the period character in mind.
That name would work, but some names would not. R.M.D. would come from
Ronald McDonald. Too simplistic an algorithm really.
A fair point (and we get back to all those nagging edge cases again).
Post by FromTheRafters
Post by Steve Carroll
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
You would have to know how ASCII is coded.
"Hmmm..."
Post by FromTheRafters
Almost any language can manipulate strings. Need branch instructions
(or an input sanitizing routine) for names which don't adhere to the
norm and some fixes for them before returning to main program flow.
It gets complicated.
It can, depending on how much you're prepared to 'deal with'. That's why
I stuck to simple space chars and words with no crap (just alpha-chars)
Post by FromTheRafters
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Well, you don't 'need' Prolog, but AI is probably good for this sort of
thing. To me, coming up with an algorithm is the first part of
programming.
In part, this is why I wrote these two posts, and one part was to
address what DB just did (but apparently has zero interest in now), over
his involvement with the 'Word finder' code. While he can't read/write
code, he can prompt ChatGPT to some extent. I can't imagine that it made
the suggestions to him that it did (I could be wrong WRT it's ability to
'suggest' things) but he's being his elusive self on the topic.
FromTheRafters
2025-02-04 16:41:35 UTC
Permalink
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
Or R.A.R. even.
In my response to KP, I wrote you a function that addresses this.
But you are right! So, as the 'editor' (I wasn't joking about that), you
get a raise, too ;)
Post by FromTheRafters
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
1) Discern uppercase from lowercase using eyes.
All words at once? Or would you first 'isolate' (like the milk) the
first word and then isolate it's first letter?
With eyes I seem to see each capitalized letter at once, I know a
simple computer algorithm won't accomplish this. It could probably do
this choosing quickly even though a better way might be possible in JS.

01010010 <---
01101111
01100100
01101110
01100101
01111001
00100000
01000001 <---
01101100
01101100
01100101
01101110
00100000
01010010 <---
01101001
01110000
01110000
01111001
^
|
|
Post by Steve Carroll
Post by FromTheRafters
2) Collect the uppercase characters together in mind.
3) Follow each character with the period character in mind.
That name would work, but some names would not. R.M.D. would come from
Ronald McDonald. Too simplistic an algorithm really.
A fair point (and we get back to all those nagging edge cases again).
Input validation could remove the offending characters.
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
You would have to know how ASCII is coded.
"Hmmm..."
This could be done in machine code, no fancy OOL needed. :)
Post by Steve Carroll
Post by FromTheRafters
Almost any language can manipulate strings. Need branch instructions
(or an input sanitizing routine) for names which don't adhere to the
norm and some fixes for them before returning to main program flow.
It gets complicated.
It can, depending on how much you're prepared to 'deal with'. That's why
I stuck to simple space chars and words with no crap (just alpha-chars)
Post by FromTheRafters
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Well, you don't 'need' Prolog, but AI is probably good for this sort of
thing. To me, coming up with an algorithm is the first part of
programming.
In part, this is why I wrote these two posts, and one part was to
address what DB just did (but apparently has zero interest in now), over
his involvement with the 'Word finder' code. While he can't read/write
code, he can prompt ChatGPT to some extent. I can't imagine that it made
the suggestions to him that it did (I could be wrong WRT it's ability to
'suggest' things) but he's being his elusive self on the topic.
One of the things addressing the issue is something I learned long ago
about computer programming. Teaching someone how to read, as a computer
would learn it, started out with having the student make a pinching
movement with index finger and thumb grasping the top right hand corner
of the book's cover and turning to the first page, etcetera. They have
to be explicitly told everything.
Brock McNuggets
2025-02-04 16:57:50 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
programming.
In part, this is why I wrote these two posts, and one part was to
address what DB just did (but apparently has zero interest in now), over
his involvement with the 'Word finder' code. While he can't read/write
code, he can prompt ChatGPT to some extent. I can't imagine that it made
the suggestions to him that it did (I could be wrong WRT it's ability to
'suggest' things) but he's being his elusive self on the topic.
One of the things addressing the issue is something I learned long ago
about computer programming. Teaching someone how to read, as a computer
would learn it, started out with having the student make a pinching
movement with index finger and thumb grasping the top right hand corner
of the book's cover and turning to the first page, etcetera. They have
to be explicitly told everything.
I used Logo where students had to tell a turtle what to do.
--
Specialist in unnecessary details and overcomplicated solutions.
Steve Carroll
2025-02-04 17:23:42 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
This is a simple exercise that asks you to attempt a task without *any*
help. The task is to identify all the steps required to take a name...
'Rodney Allen Rippy'
... extract from it the first letter of each of the three subnames, put
R.A.R
Or R.A.R. even.
In my response to KP, I wrote you a function that addresses this.
But you are right! So, as the 'editor' (I wasn't joking about that), you
get a raise, too ;)
Post by FromTheRafters
Post by Steve Carroll
This portion is not about code, IOW... it's not thinking about how a
computer needs to be instructed to do it. This is about every step you
can think of required to do it that you can explain to another person
(or to yourself). You can easily perform this task in a few seconds
without the help of a computer or code. So how do you it? Are you
'thinking' about the steps? Or are they *so* obvious you don't need to?
1) Discern uppercase from lowercase using eyes.
All words at once? Or would you first 'isolate' (like the milk) the
first word and then isolate it's first letter?
With eyes I seem to see each capitalized letter at once,
By 'human' way I meant if you were telling someone else how to do it via
pencil and paper so they could copy the steps, but not someone with
'editor-vision' ;)

This is my own bias of knowing how to easily do it in certain languages
creeping in. IOW, I might tend to 'think' about 'splitting' up the words
because I'm lazy ;) It's quick 'n dirty to get the first char of each
once they're split.
Post by FromTheRafters
I know a simple computer algorithm won't accomplish this. It could
probably do this choosing quickly even though a better way might be
possible in JS.
I think the fastest is probably the for loop version I posted.
Post by FromTheRafters
01010010 <---
01101111
01100100
01101110
01100101
01111001
00100000
01000001 <---
01101100
01101100
01100101
01101110
00100000
01010010 <---
01101001
01110000
01110000
01111001
^
|
|
Post by Steve Carroll
Post by FromTheRafters
2) Collect the uppercase characters together in mind.
3) Follow each character with the period character in mind.
That name would work, but some names would not. R.M.D. would come from
Ronald McDonald. Too simplistic an algorithm really.
A fair point (and we get back to all those nagging edge cases again).
Input validation could remove the offending characters.
I know, but I wanted this to be simple enough anyone could deal with it.
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
Now, I'm asking you to think about them and write them down, in order of
necessity. What is that first step (some may overlook it or subsequent
steps)? For the purposes of this discussion, a "step" is something you
do that can't easily be reduced any further, for which, within reason,
there are no sub-steps. For example, if you're sitting in your kitchen
with an empty glass in front of you, to fill it with milk stored in your
1. Stand up
2. Walk to the fridge
3. Open the fridge door
4. Locate (visually 'isolate') the milk
5. Grab the milk container with your hand
6. Remove the container from the fridge
7. Walk back to where the glass is
8. Open the container
9. Pour milk into the glass
Shifting gears... as we go back to our 'initials' example, after you've
made notes on 'how you would do it as a human' (like we just did with
the milk), bring in the concept of trying to explain such steps to a
computer using a language it can understand and interpret. Obviously,
*you* would need to have *some* level of understanding of that language
while trying to use it to convey the idea to the computer.
For this particular task, how much of the language do you actually need
to know to perform the above task, what's the minimum requirement?
You would have to know how ASCII is coded.
"Hmmm..."
This could be done in machine code, no fancy OOL needed. :)
My point is, it's no longer a requirement for many methods one has
available to them in these highly abstracted languages. This aspect is
part and parcel of what I'm driving at when I say "the minimum
requirement".
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Almost any language can manipulate strings. Need branch instructions
(or an input sanitizing routine) for names which don't adhere to the
norm and some fixes for them before returning to main program flow.
It gets complicated.
It can, depending on how much you're prepared to 'deal with'. That's why
I stuck to simple space chars and words with no crap (just alpha-chars)
Post by FromTheRafters
Post by Steve Carroll
Without knowing the language, how would you know? How could you find
out? In the language you'd choose, does it have methods that seem to
coincide with any of your steps (how 'English-like' is the language)?
Well, you don't 'need' Prolog, but AI is probably good for this sort of
thing. To me, coming up with an algorithm is the first part of
programming.
In part, this is why I wrote these two posts, and one part was to
address what DB just did (but apparently has zero interest in now), over
his involvement with the 'Word finder' code. While he can't read/write
code, he can prompt ChatGPT to some extent. I can't imagine that it made
the suggestions to him that it did (I could be wrong WRT it's ability to
'suggest' things) but he's being his elusive self on the topic.
One of the things addressing the issue is something I learned long ago
about computer programming. Teaching someone how to read, as a computer
would learn it, started out with having the student make a pinching
movement with index finger and thumb grasping the top right hand corner
of the book's cover and turning to the first page, etcetera. They have
to be explicitly told everything.
Consider what DB came back with from his 'AI' buddy. I recently saw a
screencast where a guy stated that AI is just another abstraction layer.
I don't know what DB's interaction with AI was here but what he posted
worked and he didn't even test it first. That means it produced working
code right off the bat... even *as* it added a nice feature! IOW, if DB
could learn to prompt AI better, 'he' (AI) can write code. The guy may
have a point...
Loading...