Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: 5x6-bit values into/out of a 32-bit word

by BrowserUk (Pope)
on Mar 18, 2007 at 14:20 UTC ( #605356=note: print w/ replies, xml ) Need Help??


in reply to Re^3: 5x6-bit values into/out of a 32-bit word
in thread 5x6-bit values into/out of a 32-bit word

Get [the computer] to calculate those multiples of 6, it's better at that than you are.

What utter rubbish! If you cannot recite the first five terms of the 6 times table from memory, and more quickly than you can power up your computer...


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^4: 5x6-bit values into/out of a 32-bit word
Re^5: 5x6-bit values into/out of a 32-bit word
by grinder (Bishop) on Mar 18, 2007 at 15:04 UTC

    Don't take things so literally.

    Of course we know our 6 times tables. And the computer is already switched on.

    What if your requirements change, and it's 7 4-bit values, or 10 3-bit values? In my code, you only have to change one or two initialisers. In Thelonius's code you have to rework nearly all of it. Even if the particular edits are trivial, there are far too many.

    It's a variant on the Don't Repeat Yourself principle. I am surprised you didn't grasp this.

    • another intruder with the mooring in the heart of the Perl

      That's all very well, but there is no context upon which you could conclude that there is any merit whatsoever in prematurely generalising the stated problem.

      And in context, which as the writer of the OP I am uniquely qualified to judge, the is no chance that the requirements will ever change from 5x6-bit values. None.

      The underlying system that the problem models has been unchanged for at least 500, likely 600 and possibly 700 years. It ain't gonna change now, so the misbegotten computer pseudoscience of premature generalisation will achieve exactly naught.

      With the greatest of respect to my countryman, his sweeping generalisation of 40-odd years ago has been misused and abused so frequently in the intervening period, to the point where I think that outside of the rarefied atmosphere of academia and pure research, it's true meaning has been lost.

      I contend that in the modern world of commercial development, more money has been spent and wasted; more God-object hierarchies have been developed and discarded; and more development time wasted in pursuit of the premature generalisation than was ever the case with premature optimisation up to the time when he draughted his dictum.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Jeez man, did you forget to take your medication or something? Of course there was no context to conclude anything, since "How would you do this in Perl" doesn't give us very much to go on. Is it any wonder that you only received two and a half responses (I count ikegami's as a half, I don't think (s)he'd mind).

        Normally, these sorts of challenges draw dozens of different responses, and there is much to study and learn. I don't know if it's the general decline of Perlmonks, the fact that you posted the question on a weekend, or that that the question sucked, but I was very surprised that only two useful responses were made.

        So of the two responses, I came up with what I thought was a nice solution that plays to Perl's strengths, short, idiomatic and easily reused in other contexts. I conceived with absolutely not the slightest consideration to performance issues, and people are giving me grief about premature optimisation? Give me a break.

        I contended that Thelonius's solution should be flagged with a red flag, because it contains repetitive code that could be factored out (and Thelonius admits that the point is generally valid). In the absence of any other hints whatsoever in the initial post as to what purpose this code server, I maintain that my solution is better. It may well be that Thelonius's solution is technically superior, performs better and so on. But you gave no method for discriminating between proposed solutions and now you're moaning about premature "generalisation". Yeah right. Remind me not to reply to your questions in the future.

        • another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://605356]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-07-31 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls