SDF Chatter
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
lysdexic@programming.dev to Programming@programming.devEnglish · 2 years ago

Push Ifs Up And Fors Down

matklad.github.io

external-link
message-square
22
fedilink
  • cross-posted to:
  • hackernews@lemmy.bestiver.se
  • hackernews@lemmy.smeargle.fans
  • hackernews@derp.foo
49
external-link

Push Ifs Up And Fors Down

matklad.github.io

lysdexic@programming.dev to Programming@programming.devEnglish · 2 years ago
message-square
22
fedilink
  • cross-posted to:
  • hackernews@lemmy.bestiver.se
  • hackernews@lemmy.smeargle.fans
  • hackernews@derp.foo
A short note on two related rules of thumb.
  • lysdexic@programming.devOP
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    8
    ·
    2 years ago

    My advice: use descriptive variable names.

    The article is really not about naming conventions.

    • Sheldan@programming.dev
      link
      fedilink
      arrow-up
      14
      ·
      2 years ago

      Should have still used them. It was harder to read this way.

      • potterman28wxcv@beehaw.org
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Agreed that some people can find it easier with explicit names - however some people find it easier with short meaningless names as it makes them focus on the abstraction rather than the naming. There is no right or wrong here. It all depends on the reader.

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

        I even thought that this (hardness) was intended to emphasize the way it’s hard to spot problems in real codebase 😅

      • lysdexic@programming.devOP
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        11
        ·
        2 years ago

        Should have still used them. It was harder to read this way.

        The blog author is literally using de-facto standard for placeholder names.

        • https://en.wikipedia.org/wiki/Foobar
        • https://www.techopedia.com/definition/27996/frobnicate

        The var names used by the author are perfectly fine. They don’t cause any issue, nor do they make things hard to read.

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

      Doesn’t matter, it’s hard to read an article. If it were hard to read for another reason like bad grammar, I’d comment on that too 🤷

Programming@programming.dev

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

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Visibility: Public
globe

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

  • 215 users / day
  • 1.92K users / week
  • 3.47K users / month
  • 7.6K users / 6 months
  • 311 local subscribers
  • 20.4K subscribers
  • 2.25K Posts
  • 35.5K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • MaungaHikoi@lemmy.nz
  • UlrikHD@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org