Re: [ppig-discuss] Interesting (?) post

2015-08-11 Thread John Zabroski
By the way, to rephrase my point - "less time on code readability and more
on abstraction (using maths)".  I realize it may not have been clear.

I just see sooo many publicly traded computer companies post financial
losses due to soaring infrastructure costs in their K-8 and K10 reports via
SEC, and I can't help but wonder sloppy "readable functional coding" like
this is to blame.

On Tue, Aug 11, 2015 at 12:44 PM, John Zabroski 
wrote:

> I wish researchers would spend less time on code readability and more on
> abstraction. These Mickey Mouse Club tests are great if our goal is testing
> ability to implement "line of business requirements" very literally but say
> nothing about how to model the interaction between two complex state
> machines, or deal with problems involving
>
> I personally hate on both ways to process a list of numbers because the
> filters themselves are not composed in a functional style as first class
> values. This naive functional coding is now a worst case O (n^m) algorithm
> where m is the number of filter passes.
>
> So, the code should be:
>
> Var ListOfFilters = [number -> number > 5,
> number -> isEven(number),
> number -> number < 9,
> number -> number * 2 > 15]
> Var filters = foldl (Op.AndAlso, ListOfFilters)
> Var result = numbers.asEnumerable().first (filters)
>
> So, as is usual, there is always improvements to be made in abstract
> thinking. Note that I replaced asStream () with asEnumerable because it is
> semantically more correct... if a list is not a lazy structure, the
> operator (first) is.
>
> We didn't even cover in my small discussion how to transform the list into
> a lazy stream or cursor, to support early termination of the list being
> consumed, using a trick called Superfold.
>
> But this is really low level content. If a teacher can't teach this right
> he or she is somewhere between 11 to 48 years behind best practices.
> On Aug 11, 2015 9:43 AM, "Russel Winder"  wrote:
>
>> http://blog.agiledeveloper.com/2015/08/prefer-functional-style-over
>> -imperative.html
>> 
>>
>> Venkat Subramaniam is a well-known person in the Java/Groovy/Scala
>> -verse.
>>
>> --
>> Russel.
>>
>> =
>> Dr Russel Winder  t: +44 20 7585 2200   voip:
>> sip:russel.win...@ekiga.net
>> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
>> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PPIG Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ppig-discuss+unsubscr...@googlegroups.com.
>> To post to this group, send an email to ppig-discuss@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "PPIG 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ppig-discuss+unsubscr...@googlegroups.com.
To post to this group, send an email to ppig-discuss@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ppig-discuss] Interesting (?) post

2015-08-11 Thread John Zabroski
I wish researchers would spend less time on code readability and more on
abstraction. These Mickey Mouse Club tests are great if our goal is testing
ability to implement "line of business requirements" very literally but say
nothing about how to model the interaction between two complex state
machines, or deal with problems involving

I personally hate on both ways to process a list of numbers because the
filters themselves are not composed in a functional style as first class
values. This naive functional coding is now a worst case O (n^m) algorithm
where m is the number of filter passes.

So, the code should be:

Var ListOfFilters = [number -> number > 5,
number -> isEven(number),
number -> number < 9,
number -> number * 2 > 15]
Var filters = foldl (Op.AndAlso, ListOfFilters)
Var result = numbers.asEnumerable().first (filters)

So, as is usual, there is always improvements to be made in abstract
thinking. Note that I replaced asStream () with asEnumerable because it is
semantically more correct... if a list is not a lazy structure, the
operator (first) is.

We didn't even cover in my small discussion how to transform the list into
a lazy stream or cursor, to support early termination of the list being
consumed, using a trick called Superfold.

But this is really low level content. If a teacher can't teach this right
he or she is somewhere between 11 to 48 years behind best practices.
On Aug 11, 2015 9:43 AM, "Russel Winder"  wrote:

> http://blog.agiledeveloper.com/2015/08/prefer-functional-style-over
> -imperative.html
>
> Venkat Subramaniam is a well-known person in the Java/Groovy/Scala
> -verse.
>
> --
> Russel.
>
> =
> Dr Russel Winder  t: +44 20 7585 2200   voip:
> sip:russel.win...@ekiga.net
> 41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>
> --
> You received this message because you are subscribed to the Google Groups
> "PPIG Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ppig-discuss+unsubscr...@googlegroups.com.
> To post to this group, send an email to ppig-discuss@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "PPIG 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ppig-discuss+unsubscr...@googlegroups.com.
To post to this group, send an email to ppig-discuss@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ppig-discuss] Interesting (?) post

2015-08-11 Thread Russel Winder
http://blog.agiledeveloper.com/2015/08/prefer-functional-style-over
-imperative.html

Venkat Subramaniam is a well-known person in the Java/Groovy/Scala
-verse.

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

-- 
You received this message because you are subscribed to the Google Groups "PPIG 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ppig-discuss+unsubscr...@googlegroups.com.
To post to this group, send an email to ppig-discuss@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part