My PHP has gotten fairly pretty. Not so much my JS. Is it me, or the language, or the lack of time to polish it?

    Well, it's not as if anyone has ever claimed that PHP syntax is beautiful. What have you done to make your PHP "prettier"? How many of those practices could be applied to your JavaScript code?

    Just saw this today on Twitter: 🙂

    [upl-image-preview url=https://board.phpbuilder.com/assets/files/2019-10-04/1570211716-615604-javascript-for-kids.jpeg]

    Saw this today on Twitter NogDog

    I think I need to print that for the cubicle wall!!!!

      What have you done to make your PHP "prettier"? NogDog

      Started to understand app architecture better, I guess? 😃

      I seem to have to write a lot more JS to get stuff done than I do PHP, for starters. I have 2200+ lines of JS for one page on the site (granted, it's a complex "one-page-ish" type thing). I probably still have some PHP out there someplace that's huge like that, but not as much as I did, say, 5-10 years ago...

      Caveat: I suck at JavaScript. 🙂 "One-page-ish" makes me think Angular; which besides taking care of a lot of the underlying framework stuff, lets you write your code in Typescript (which eventually gets compiled into JavaScript). Based on the very little experience I have with it, I much prefer using Typescript. May not be of help for an existing app, but maybe worth looking into for the next one.

      Which reminds me, I really should go back to that Angular course I got when Udemy was having a sale.

        NogDog Thank you for that picture. That made me snort to the point that my wife just paused what she was watching in the other room to make sure I wasn't choking.

        cluelessPHP 2200+ lines? I am confusion

        Maybe a use case for a JavaScript "bundler" like Parcel? As I understand it (have not used it), you could then separate your code into multiple files (like you would in PHP for classes and maybe groups of related functions) as opposed to one big procedural file?

        Or not. 🤷‍♂️

        NogDog adding a lot of classes HTML classes that is and cookies too I guess? ClassList 🤔

          to make sure I wasn't choking. maxxd

          You keep that lady around, now, y'hear? #ThatsGold

          I am in confusion.

          Multiple files already. One has photo functions, one has table functions ... (eek!), one operates the AJAX stuff, one is more general to that page. But the 2200+ doesn't include the stuff that we use on ALL pages either, so technically there's more than that loading into the browser ....

          [upl-image-preview url=https://board.phpbuilder.com/assets/files/2019-10-09/1570657009-774331-img-20191009-163509692.jpeg]

          That reminds me.

          There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors. And scope creep.

          I guess I need to add that last one to the list ... although maybe I shouldn't lest some PHB comes by and thinks it's a good idea .... 😁😁

            dalecosp You keep that lady around, now, y'hear? #ThatsGold

            This was the year where we've been together half our lives. If she hasn't killed me by now I assume it's because she's just too tired to do it and she'll probably stick around a bit longer 😃. I hope, anyway...