programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programmer Humor · 1 year ago

Unused variables

sh.itjust.works

message-square
52
link
fedilink
888

Unused variables

sh.itjust.works

Sjmarf@sh.itjust.works to Programmer Humor · 1 year ago
message-square
52
link
fedilink
  • sik0fewl@lemmy.ca
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    1 year ago

    This is why I always write my methods from bottom to top. This way I’ve always got a return statement and I use my variables before they are even declared.

    • NightAuthor@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      For a second there I thought you might be serious

      • ShouldIHaveFun@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        I do actually use variables before I declare them most of the time. IDEs make it so easy to then generate the declaration with the correct type.

        • NightAuthor@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          That’s true, in fact I’ve started doing that myself. Same with methods, instead of going and writing the method and then coming back to use it, I’ll write the invocation first.

    • N0tTheBees@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Ah an avid dreambird user I see

    • bitcrafter
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Spotted the INTERCAL programmer.

Programmer Humor

programmer_humor

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: [email protected]

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.

  • 917 users / day
  • 4.8K users / week
  • 8.97K users / month
  • 18K users / 6 months
  • 2.39K local subscribers
  • 23.2K subscribers
  • 1.37K Posts
  • 51.7K Comments
  • Modlog
  • mods:
  • adr1an
  • Feyter
  • BurningTurtle
  • Pierre-Yves Lapersonne
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org