tucson.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
hypertown@lemmy.world to Programmer Humor@lemmy.ml · 2 years ago

I like Python def

lemmy.world

message-square
37
link
fedilink
470

I like Python def

lemmy.world

hypertown@lemmy.world to Programmer Humor@lemmy.ml · 2 years ago
message-square
37
link
fedilink
alert-triangle
You must log in or register to comment.
  • Reinsch@feddit.de
    link
    fedilink
    arrow-up
    73
    ·
    2 years ago

    Ewww default exports. Explicit named exports are better! And so it begins

    • 👍Maximum Derek👍@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      16
      ·
      2 years ago

      How very dare you share my opinion!

    • ShortFuse@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      edit-2
      2 years ago

      PascalCase default exports for Classes

      camelCase named exports for functions

      ALL_CAPS named exports for constants

  • the_beber@lemm.ee
    link
    fedilink
    arrow-up
    36
    arrow-down
    1
    ·
    2 years ago

    How about some fun?

    • Andrew@mander.xyz
      link
      fedilink
      arrow-up
      29
      ·
      2 years ago

      How about some fn instead?

      • MultipleAnimals@sopuli.xyz
        link
        fedilink
        arrow-up
        13
        ·
        edit-2
        2 years ago
        pub async fn foo() -> Pin>>>>>
        

        oh fuck commonmark cant display the syntax :( well anyone who has done async rust can imagine

        • flashgnash@lemm.ee
          link
          fedilink
          arrow-up
          5
          ·
          2 years ago

          p a f fn(){}

        • AVincentInSpace@pawb.social
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          2 years ago

          Pin<Box<dyn Future<Output=Result<AsyncResponseThatYouWillHaveToAwaitAgain<ActualResultType>, InscrutableErrorTypeThatDoesntImplementDisplay>> + Send + Sync + 'static + 20MillionMoreAutoTraits>>

          • MultipleAnimals@sopuli.xyz
            link
            fedilink
            arrow-up
            2
            ·
            2 years ago

            Exactly, now we are talking

      • Xylight (Photon dev)@lemmy.xylight.dev
        link
        fedilink
        English
        arrow-up
        10
        ·
        2 years ago

        these puns are getting funcy

      • ______@lemm.ee
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Chef’s kiss 👌

      • LufyCZ@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 years ago

        So much better

    • autokludge@programming.dev
      link
      fedilink
      English
      arrow-up
      9
      ·
      2 years ago

      How about some (defun)?

    • macniel@feddit.de
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      Kotlin?

      • the_beber@lemm.ee
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Yes

    • mvirts@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      deleted by creator

  • redcalcium@lemmy.institute
    link
    fedilink
    arrow-up
    13
    ·
    2 years ago

    When the grey beards wake up they’re going to be fuming

  • HStone32@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    int main() {}

    Seriously. why isn’t there any C love around here?

  • The Gay Tramp@lemmy.ca
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    8
    ·
    2 years ago

    Who doesn’t use arrow functions?

    • marwwin@suppo.fi
      link
      fedilink
      arrow-up
      28
      arrow-down
      1
      ·
      2 years ago

      Arrow functions should be used only for callbacks. I hate that people has started defining named functions with arrow functions in JS. Arrow functions are not hoisted and the ordering of your functions is going to get wonky, because you need to define all you functions first before composing them, when it should be the other way around. Start with the most high-level function which calls lower level functions.

      • Paradoxvoid@aussie.zone
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        1
        ·
        2 years ago

        I had this exact fight with my team several months ago, and lost to popular opinion since the rest of my team are either zoomers or indifferent.

        • JonEFive@midwest.social
          link
          fedilink
          arrow-up
          3
          ·
          2 years ago

          I’ve reached the point that I cringe at the mention of arrow functions because so many people seem to always want to use arrow functions.

          Like I’m looking up something on stack overflow and half the answers are arrow functions that are that way for no other reason than to use the fun little =>

    • Cargon@lemmy.ml
      link
      fedilink
      arrow-up
      16
      arrow-down
      1
      ·
      2 years ago
      sum(your_mom &lt;- rep(69, 420))
      
      • pivot_root@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        R?

      • JonEFive@midwest.social
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        NaN

        your_mom is undefined

        • Cargon@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          It’s being assigned and passed to sum at the same time. One of the many entertaining quirks of R.

  • Argonne@lemmy.world
    link
    fedilink
    arrow-up
    19
    arrow-down
    48
    ·
    2 years ago

    Python sucks ass. Try Go if you don’t like Java

    • AVincentInSpace@pawb.social
      link
      fedilink
      arrow-up
      31
      arrow-down
      3
      ·
      2 years ago

      That’s a nice argument, Senator. Care to back it up with a source?

      • pivot_root@lemmy.world
        link
        fedilink
        arrow-up
        14
        arrow-down
        4
        ·
        2 years ago

        Source: Global Interpreter Lock

        • pingveno@lemmy.ml
          link
          fedilink
          English
          arrow-up
          13
          ·
          2 years ago

          Much less of a big deal for most applications. For the applications that need it in some areas, use PyO3 to write a module in Rust. Of course, Python’s not going to be the perfect tool for every job, and that’s okay.

          • tryptaminev 🇵🇸 🇺🇦 🇪🇺@feddit.de
            link
            fedilink
            arrow-up
            8
            ·
            2 years ago

            Nooo if a proframming language is not the best choice for every job it is worthless and all the programmers using it are heathens!

            Except of course for the language i prefer because i am one of the few to not go insane doing application xy in it.

        • vext01@lemmy.sdf.org
          link
          fedilink
          arrow-up
          7
          ·
          2 years ago

          GIL is awful for parallelism, but lots of problems don’t require threads.

        • TheHarpyEagle@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          2 years ago

          GIL-less is coming

          • pivot_root@lemmy.world
            link
            fedilink
            arrow-up
            6
            ·
            2 years ago

            Well, I’ll be damned. Are you sure I’m still alive? Is Hell still hot? Pigs don’t have feathers yet, right?

      • rothaine@lemm.ee
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        pipenv venv virtualenv pyenv poetry

        Spin the wheel

    • vext01@lemmy.sdf.org
      link
      fedilink
      arrow-up
      14
      ·
      2 years ago

      Depends what you are working on.

      Like all languages, they all have pros and cons.

      Language evangelism doesn’t help really…

    • RagingRobot@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      2 years ago

      Having worked on all 3 of those I prefer python. I think C# is a much better Java alternative though. But it would depend on the project of course. Something like Python of JavaScript is nice for faster development. That’s my jam lol.

      As for it sucking ass. Idk about that but it may be a cool feature to try out

    • ripcord@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      \

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.

  • 95 users / day
  • 940 users / week
  • 3.03K users / month
  • 9.33K users / 6 months
  • 2 local subscribers
  • 37K subscribers
  • 1.76K Posts
  • 32.3K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org