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

  • Swedneck@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    4 months 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”

      • PlexSheep@feddit.de
        link
        fedilink
        arrow-up
        1
        ·
        4 months 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.

        • mindbleach@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          4 months 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@kbin.social
            link
            fedilink
            arrow-up
            1
            ·
            4 months ago

            The most important skill in game development is cheating.

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

        • sheepishly@kbin.social
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

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

  • wabafee@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

    JS is basically the Hydra from the Greek Mythology.

    Though PHP is literally the problem had me lol.

    • mindbleach@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      4 months 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.

    • ALostInquirer@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      4 months 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?

      • smileyhead@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        It was mostly made for simple scripts to embed on a website for animations and handling updates without refreshing whole page. Not to make a full portable client (browser) side app.
        Hating JavaScript is mostly a meme, it’s just a programming language. But its very loose syntax, fact it’s often someone’s first programming language to learn and how most programs written in it nowadays are a hack build on top of a hack on top a hack makes this language easy to laugh at.

    • theherk@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

      I’ve seen this before but don’t accept it myself. There are cases where you just wanted to cat. In this case, maybe to review the problem. Then you want to extend the command. Preserving it in the next commands where you start stacking on pipes is useful since it can be fewer strokes and maintain a habit.

  • nintendiator@feddit.cl
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 months 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@lemm.ee
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months 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)

    • stevedidwhat_infosec@infosec.pub
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      Idk I still like writing my own stuff purely pythonic when I can. Pythons syntax is the most “fun” and “natural” for me so I find it fun. Like doin a sudoku puzzle

        • stevedidwhat_infosec@infosec.pub
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          This is the best way I’ve ever heard this described lol. You get used to it so fast, it’s really simple. Just indent your code like you’re supposed to 🤷🏻‍♂️

          • frezik@midwest.social
            link
            fedilink
            arrow-up
            0
            ·
            4 months ago

            The problem is that Python programmers tend to think the job of readability is done just by indentation. This is wrong, and it shows in all sorts of readability issues. Many of which are in official docs.

            • Fushuan [he/him]@lemm.ee
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              4 months ago

              Same could be said about people that don’t think that indentation is not important for readability. Both are important, but if you really care about it defining an auto formatter and customising it for whatever consensus the team has is the only way to operate anyway.

              • frezik@midwest.social
                link
                fedilink
                arrow-up
                1
                ·
                4 months ago

                Same could be said about people that don’t think that indentation is not important for readability.

                You should really avoid double negatives. What you actually said was "Same could be said about people that think that indentation is important for readability“, which makes no sense in the context of the rest of your post.

                And I’m not saying this just to be a dick about grammar. I mean, obviously I am, but not just that. If your English isn’t readable, then I don’t trust your Python, either.

                • Fushuan [he/him]@lemm.ee
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  4 months ago

                  My bad, I deleted part of the comment to rewrite it and forgot part of the original. And as you probably guessed I meant for it to be a single negative.

                  Good thing this is a casual forum and not a work environment where I would reread my code with care haha. There’s a reason linters exist in code editors, it’s for people like me.

  • bort@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    4 months ago

    Latex: Problem --> \def\please@#1#2#3#4{\e@kill#2#3{\me#1}#4@now} -->

    • renzev@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      Accurate. LaTeX is great, it makes you feel like you have superpowers compared to “office suite”-style software. But every once in a while you just run into some bullshit that feels like it’s stuck in 1985 and it completely breaks your flow. I remember wanting to make a longtable where text in the “date” column would be rotated by 90 degrees to leave more horizontal room for the other columns. It took me two rotateboxes, a phantom, a vspace, a hspace and 40 minutes of my life to get the alignment right. Would probably have taken a duckduckgo search and three clicks in Libreoffice.

      • voxel@sopuli.xyz
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        btw what do you think about typst?
        i only used it for simple stuff so far but it seems pretty fun and easy to use

        • PixelProf@lemmy.ca
          cake
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          My two cents, after years of Markdown (and md to PDF solutions) and LaTeX and a full two years of trying to commit to bashing my head against Word for work purposes, I’m really enjoying Typst. It didn’t take long to convert my themes, having docs I can import which are basically just variables to share across documents in a folder has been really helpful. Haven’t gone too deep into it but I’m excited to give it a deeper test run over the next little bit.

        • renzev@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          Never heard of it before, but might give it a try at some point. From the website, it seems like something halfway in between LaTeX and Markdown? Sounds exactly like what I need at times, tbh.

  • NocturnalMorning@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 months 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’)

      • ornery_chemist@mander.xyz
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        3 months 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 :)