Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Gollum to Programmer [email protected] • 6 months ago

Another smart move

feddit.org

message-square
115
fedilink
990

Another smart move

feddit.org

Gollum to Programmer [email protected] • 6 months ago
message-square
115
fedilink
  • @[email protected]
    link
    fedilink
    9•6 months ago

    It would screw up existing code but doing [array.length() -1] is pretty stupid.

    • @[email protected]
      link
      fedilink
      4•
      edit-2
      6 months ago

      For i = 0; I < array.length; i++

      • @[email protected]
        link
        fedilink
        6•6 months ago

        i < array.length or else you overflow.

      • @[email protected]
        link
        fedilink
        3•6 months ago

        Casually throws in capitals as well.

        • @[email protected]
          link
          fedilink
          2•6 months ago

          My post is a work of fiction

    • @[email protected]
      link
      fedilink
      3•6 months ago

      A lot of languages have a .last() or negative indexer ([-1]) to get the last item though.

Programmer [email protected]

[email protected]
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
  • 147 users / day
  • 519 users / week
  • 1.51K users / month
  • 4.65K users / 6 months
  • 3 subscribers
  • 1.68K Posts
  • 60.2K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @[email protected]
  • Pierre-Yves Lapersonne
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org