Thursday, July 2, 2015

Digest for comp.lang.c++@googlegroups.com - 2 updates in 2 topics

"Öö Tiib" <ootiib@hot.ee>: Jul 02 03:03AM -0700

On Wednesday, 1 July 2015 11:58:14 UTC+3, Paul wrote:
 
> > That doesn't actually test it correctly. It's a typical beginner mistake.
> > Try to figure out why.
 
> Please could others give feedback about whether they agree that the test is flawed? If it is flawed in an interesting way, then I agree that it would be a good learning experience to fix it.
 
I would suggest to remove such self-made cycle and to learn to use the
<algorithm> from standard library. Reinventing own versions of standard
algorithms isn't defect itself but the self-made cycles are longer to read
so waste time of potential reader, are often less efficient than the ones
written by standard library implementer and also contain defects more
often than standard library does.
 
Therefore good companies value specialists who can avoid reinventing
standard algorithms.
 
To find out if your custom sorting algorithm did a good job or not I
would suggest to check that sorting result's length is same with
original AND then if it is sorted original. Two examples ...
A) check that sorting result 'std::is_sorted' and that it
'std::is_permutation' of original ... OR
B) check that 'std::sort'ing of original causes sequence that is
'std::equal' with result of custom sorting.
 
If it matters then B) is likely faster since 'std::is_permutation' has up
to quadratic complexity.
woodbrian77@gmail.com: Jul 01 10:55PM -0700


> By the grace of G-d, I'm able to devote more time than ever now
> to the C++ Middleware Writer. So your thoughts on topics in this
> thread are appreciated.
 
I hope people will realize the C++ community needs the
C++ Middleware Writer just as we need the C++ community.

Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: