Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
WackyTabbacy42069 ( WackyTabbacy42069@reddthat.com )  to Asklemmy@lemmy.ml · 3 years ago

What's your favorite programming language and what about it do you like?

message-square
message-square
67
link
fedilink
82
message-square

What's your favorite programming language and what about it do you like?

WackyTabbacy42069 ( WackyTabbacy42069@reddthat.com )  to Asklemmy@lemmy.ml · 3 years ago
message-square
67
link
fedilink
  • cocobean ( cocobean@bookwormstory.social ) 
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 years ago

    I had to use Python for a bit at work and it was confusing

    pipenv, venv, virtualenv, poetry…wtf is all this shit

    a.b vs a['b'] vs a.get('b')…wtf is a KeyError

    • richieadler ( richieadler@lemmy.myserv.one ) 
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 years ago

      What happens in other languages you use when you try to access a non-existing key for a hash/map/dict?

      What language do you use that accessing an object attribute is the same that accessing a dict key?

      What knowledge do you have (or not) that KeyError is a mistery to you?

      • cocobean ( cocobean@bookwormstory.social ) 
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 years ago

        Return undefined.

        Typescript.

        Why error? Just return undefined. Simple, no try/catch needed.

        • richieadler ( richieadler@lemmy.myserv.one ) 
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 years ago

          Because that’s prone to errors. And the Zen of Python includes “explicit is better than implicit” and “Errors should never pass silently”. Languages that do otherwise create bad habits.

          • cocobean ( cocobean@bookwormstory.social ) 
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 years ago

            Is it? It’s just an optional property. And Typescript will tell you that it’s optional.

    • ricecake ( ricecake@lemmy.ml ) deleted by creator
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      3 years ago

      deleted by creator

      • cocobean ( cocobean@bookwormstory.social ) 
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 years ago

        People love to complain about npm and node_modules, but I think they were on to something with the simplicity of it.

Asklemmy@lemmy.ml

asklemmy@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: !asklemmy@lemmy.ml

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it’s welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

  • !lemmy_support@lemmy.ml
  • !fediverse@lemmy.ml
  • !selfhosted@lemmy.world

Looking for a community?

  • Lemmyverse: community search
  • sub.rehab: maps old subreddits to fediverse options, marks official as such
  • !lemmy411@lemmy.ca: a community for finding communities

Icon by @Double_A@discuss.tchncs.de

Visibility: Public
globe

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

  • 1 user / day
  • 2 users / week
  • 3 users / month
  • 3.74K users / 6 months
  • 1.49K local subscribers
  • 55.8K subscribers
  • 6.92K Posts
  • 153K Comments
  • Modlog
  • mods:
  • Evan ( Cloak@lemmy.ml ) 
  • mekhos ( mekhos@lemmy.ml ) 
  • tmpod ( tmpod@lemmy.pt ) 
  • OrangeSlice ( 14specks@lemmy.ml ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code