Lemmy LIETUVA
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
baatliwala@lemmy.world to Programmer Humor@programming.dev · 2 months ago

Look at the way he writes for loops too smh

lemmy.world

message-square
40
link
fedilink
1

Look at the way he writes for loops too smh

lemmy.world

baatliwala@lemmy.world to Programmer Humor@programming.dev · 2 months ago
message-square
40
link
fedilink
alert-triangle
You must log in or # to comment.
  • mexicancartel@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    Haha i use fortran

  • PantaloonMonsoon@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    This is why he told Drake he better never go to cell block 1 instead of cell block 0.

  • vala@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    He uses lua

    • vocornflakes@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Oh but Lua is so much worse than that. Table keys (array is not a thing in Lua) can be whatever you want. Especially even negative, and not like how python does it. 1 is just the convention.

  • lime!@feddit.nu
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    arrays start at (offset) zero. lists start at (position) one. fight me.

    • Cargon@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Only edge lords still mentally stuck in CS101 conflate indices and offsets.

      • lime!@feddit.nu
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        good morning to you too. remember to have your coffee before going on the internet.

        • Cargon@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          I am agreeing with your distinction between indices and offsets.

          • lime!@feddit.nu
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            in a very agressive way. hence coffee.

    • Don't forget to stay hydrated.🍉🍉🍉🍉🍉@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      arrays start at (offset) zero

      i.e.: *(array + i)

    • Retail4068@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago


  • JohnAnthony@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    2 months 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
      0
      ·
      2 months 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
        0
        ·
        2 months ago

        That should be a war crime.

        • ChickenLadyLovesLife@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          From the river to the C

  • Rain World: Slugcat Game@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    28 days ago

    kendrick lamar reportedly lua

  • Lysergid@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    TF is this formatting

    • Jumuta@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      c for smartphones

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        just zoom out and go closer to the screen

        • Jankatarch@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          I read it as if they are calling java “C for smartphones” instead lmao.

          • egrets@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            This is C#, isn’t it?

            • Jankatarch@lemmy.world
              link
              fedilink
              arrow-up
              0
              ·
              2 months ago

              Oh shit, it is. Didn’t notice the “.Length”

    • lime!@feddit.nu
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      that’s linux kernel code style

    • Quibblekrust@thelemmy.club
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Semicolons belong at the end of lines. No exceptions.

  • Codpiece@feddit.uk
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    What’s worse, starting at 1 or using AI to write it for you?

  • vrek@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago
    1. I never mock those who are trying to learn.

    2. Why is he starting with c/c++? Yes they have uses but not as a starter just playing around.

    3. I struggled with this initially too cause I didn’t understand why. Most people would say “give me the first object”. In reality your requesting an offset * size of each item + list start.

    • AirBreather@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      This sure looks like C# to me, not C/C++

      • Sickday@kbin.earth
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        It’s K.Dotnet

    • baatliwala@lemmy.worldOP
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      You’re taking a shitpost too seriously mate

    • Venator@lemmy.nz
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago
      1. Why is he starting with c/c++? Yes they have uses but not as a starter just playing around.

      sometimes it’s not interesting enough to keep someone’s attention if it’s just “playing around”: some people need to feel like what they’re working on while learning has a real purpose, and some purposes have to use C++ (e.g. Arduino)

      sure it might not be the most effective or efficient way to learn, but it can be more motivating.

    • atopi@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      is c++ not a common language to be taught as the first? Its not that hard to learn the basics of

      • vrek@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Kinda but especially with extremely new, either python or Javascript is recommended. If they are absolutely new, scratch.

        • atopi@piefed.blahaj.zone
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          i have seen arguments against learning python as a first language (when my countries government suggested replacing c++ with python in school)

          i may have just had a bad first experience with JavaScript; i wouldnt let a child new to coding anywhere near that language

  • fleem@piefed.zeromedia.vip
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I am so much more down for the memes about fictionalised genius of famous people, where we end up learning a little something

    as opposed to the fictional CEO of sex, especially when its in the vein of some stupid FPS from 2012

    yay

    • FEIN@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

  • Fizz@lemmy.nz
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Drake asks github copilot to make a for loop for him

    • dditty@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Drake is too busy trying to clean up his work with child processes

      • atomic@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

      • Bakkoda@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Sat through a presentation at GodotCon yesterday and one of of the speakers said " and then you just execute all the children"

  • ranzispa@mander.xyz
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Clearly Kendrick Lamar started programming in the 70s in Fortran, had a small flirt with MATLAB and ended up using Julia in the end.

    I didn’t know he was so strong in scientific computing.

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.

  • 28 users / day
  • 145 users / week
  • 779 users / month
  • 2.77K users / 6 months
  • 0 local subscribers
  • 32.1K subscribers
  • 629 Posts
  • 8.09K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org