Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Dave Collier-Brown via talk

On 2019-11-08 3:13 p.m., Lennart Sorensen wrote:
> On Fri, Nov 08, 2019 at 07:27:47PM +, Dave Collier-Brown via talk wrote:
>> On 2019-11-08 11:41 a.m., Giles Orr via talk wrote:
>>
>>> Eyeballing simple regex is hard enough, but mentally parsing out a
>>> complex full line regex that looks like inline garbage without the
>>> benefit of comments isn't something I recommend or appreciate.
>> An early boss described it as "programming in line noise".
> I thought that was perl.
>
No, that was "you can say anything 27 ways",  but you have to use words.

--dave

--
David Collier-Brown, | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
dave.collier-br...@indexexchange.com |  -- Mark Twain


CONFIDENTIALITY NOTICE AND DISCLAIMER : This telecommunication, including any 
and all attachments, contains confidential information intended only for the 
person(s) to whom it is addressed. Any dissemination, distribution, copying or 
disclosure is strictly prohibited and is not a waiver of confidentiality. If 
you have received this telecommunication in error, please notify the sender 
immediately by return electronic mail and delete the message from your inbox 
and deleted items folders. This telecommunication does not constitute an 
express or implied agreement to conduct transactions by electronic means, nor 
does it constitute a contract offer, a contract amendment or an acceptance of a 
contract offer. Contract terms contained in this telecommunication are subject 
to legal review and the completion of formal documentation and are not binding 
until same is confirmed in writing and has been signed by an authorized 
signatory.
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Scott Allen via talk
> On Fri, Nov 08, 2019 at 07:27:47PM +, Dave Collier-Brown via talk wrote:
> > On 2019-11-08 11:41 a.m., Giles Orr via talk wrote:
> > An early boss described it as "programming in line noise".
>
> I thought that was perl.

Or maybe APL.

-- 
Scott
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Lennart Sorensen via talk
On Fri, Nov 08, 2019 at 07:27:47PM +, Dave Collier-Brown via talk wrote:
> On 2019-11-08 11:41 a.m., Giles Orr via talk wrote:
> 
> > Eyeballing simple regex is hard enough, but mentally parsing out a
> > complex full line regex that looks like inline garbage without the
> > benefit of comments isn't something I recommend or appreciate.
> 
> An early boss described it as "programming in line noise".

I thought that was perl.

-- 
Len Sorensen
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Dave Collier-Brown via talk
On 2019-11-08 11:41 a.m., Giles Orr via talk wrote:

> Eyeballing simple regex is hard enough, but mentally parsing out a
> complex full line regex that looks like inline garbage without the
> benefit of comments isn't something I recommend or appreciate.

An early boss described it as "programming in line noise".

--dave

--

David Collier-Brown, | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
dave.collier-br...@indexexchange.com |  -- Mark Twain


CONFIDENTIALITY NOTICE AND DISCLAIMER : This telecommunication, including any 
and all attachments, contains confidential information intended only for the 
person(s) to whom it is addressed. Any dissemination, distribution, copying or 
disclosure is strictly prohibited and is not a waiver of confidentiality. If 
you have received this telecommunication in error, please notify the sender 
immediately by return electronic mail and delete the message from your inbox 
and deleted items folders. This telecommunication does not constitute an 
express or implied agreement to conduct transactions by electronic means, nor 
does it constitute a contract offer, a contract amendment or an acceptance of a 
contract offer. Contract terms contained in this telecommunication are subject 
to legal review and the completion of formal documentation and are not binding 
until same is confirmed in writing and has been signed by an authorized 
signatory.
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Hardcore sed foo

2019-11-08 Thread Giles Orr via talk
On Thu, 7 Nov 2019 at 23:26, Anthony de Boer via talk 
wrote:

> Lennart Sorensen via talk wrote:
> > On Tue, Nov 05, 2019 at 06:42:44AM -0500, Giles Orr via talk wrote:
> > >  ...
> > > Jeez regex is a pain - it took three minutes of staring at that just to
> > > figure it out, even though I knew what we were both trying to achieve.
> >
> > Practice time!
> >
> > https://regexcrossword.com
>
> Oooh, fun!  The Hamlet puzzle took a few minutes to sort out.  But
> then I'm not a regular crossworder.
>
> One of the guys I work with claims that any use of regexen requires
> multiple lines of comment to explain, but I'm firmly of the opinion
> that being able to sight-read them is a basic Unix programming skill.
>

Eyeballing simple regex is hard enough, but mentally parsing out a complex
full line regex that looks like inline garbage without the benefit of
comments isn't something I recommend or appreciate.  Some forms of regex
support comments within the regex itself:

https://www.regular-expressions.info/freespacing.html

However ... "Of the flavors discussed in this tutorial, only ... the POSIX
and GNU flavors don't support it."  Which is where I most need it.  Of
course, you can still make standard shell script comments before or after
the 'sed' block, and I'm very much in favour of those.

-- 
Giles
https://www.gilesorr.com/
giles...@gmail.com
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk