Amethyst Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
ElCanut@jlai.lu to Programmer Humor@programming.dev · 6 months ago

Different philosophies

jlai.lu

message-square
25
link
fedilink
13

Different philosophies

jlai.lu

ElCanut@jlai.lu to Programmer Humor@programming.dev · 6 months ago
message-square
25
link
fedilink
alert-triangle
You must log in or # to comment.
  • samus12345@lemm.ee
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    6 months ago

    You know, I always wondered what the original image looked like, and even trusty Know Your Meme doesn’t show it. It looked like this:

  • Kushan@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    6 months ago

    Rust is completely correct to be a dick about it as well. Type safety is there for a reason.

  • HexesofVexes@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    6 months ago

    It works and is a pile of jank - Python

    It doesn’t work and is a pile of jank - C++

    You violated gods laws with how bad your code is and it still runs (right through the wall) - C

  • TomasEkeli@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    6 months ago

    a compile-time error is highly preferable to a run-time error

  • DannyBoy@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 months ago

    You wouldn’t typecast a car.

    • qarbone@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 months ago

      I may be on the wrong side of history but I can’t see what other role a car could get in the film industry except vehicle.

    • mogranja@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      What about typecasting to a car?

  • Diplomjodler@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    6 months ago

    For our American friends: the Opel Corsa is a car.

    • mindbleach@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      Debatable.

    • plunged_ewe@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      For the Brits, it’s a Vauxhall Corsa.

      • Ⓜ3️⃣3️⃣ 🌌@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        6 months ago

        For everyone : it’s a sh’tbox (never again)

  • Limonene@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    6 months ago

    C when I cast a char * * to a char * * const: ok

    C when I cast a char * * to a char * const *: ok

    C when I cast a char * * to a char const * *: WTF

    C when I cast a char * * to a char const * const *: ok

    • xep@fedia.io
      link
      fedilink
      arrow-up
      2
      ·
      6 months ago

      The WTF case isn’t allowed because it would allow modification of the const. From https://en.cppreference.com/w/cpp/language/implicit_conversion

      int main() { const char c = ‘c’; char* pc; char** ppc = &pc; const char** pcc = ppc; // Error: not the same as cv-unqualified char**, no implicit conversion. *pcc = &c; *pc = ‘C’; // If the erroneous assignment above is allowed, the const object “c” may be modified. }

    • SaharaMaleikuhm@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      Please stop, I have CPTSD.

  • neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 months ago

    Perl when I iterate over an object and treat the result as a hash reference: “fine, whatever. Fuck you, tho”

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 months ago

    Hey at least it’s not JavaScript which is perpetually high on crack with Object object

    • mindbleach@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      1 + 1 = “11”.

      • Justas🇱🇹@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        6 months ago

        [] + [] = “”

        • mindbleach@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          6 months ago

          Wat.

    • bleistift2@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 months ago

      Well, that happens when you don’t override the toString method. Not worse than Java’s 0xf00cu

  • UnfortunateShort@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    6 months ago

    In bigger projects, you tend to miss type safety really bad, really fast. Rust has it built in, Python can have it bolted on. That’s simply one of the many aspects to consider when choosing your programming language.

    But don’t worry about it too much. If one thing’s for sure, it’s that you will regret that choice in any case.

  • ℍ𝕂-𝟞𝟝@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 months ago

    You don’t even need to cast in Python, a reference is a reference.

  • KindaABigDyl@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    6 months ago

    And that’s why I don’t use Python for anything more than simple scripts

  • wewbull@feddit.uk
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    6 months ago

    Python doesn’t have casts and is strongly typed.

  • Moc@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    Do we need any more proof Python is superior?

    (I’m ^joking, ^I ^love ^Rust)

Programmer Humor@programming.dev

programmer_humor@programming.dev

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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

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

  • 368 users / day
  • 3.7K users / week
  • 8.9K users / month
  • 19.1K users / 6 months
  • 1 local subscriber
  • 24.7K subscribers
  • 915 Posts
  • 17.6K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org