Please dont take this seriously guys its just a dumb meme I haven’t written a single line of code in half of these languages

    • @[email protected]OP
      link
      fedilink
      71 year ago

      I mean good point, but if I’m just using bash as a shell and not writing a script, I’m probably first previewing the contents of a file with cat anyway, and recalling the last command and appending a | grep <pattern> to it is less keystrokes than re-writing the last command into grep <pattern> <file>. Especially if you’re playing around with the pattern and trying to get it right, it’s nice to have the pattern at the end of the line.

  • @[email protected]
    link
    fedilink
    471 year ago

    i feel like javascript could also be

    Problem -> solution -> 3 days pass -> all dependencies had breaking changes made -> problem

    • @[email protected]
      link
      fedilink
      English
      271 year ago

      Ever wanted to be somewhere inbetween java and JavaScript?

      Yeah, that’s Groovy. Only it’s the wrong groove

    • @[email protected]
      link
      fedilink
      151 year ago

      JS is ironic punishment as a programming language. It’s fun to screw around in! And then you have to use it for stuff, and pain ensues.

    • @[email protected]
      link
      fedilink
      81 year ago

      What makes JavaScript so widely disliked? I know very little of it, and in skimming different stuff I think I’ve seen like a million different frameworks for it, so is that a part of it?

    • 👍Maximum Derek👍
      link
      fedilink
      English
      551 year ago

      I used to think Javascript was hell when I barely used it. Now I have to build with it regularly and… once in a while I’m just right about things.

  • @[email protected]
    link
    fedilink
    431 year ago

    Python one is accurate. Most of our problems are solved by importing a library and writing the line, librarySolver.importedFunction.SolveMyProblem()

    def main(): Print(‘thanks librarySolver’)

    • @[email protected]
      link
      fedilink
      151 year ago

      Advent of code 2023 day 24 part 2. Z3 solver saved the day on that one.

      Now I have PTSD every time I see an hailstorm.

      • @[email protected]
        link
        fedilink
        6
        edit-2
        1 year ago

        So many solver solutions that day, either Z3 or Gauss-Jordan lol. I got a little obsessed about doing it without solvers or (god forbid) manually solving the system and eventually found a relatively simple way to find the intersection with just lines and planes:

        1. Translate all hailstones and their velocities to a reference frame in which one stone is stationary at 0,0,0 (origin).
        2. Take another arbitrary hailstone (A) and cross its (rereferenced) velocity and position vectors. This gives the normal vector of a plane containing the origin and the trajectory of A, both of which the thrown stone must intersect. So, the trajectory of the thrown stone lies in that plane somewhere.
        3. Take two more arbitrary hailstones B and C and find the points and times that they intersect the plane. The thrown stone must strike B and C at those points, so those points are coordinates on the line representing the thrown stone. The velocity of the thrown stone is calculated by dividing the displacement between the two points by the difference of the time points of the intersections.
        4. Use the velocity of the thrown stone and the time and position info the intersection of B or C to determine the position of the thrown stone at t = 0
        5. Translate that position and velocity back to the original reference frame.

        It’s a suboptimal solution in that it uses 4 hailstones instead of the theoretical minimum of 3, but was a lot easier to wrap my head around. Incidentally, it is not too hard to adapt the above algorithm to not need C (i.e., to use only 3 hailstones) by using line intersections. Such a solution is not much more complicated than what I gave and still has a simple geometric interpretation, but I’ll leave that as an exercise for the reader :)

        • @[email protected]
          link
          fedilink
          21 year ago

          That is a great explanation of how you solved it, thanks! I should go back to it and conquer that puzzle properly without a solver. Or at least try.

  • @[email protected]
    link
    fedilink
    English
    27
    edit-2
    1 year ago

    C:

    Problemreturn Solution;

    C++:

    Problem

    const [auto]&& (Problem&& problem) noexcept(noexcept( Solution<Problem>{}(std::forward<Problem>(problem)) )) { return Solution<Problem>{}(std::forward<Problem>(problem)); } -> decltype( Solution<Problem>{}(std::forward<Problem>(problem)) )
    
    • Venia Silente
      link
      fedilink
      English
      51 year ago

      But this doesn’t return the Solution. You don’t invoke the lambda.

      (Or does C++ have implied returns now? Last I heard there was implied move)

      • @[email protected]
        link
        fedilink
        English
        21 year ago

        Actually I do; it’s the {} that initializes the lambda, and the parenthesis after invokes.

        That said, it would have been fun.

  • @[email protected]
    link
    fedilink
    1081 year ago

    missing the stage of C where it’s all incomprehensible bitfucking with comments like “this works, i do not know why it works, do not touch this”

      • @[email protected]
        link
        fedilink
        161 year ago

        CSS isn’t as bad these days if you use Flexbox. Debugging floats and absolute/relative positioning was a nightmare in comparison.

        • @[email protected]
          link
          fedilink
          3
          edit-2
          1 year ago

          On the other hand, it made webpages way less flexible.

          Like yesterday (i have the browser not in fullscreen, for reasons) on my 16" fullhd notebook, webdev couldn’t imagine that someone would use his site in a ~1000px browser window, sidebars left and right, the main content about 20 characters wide squeezed inbetween. So i pressed f12 and deleted the sidebars. But the content was still 20em wide, because of flexbox.

      • @[email protected]
        link
        fedilink
        181 year ago

        That one is not that complicated if you don’t think about the math. It’s basically just if we interpret the float as int and add a magic number we have a good estimation.

        From what I remember at least, it’s been a little while since I implemented it.

        • @[email protected]
          link
          fedilink
          111 year ago

          IIRC also relying on how floating-point is basically scientific notation and the most-significant bits are the exponent.

          And most importantly, relying on how a sloppy answer works just fine. The most important skill in game development is cheating.

          • sheepishly
            link
            fedilink
            61 year ago

            The most important skill in game development is cheating.

            Makes me feel better about my own game dev attempts lmao.

        • sheepishly
          link
          fedilink
          81 year ago

          I was more thinking of the comments which are pretty much exactly what you said (“incomprehensible bit hacks” followed by “what the FUCK?”)

  • @[email protected]
    link
    fedilink
    English
    81 year ago

    PHP -> Problem -> Replace the developer -> Solution.

    Yes PHP was bad in 5.x, in 8.x if things go bad it’s just the developer who’s bad.