Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I'm going to be adding some new functionality to an existing program.

So you just got a few important arguments arising out of that duty :-)
Ask yourself and (after getting a clear overview of those details in your head) ask your boss if the added functionality shall be:

  • secure (both ways: against attackers, keep system integrity)
  • error handling (fast debugging)
  • reusable (fast further development, short development periods)
  • easy to maintain (uptime)
  • easy to expand to further functionality (secure investment)
  • fast running at a nice (customizable) level (saving money in above places shouldn't cause a need for 'bigger' hardware)
  • What could (and what should at least) be done to make the code to be added to 'act' in such way?
  • Would you need to 'adjust' other code to speed up your developement or to achieve above named goals or can you assure above objectives in any other way, eg. is some functionality meanwhile provided by modules on CPAN and do they do a better job (more powerfull, more flexible, even if only more heavy stress tested - thats an argument for a module from CPAN :-) )?
  • Could other code gain any of above named points, especially reusability, ease of maintenance and expansion if modified?
  • etc.
At a company I worked once the developers group was cut down twice and of 35 people only 7 now actually do still work there now. But the first thing they did was a code review, and there where about 120 modules to be reviewed (yes, all inhouse products, they even wrote their own (btw. really cool) templating system). The measurement was about the same as above but also covered "coding style" to assure a monolith architecture and to reduce the amount of code in general in the way that further abstraction in the end did not redruce the number of modules, but reduced the amount of code dramatically.
The entire application was partially rewritten to be OO and to run under mod_perl. (35 web servers behind 7 load balancers) So they approved that good coding practice is the base for any kind of efficiency.
Msg me if you want proof.

Have a nice day
All decision is left to your taste

In reply to Re: So I'm in a bit of a quandary by little
in thread So I'm in a bit of a quandary by vek

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [Lady_Aleena]: Corion, ouchy.
    [Corion]: (maybe I should write this up as a SoPW) - currently, the "most efficient" data structure I come up with is a single array which I scan for the first fitting one-shot. Not efficient but I don't expect more than five outstanding one-shots anyway
    [choroba]: can't you create a meta-key corresponding to the disjunction of the events?
    [robby_dobby]: Corion: Heh. This whole thing smells of Strategy Pattern or MVC pattern.
    [Corion]: And performance linear to the number of registered one-shots doesn't feel that bad. Maybe I should collect statistics on how many callbacks are outstanding ;)
    [Corion]: choroba: Yes, but the longer I thought about efficient hashes mapping the event type back to their callbacks, and how to keep them in sync, the more I thought that all that optimization might just not be worth it, even if it's horribly inelegant
    [Lady_Aleena]: My biggest problem with hashes at the moment is one with 2,501 keys.
    [choroba]: how many event types are there?
    [Corion]: Also I found that I can't conveniently weaken an array slot, which also is inconvenient, as I want my one-shots to disappear if the caller discards them
    [Corion]: choroba: Currently two or three that my program handles (WWW::Mechanize:: Chrome), but there might be more that become interesting

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (7)
    As of 2017-05-29 07:56 GMT
    Find Nodes?
      Voting Booth?