Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^6: Perl Contempt in My Workplace

by marto (Cardinal)
on May 05, 2021 at 17:13 UTC ( #11132082=note: print w/replies, xml ) Need Help??

in reply to Re^5: Perl Contempt in My Workplace
in thread Perl Contempt in My Workplace

"I need to work with database of 10_000_000+ records, those do not fit just JSON."

Again, this has nothing to do with perl. The DataTables (JavaScript library, not Perl module) is very clear that you're doing it wrong, you can't have read the documentation for the tool you've decided to use. Server Side Processing. This would be the case regardless of what language you choose. You could or add clauses to your search query and/or page results, neither of which you've done. I don't use this module at all, and just return JSON data as explained earlier.

"How can I trust version 0.08? Author makes it clear that the module far from robust?"

Where does the author make it clear that is it 'far from robust'? How do you trust any other module or code you pull down regardless of language? Again, no perl/cpan issue here.

Replies are listed 'Best First'.
Re^7: Perl Contempt in My Workplace
by vkon (Curate) on May 05, 2021 at 17:59 UTC
    given that I am doing it wrong - can you suggest the right way?

    what CPAN module should I use for the "server-side processing"?

    regarding 0.08 - I treat "0.0x" versions as "experimental" - the released version should be at least 1.0+ - am I wrong again with this assumption?

      what CPAN module should I use for the "server-side processing"?

      Why do you need a module? Can you describe what such a module would do?

      So you have a web server and you receive an ajax request with all the many parameters needed to fetch the next page of results. If you were using a module and you wanted to provide those parameters and get back JSON, what would the module do? Isn't it only to query the DB and convert the results to JSON? So what should the module do? Wrap up the DB query with some layers of abstraction? By the time you wrote the config needed you could have written the handler directly with DBI.

      I admit I often have some custom filtering/ordering code in the ajax route handler that preprocesses the DB query but as I said before I don't see how that could productively be abstracted.

      The way forward always starts with a minimal test.
        why I need a module - because I want to stay on shoulders of giants and not reinvent the wheels.
        my plan was to find some plugin for Catalyst of Mojo or Dancer or whatever so to have my database "just work" - like in - just a table but also with excel-like filtering
        I agree that productive abstracting could be problematic in this particular case.

      Yes, in general. There is nothing semantically significant about a module with a version number less than 1.0.


        Agreed. I have done many projects where version numbering is integer-only. So a Version "1" means it's the first ever version of that module, and probably quite buggy. I used Integers, so i wouldn't have to deal with floating-point bugs in a number of automated deployment and validation scripts.

        In my opinion, version numbers only have to do two things: 1) Make sense to the Author. 2) Increase with every version so that PAUSE/CPAN/BackPAN stuff sees them as "newer"

        One of the projects i mentioned above is a web/worker framework. When dynamically loading modules (for a specific project), it checks the version number of that module and only accepts it if it's the same version as the framework. So, occasionally, i have to bump some projects version number without any other changes (so looking *only* at that project, some people may be confused). Reason behind this is simple: A new framework version usually has some API changes, so i want to make sure all projects based on that get a once-over when upgrading the framework and i'm not unwittingly running into upgrade woes.

        perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2023-05-31 16:50 GMT
Find Nodes?
    Voting Booth?

    No recent polls found