lonestar-lemmy
  • 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
21
link
fedilink
27

I like Python def

lemmy.world

hypertown@lemmy.world to Programmer Humor@lemmy.ml · 2 years ago
message-square
21
link
fedilink
alert-triangle
You must log in or register to comment.
  • the_beber@lemm.ee
    link
    fedilink
    arrow-up
    5
    ·
    2 years ago

    How about some fun?

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

      How about some fn instead?

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

        these puns are getting funcy

      • MultipleAnimals@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        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

        • 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
            ·
            1 year ago

            Exactly, now we are talking

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

          p a f fn(){}

    • sbv@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      fun is the punchable face of keywords. I don’t know why, but I hate it.

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

      How about some (defun)?

  • boletus@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    2 years ago

    Python is fine as a language I guess

    But python programmers give it a bad name. I’ve never seen “well written” python code, it’s always shit that’s been thrown together cos it works.

    • MrBlueSkies@feddit.uk
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      It badly needs strong typing. And braces.

      • boletus@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        I think python is good as it is for what it can do, mostly because I have no reason to use it.

        What we need is lua with types!

        • Shush@reddthat.com
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Have you heard of Typescript-to-lua? I used to do Dota modding (which is in lua) with TSTL and it works great!

          You write TS code (using Typescript syntax that includes types) and it is compiled into lua.

          Wonder if that could be an alternative that can work for you.

      • Anahkiasen@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        Doesn’t Python 3 have types? I’ve seen a few well typed codebases and it really made the code much easier to understand. Or is it just that it’s not checking them strongly enough?

        • kaesaecracker@leminal.space
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 years ago

          The type annotations are just fancy comments. They do not do anything at runtime. If you have a function that takes an int someone can still pass in a list or anything else.

          • boletus@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            The main advantage of typing for me is static linting.

      • funkless_eck@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        just put int_ or str_ in front of your variables

        problem solved 😌

  • Reinsch@feddit.de
    link
    fedilink
    arrow-up
    2
    ·
    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
      1
      ·
      2 years ago

      How very dare you share my opinion!

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

    Who doesn’t use arrow functions?

    • marwwin@suppo.fi
      link
      fedilink
      arrow-up
      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.

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.

  • 271 users / day
  • 680 users / week
  • 1.73K users / month
  • 10.4K users / 6 months
  • 3 local subscribers
  • 35.6K subscribers
  • 1.68K Posts
  • 35.1K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org