• bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 hours ago

    Fuck that. I once used a constraint solver in python where you could += a constraint to a problem. This is completely un-discoverable. In any sane language you can use IntelliSense to find that you can problem.add(constraint) and be done with it without ever touching a manual. Overloaded operators are cool, but a menace.

    And while I’m ranting: Angular’s new addRouting(), withThingA(), withThingB() is complete horseshit, too. The old way of doing addRouter({ and letting the IDE tell you what you could to with the router was so much clearer!

    • rtxn@lemmy.world
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      1 hour ago

      timedelta marks time in days, seconds, and microseconds. It doesn’t take leap years into account because the concept of years is irrelevant to timedelta. If you need to account for leap years, you need a different API.

    • wols@lemmy.zip
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      36 minutes ago

      The comparison is somewhat awkward, because the rails example presumably produces a date, while the python one is referring to an interval of time.
      Just from the meme it’s not obvious which was the actual intended use, so labeling either as inaccurate requires us to make assumptions.

      Personally, the concept of “10 years ago” is a bit nebulous to me. If today is February 29th, is ten years ago March 1st? Doesn’t seem right. Or particularly useful.

  • friend_of_satan@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    ·
    edit-2
    10 hours ago

    This implies that integers in ROR are complex objects with properties that would be unhelpful in the majority of scenarios. Is that right?

    • myotheraccount@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      10 hours ago

      Integers are just integers in ruby, with no structure backing them. They behave like objects, but only in some respects. You can call methods on them, but you can’t extend individual numbers with properties for example (which would require them to have structure).

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      1
      ·
      5 hours ago

      I had a coworker choose RoR for a major project despite the fact that he didn’t know it, nobody on his team knew it, nobody at our company knew it, and nobody in the entire state knew it. It ended as one would expect, after three years and millions of dollars spent, with the only revenue it generated being $50K from the original client that had to be refunded to avoid a lawsuit.

      • marsza@lemmy.cafe
        link
        fedilink
        English
        arrow-up
        16
        ·
        9 hours ago

        I fucking love PHP. I know I probably sound crazy to most developers, but PHP 8+ is freaking dope.

          • coherent_domain@infosec.pub
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 hour ago

            I haven’t used or read about PHP after college, and I am quite interesred in what are the good stuffs that you like now.

            It is cool to see how languages evolve.

            • sfxrlz@lemmy.dbzer0.com
              link
              fedilink
              arrow-up
              2
              ·
              53 minutes ago

              I haven’t used php before and I am not that far into it yet, so I don’t really know what’s gotten better but I like how it handles arrays and it has loads of little functions that make life easier.

    • LedgeDrop@lemmy.zip
      link
      fedilink
      arrow-up
      7
      ·
      10 hours ago

      The handful of us have moved onto Crystal Lang. It’s a statically type checked and compiled dialect of Ruby. Crystal is fun to write code, but the compiler is slower (compared to go-lang/rust)… because… well it’s a ruby dialect (with DSL’s)… and the 3rd party libraries are limited.

  • Victor@lemmy.world
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    edit-2
    1 hour ago

    I’m gonna be honest, I never was drawn to python. I’ve been a professional developer for about a decade, and I’ve written all of one (1) python programs that I can remember (for my own personal use, mind).

    • addie@feddit.uk
      link
      fedilink
      arrow-up
      7
      ·
      4 hours ago

      What you can achieve in a couple of pages of Python can be pretty spectacular. It’s also mostly very easy-to-read, with the possible exception of class inheritance, which is confusing mess.

      If you need to write more than a couple of pages, then its lack of types becomes a hindrance to me - doing refactors when functions can take basically any arguments is quite painful, for instance. Not requiring any particular structure is great, up until you start to struggle with lack of structure.

      Ideal programming language for when you’re wanting to do something that would be a bit too unwieldy for a shell script. It also makes network requests and json parsing very straightforward, so it’s great for interacting with REST APIs and writing simple microservices. Fast to write and runs quite quickly, so a good choice for Advent Of Code-like tasks. Would probably choose a different language for larger projects or when working in a team, though.

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 hour ago

        I like Fish Shell better than python, not gonna lie. Easier to read and write. Especially if you already live in the terminal.

  • etchinghillside@reddthat.com
    link
    fedilink
    arrow-up
    30
    arrow-down
    5
    ·
    edit-2
    12 hours ago

    LLM is saying this is a feature of Rails and not particularly Ruby.

    I was surprised Python didn’t have a years parameter but learned about

    relativedelta(years=10)

    • mesa@piefed.social
      link
      fedilink
      English
      arrow-up
      29
      ·
      13 hours ago

      Yeah its a rails only thing. Rubys biggest issue is its much too intelligent for its own good. Its implicit rather than pythons explicit. Most of the time. That and it’s hard to find out where Ruby starts and rails ends.

      That being said I made a ton of good money on rails back about 15 or so years ago. Still excellent for starting out.