• Re: How do you handle debug code? Removing from production versus condi

    From Angle@21:1/5 to Ryan on Sat Apr 22 22:06:52 2023
    You know how stupid You look ? It is absolutely beyond belief !!!!!!!!!!!!!!!



    On Friday, May 3, 2019 at 3:00:29 AM UTC+2, Ryan wrote:
    Perhaps an age old question, but how do you all deal with your debug code? Do you remove it before deploying to production, if so how do you make sure you remove it all without removing something important that will break your code? Or do you use
    conditional execution such as:

    if ($_ENV['DEGUG'] == true) {
    var_dump($data);
    }

    If so what condition are you using? An environment variable like above, a constant defined elsewhere in a config file?

    I think conditional execution would be easier but question if having to check if the debug code can run would slow down a production server, but the question is how much overhead really does it take to check $_ENV or a constant...

    So I am curious to see how others deal with this.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Doctor@21:1/5 to angleaaaaaaa@zohomail.eu on Sun Apr 23 12:03:27 2023
    In article <c028adea-b315-4ba3-8f93-a44b6a097630n@googlegroups.com>,
    Angle <angleaaaaaaa@zohomail.eu> wrote:
    You know how stupid You look ? It is absolutely beyond belief !!!!!!!!!!!!!= >!!



    On Friday, May 3, 2019 at 3:00:29=E2=80=AFAM UTC+2, Ryan wrote:
    Perhaps an age old question, but how do you all deal with your debug code= >? Do you remove it before deploying to production, if so how do you make su= >re you remove it all without removing something important that will break y= >our code? Or do you use conditional execution such as:=20
    =20
    if ($_ENV['DEGUG'] =3D=3D true) {=20
    var_dump($data);=20
    }=20
    =20
    If so what condition are you using? An environment variable like above, a=
    constant defined elsewhere in a config file?=20
    =20
    I think conditional execution would be easier but question if having to c= >heck if the debug code can run would slow down a production server, but the=
    question is how much overhead really does it take to check $_ENV or a cons=
    tant...=20
    =20
    So I am curious to see how others deal with this.

    This abusive spamtroll came from

    comp.lang.php #168037
    X-Received: by 2002:ac8:7d94:0:b0:3e6:970e:a405 with SMTP id c20-
    + 20020ac87d94000000b003e6970ea405mr3339752qtd.6.1682226412762;
    + Sat, 22 Apr 2023 22:06:52 -0700 (PDT)
    X-Received: by 2002:a05:620a:1006:b0:74e:4504:46da with SMTP id
    + z6-20020a05620a100600b0074e450446damr614083qkj.11.1682226412602;
    + Sat, 22 Apr
    + 2023 22:06:52 -0700 (PDT)
    Path: news.nk.ca!news.quux.org!1.us.feeder.erje.net!3.us.feeder.erje.net!
    + feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-
    + out.google.com!nntp.google.com!postnews.google.com!google-groups.
    + googlegroups.com!not-for-mail
    Newsgroups: comp.lang.php
    Date: Sat, 22 Apr 2023 22:06:52 -0700 (PDT)
    In-Reply-To: <a2740b73-91c2-4002-9573-d0204fe2bec7@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=82.131.76.206;
    + posting-account=JYCD-AoAAABJjYHTEug7bzEvKBag4Jpy NNTP-Posting-Host: 82.131.76.206
    References: <a2740b73-91c2-4002-9573-d0204fe2bec7@googlegroups.com>
    User-Agent: G2/1.0
    MIME-Version: 1.0
    Message-ID: <c028adea-b315-4ba3-8f93-a44b6a097630n@googlegroups.com>
    Subject: Re: How do you handle debug code? Removing from production versus
    + conditional execution
    From: Angle <angleaaaaaaa@zohomail.eu>
    Injection-Date: Sun, 23 Apr 2023 05:06:52 +0000
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable
    Lines: 23
    Xref: news.nk.ca comp.lang.php:168037


    Spamtrollers are trolls posting useless spam thinking it is content
    but are posting useless noise. Spamtrolls are newsgroup vandals!
    Thoses trolls are as bad as Donald
    Trump on Twitter.

    This makes https://groups.google.com/search/conversations?qÞpeer%20Google%20Groups

    Depeer Google groups Now!!

    Spamtroller , thou art rebuked in the Name of Yahweh the Father,
    Jesus the Son and the Holy Spirit for Jesus has all authority here
    and Satan has no authority here!
    --
    Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca
    Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t”a1f39b
    We are running a marathon we cannot win when we hide ourselves from who we are. -unknown Beware https://mindspring.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard@21:1/5 to All on Mon Apr 24 17:50:10 2023
    [Please do not mail me a copy of your followup]

    doctor@doctor.nl2k.ab.ca (The Doctor) spake the secret code <u236qf$150$59@gallifrey.nk.ca> thusly:

    This abusive spamtroll came from

    You're only making it worse by responding to their posts. Either
    report the abuse to their posting ISP or adjust your KILL file to drop
    their posts so you don't see them.

    To answer the real question from 2019 (whee!), instead of addding
    "debug" code to your production deployment, write unit tests for
    everything you do so that you have confidence in the deployed code.

    An example can be found here:
    <https://github.com/LegalizeAdulthood/manx>
    --
    "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
    The Terminals Wiki <http://terminals-wiki.org>
    The Computer Graphics Museum <http://computergraphicsmuseum.org>
    Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jerry Stuckle@21:1/5 to Richard on Mon Apr 24 14:27:03 2023
    On 4/24/2023 1:50 PM, Richard wrote:
    [Please do not mail me a copy of your followup]

    doctor@doctor.nl2k.ab.ca (The Doctor) spake the secret code <u236qf$150$59@gallifrey.nk.ca> thusly:

    This abusive spamtroll came from

    You're only making it worse by responding to their posts. Either
    report the abuse to their posting ISP or adjust your KILL file to drop
    their posts so you don't see them.

    To answer the real question from 2019 (whee!), instead of addding
    "debug" code to your production deployment, write unit tests for
    everything you do so that you have confidence in the deployed code.

    An example can be found here:
    <https://github.com/LegalizeAdulthood/manx>

    Actually I don't have a problem with The Doctor calling out the posting
    ISP. But I wish he wouldn't copy the entire message. It just gives the message more popularity.

    --
    ==================
    Remove the "x"'s from my email address
    Jerry Stuckle
    stucklex.jerryx@gmail.com
    ==================

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)