Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
Jeena ( jeena@piefed.jeena.net )  to Programmer Humor@lemmy.mlEnglish · 2 years ago

1 hour in Java

piefed.jeena.net

message-square
32
link
fedilink
394

1 hour in Java

piefed.jeena.net

Jeena ( jeena@piefed.jeena.net )  to Programmer Humor@lemmy.mlEnglish · 2 years ago
message-square
32
link
fedilink
alert-triangle
You must log in or # to comment.
  • lugal ( lugal@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    68
    ·
    2 years ago

    But one compiling error is Java is 7 run time errors in python.

    There is a type error and you couldn’t have known it beforehand? Thanks for nothing

    • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
      link
      fedilink
      arrow-up
      36
      ·
      2 years ago

      I will confess that I get a sense of psychological comfort from strict typing, even though everyone agrees Python is faster for a quick hack. I usually go with Haskell for quick stuff.

      • Ephera ( Ephera@lemmy.ml ) 
        link
        fedilink
        arrow-up
        19
        ·
        2 years ago

        I find Python is quick for the first 30 minutes. If you need any kind of libraries, or assistance from an IDE, or a distribution build, or you’re more familiar with another language, then it isn’t quicker.

        • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          I won’t feel bad about it then, lol. At least not until I’m collabing on something and they want to use Python.

      • BlueKey ( BlueKey@fedia.io ) 
        link
        fedilink
        arrow-up
        16
        ·
        2 years ago

        And then the quick hack gets a permanent solution and the next employee has to fight trough the spagetti.

        • linkhidalgogato ( linkhidalgogato@lemmy.ml ) 
          link
          fedilink
          arrow-up
          6
          ·
          2 years ago

          sounds like not my problem

          • Luvon ( Luvon@beehaw.org ) 
            link
            fedilink
            arrow-up
            4
            ·
            2 years ago

            You will find yourself being that next person when you haven’t touched the code for a week and come back to add something and are like wtf.

            • embed_me ( embed_me@programming.dev ) 
              link
              fedilink
              arrow-up
              2
              ·
              2 years ago

              The circle of 1!f€

        • NeatNit ( NeatNit@discuss.tchncs.de ) 
          link
          fedilink
          arrow-up
          3
          ·
          2 years ago

          This may be true, but it’s equally true in any programming language, so not really relevant.

          • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            I’d guess it’s less true for something statically typed, just because that reduces the ways it can be unintuitive.

            • NeatNit ( NeatNit@discuss.tchncs.de ) 
              link
              fedilink
              arrow-up
              1
              ·
              2 years ago

              I firmly believe that every language has an equal proportion of spaghetti code to clean code. The only factor that might screw with this is how much a language is used in industry, which I’d expect raises the ratio. However, there’s plenty of hobbyists writing spaghetti code too so I don’t think even that factor has much effect.

              • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
                link
                fedilink
                arrow-up
                1
                ·
                2 years ago

                Really? Doesn’t that imply non-spaghetti brainfuck or assembly?

                • NeatNit ( NeatNit@discuss.tchncs.de ) 
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  2 years ago

                  Okay, I’ll grant you brainfuck… As for assembly, I don’t think it’s inherently spaghetti. You can split it up into functions just like you can with an actual programming language. It’s not impossible to make structured code.

                  That said, I never coded assembly outside of a mandatory university course, so I don’t feel super confident in saying that. But I don’t think of it as a programming language anyway - it’s a 1:1 translation to/from machine code, and machine code isn’t meant to make programming easy or scalable.

        • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Such is life.

      • lugal ( lugal@sopuli.xyz ) 
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        I wrote my bachelor’s thesis in Haskell and have never touched it again.

        • CanadaPlus ( CanadaPlus@lemmy.sdf.org ) 
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          A lot of people feel that way. If I need to generate a set of numbers or a certain string, though, it’s pretty easy to punch out a one-liner in GHCi, and that’s usually my use case.

    • zaphod ( zaphod@sopuli.xyz ) 
      link
      fedilink
      arrow-up
      7
      ·
      2 years ago

      Did everyone become stupid in the last 10 or so years? We used to write huge apps in Python without any type checkers or static analysis tools and never had any problems we wouldn’t have had in statically typed languages.

    • Sibbo ( Sibbo@sopuli.xyz ) 
      link
      fedilink
      arrow-up
      6
      ·
      2 years ago

      In Java you get a bunch of unexpected NullPointerExceptions instead…

    • Kache ( Kache@lemm.ee ) 
      link
      fedilink
      arrow-up
      5
      ·
      2 years ago

      I find it’s possible to operate Python as a statically typed language if you wanted, though it takes some setup with external tooling. It wasn’t hard, but had to set up pyright, editor integration, configuration to type check strictly and along with tests, and CI.

      I even find the type system to be far more powerful than how I remembered Java’s to be (though I’m not familiar with the newest Java versions).

  • GluWu ( GluWu@lemm.ee ) 
    link
    fedilink
    English
    arrow-up
    23
    ·
    2 years ago

    Java feels like McDonald’s and python feels like a grocery store.

    Rust feels like a femboi hooters where they offer IVs you don’t think they’re qualified to administer.

    • T. Hex ( 0x0@lemmy.dbzer0.com ) 
      link
      fedilink
      arrow-up
      39
      ·
      2 years ago

      I don’t understand any of these analogies at all

      • Sas [she/her] ( Sas@beehaw.org ) 
        link
        fedilink
        arrow-up
        5
        ·
        2 years ago

        Me neither but now I’m interested in Femboi-Hooters 👀

  • masterspace ( masterspace@lemmy.ca ) 
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 years ago

    Python, Java/TypeScript, C#, Swift, Go…

  • GravitySpoiled ( GravitySpoiled@lemmy.ml ) 
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 years ago

    deleted by creator

    • C0MPL3X4 ( C0MPL3X4@programming.dev ) 
      link
      fedilink
      arrow-up
      29
      ·
      2 years ago

      It’s about writing the code, not execution time. Otherwise Assembly wouldn’t take 7 years…

      • jjjalljs ( jjjalljs@ttrpg.network ) 
        link
        fedilink
        arrow-up
        5
        ·
        2 years ago

        Some languages are just worse to work with. like JavaScript. Console.log is like sure I’ll log your object but I’ll tell you what it is now, not what it was when you logged it.

        • Skull giver ( skullgiver@popplesburger.hilciferous.nl ) 
          link
          fedilink
          arrow-up
          5
          ·
          edit-2
          2 years ago

          deleted by creator

          • Ephera ( Ephera@lemmy.ml ) 
            link
            fedilink
            arrow-up
            2
            ·
            2 years ago

            I’d just like to highlight what you mention below: Logging it as an object allows you to inspect it in the browser console, presumably with some JSON tree representation, rather than just a dumb string.

            It’s described in the “Outputting a single object” example here: https://developer.mozilla.org/en-US/docs/Web/API/console#examples

          • jjjalljs ( jjjalljs@ttrpg.network ) 
            link
            fedilink
            arrow-up
            2
            ·
            2 years ago

            I’ve never had a complaint about logging stuff in python. It generally does what I expect.

            “Create a copy of your object and print that” is what I ended up doing, but I don’t think most people would say that’s intuitive. I expect if i print something at a particular time, I get what it is at that point in time.

            • Skull giver ( skullgiver@popplesburger.hilciferous.nl ) 
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              2 years ago

              deleted by creator

  • BeigeAgenda ( BeigeAgenda@lemmy.ca ) 
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    And 42 seconds in jython.

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 41 users / week
  • 337 users / month
  • 1.81K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.3K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) 
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code