• NAXLAB@lemmy.world
    link
    fedilink
    arrow-up
    49
    ·
    11 months ago

    Is commenting for engagement boost a thing?

    This is incredible and I never could have imagined it. This will democratize the power of programming

  • WetBeardHairs@lemmy.ml
    link
    fedilink
    arrow-up
    41
    arrow-down
    2
    ·
    11 months ago

    Neat. I don’t like that the implementations have to name the function by some cryptic identifier, though. Real words matter in source code.

    Who can tell me what this function is?

    def Z10096(Z10096K1):
        return Z10096K1 == Z10096K1[::-1]
    

    How about this?

    def isPalimdrone(myString):
        return myString == myString[::-1]
    
    • lemmyvore@feddit.nl
      link
      fedilink
      English
      arrow-up
      4
      ·
      11 months ago

      Tbf it wasn’t so much the names that tripped me as the weird Python operator. I would’ve never guessed that’s a string reversal if you hadn’t told me (I don’t know much Python beyond recognizing the syntax). If I had to guess I would’ve said it’s an array pop.

      • WetBeardHairs@lemmy.ml
        link
        fedilink
        arrow-up
        6
        ·
        11 months ago

        When I originally typed it, I made a function for string reversal and called that. But I didn’t include it since I didn’t want to define that too.

        Honestly… this wiki has a seriously difficult path ahead of it. I mean - it’d be fantastic if it did simplify things like that to let you write simple, elegant, and easy to read functions while linking to other functions.

        But it’d also have to lint those and make sure that contributors don’t implement recursive dependencies.

    • Jummit@lemmy.one
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      I hope it’s going to be used instead of machine learning. Seems much more correct, secure and efficient to me.

  • dukk@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    11 months ago

    This is fucking cool. I can imagine the many times this could’ve helped me quite a bit, and honestly even if I didn’t find the function I needed I could still probably hack out a decent implementation in whatever language and actually contribute towards this. In 5-10 years, this could be really useful.