Lemmy | Lama Corp.
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
baatliwala@lemmy.world to Programmer Humor@programming.dev · 1 month ago

Look at the way he writes for loops too smh

lemmy.world

message-square
40
link
fedilink
442

Look at the way he writes for loops too smh

lemmy.world

baatliwala@lemmy.world to Programmer Humor@programming.dev · 1 month ago
message-square
40
link
fedilink
  • JohnAnthony@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    7
    ·
    1 month ago

    Beginner mistake, which is perfectly fine! Just use i-1 inside the loop and i <= values.Length as the condition.

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 month ago

      My favorite:

      for (int i = myArray.Length; i --> 0; )
      {
          //do something
      }
      

      Perfectly valid in C-style, even if it does look a bit puzzling at first.

      • Gumus@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        ·
        1 month ago

        That should be a war crime.

        • ChickenLadyLovesLife@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 month ago

          From the river to the C

Programmer Humor@programming.dev

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

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.

  • 2.27K users / day
  • 4.87K users / week
  • 8.6K users / month
  • 17.9K users / 6 months
  • 1 local subscriber
  • 31.6K subscribers
  • 1.8K Posts
  • 51.4K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.18
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org