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

Look at the way he writes for loops too smh

lemmy.world

message-square
39
link
fedilink
1

Look at the way he writes for loops too smh

lemmy.world

baatliwala@lemmy.world to Programmer Humor@programming.dev · 24 days ago
message-square
39
link
fedilink
alert-triangle
You must log in or # to comment.
  • ranzispa@mander.xyz
    link
    fedilink
    arrow-up
    0
    ·
    24 days 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.

  • fleem@piefed.zeromedia.vip
    link
    fedilink
    English
    arrow-up
    0
    ·
    23 days 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
      ·
      23 days ago

  • vala@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    23 days ago

    He uses lua

    • vocornflakes@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      23 days 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
    ·
    24 days ago

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

    • Retail4068@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago


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

      arrays start at (offset) zero

      i.e.: *(array + i)

    • Cargon@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago

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

      • lime!@feddit.nu
        link
        fedilink
        arrow-up
        0
        ·
        23 days ago

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

        • Cargon@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          23 days ago

          I am agreeing with your distinction between indices and offsets.

          • lime!@feddit.nu
            link
            fedilink
            arrow-up
            0
            ·
            23 days ago

            in a very agressive way. hence coffee.

  • PantaloonMonsoon@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    23 days ago

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

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

        That should be a war crime.

        • ChickenLadyLovesLife@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          23 days ago

          From the river to the C

  • Lysergid@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    24 days ago

    TF is this formatting

    • Jumuta@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago

      c for smartphones

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

        just zoom out and go closer to the screen

        • Jankatarch@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          24 days ago

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

          • egrets@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            24 days ago

            This is C#, isn’t it?

            • Jankatarch@lemmy.world
              link
              fedilink
              arrow-up
              0
              ·
              24 days ago

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

    • lime!@feddit.nu
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago

      that’s linux kernel code style

    • Quibblekrust@thelemmy.club
      link
      fedilink
      English
      arrow-up
      0
      ·
      21 days ago

      Semicolons belong at the end of lines. No exceptions.

  • Codpiece@feddit.uk
    link
    fedilink
    arrow-up
    0
    ·
    24 days ago

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

  • vrek@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    24 days 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.

    • atopi@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      23 days 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
        ·
        22 days 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
          ·
          20 days 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

    • Venator@lemmy.nz
      link
      fedilink
      arrow-up
      0
      ·
      24 days 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.

    • AirBreather@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago

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

      • Sickday@kbin.earth
        link
        fedilink
        arrow-up
        0
        ·
        24 days ago

        It’s K.Dotnet

    • baatliwala@lemmy.worldOP
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago

      You’re taking a shitpost too seriously mate

  • mexicancartel@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    24 days ago

    Haha i use fortran

  • Fizz@lemmy.nz
    link
    fedilink
    arrow-up
    0
    ·
    24 days ago

    Drake asks github copilot to make a for loop for him

    • dditty@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      24 days ago

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

      • atomic@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        24 days ago

      • Bakkoda@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        23 days ago

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

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.

  • 48 users / day
  • 368 users / week
  • 1.3K users / month
  • 2.03K users / 6 months
  • 0 local subscribers
  • 31.4K subscribers
  • 403 Posts
  • 4.8K 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