kuuhana
  • Communities
  • Multi-communities
  • Support Lemmy
  • Search
  • Login
  • Sign Up
Programmer Humor@programming.devbyLike A Duck@programming.dev
3 years

if else if else if else

programming.dev

Crosspost: https://lemmy.ml/post/488358

24
    You must log in or register to comment.

    • nobug-404@geddit.social
      3 years

      case

        • Hauskrampf@ttrpg.network
          3 years

          switch case

          https://assets.tripplite.com/large-image/srcase6u-other01-l.jpg

        • glibg10b@lemmy.ml
          3 years

          You could’ve used an actual switch but you chose a USB hub instead

            • abclop99@beehaw.org
              3 years

              Image of a toggle switch

            • lemmyng@beehaw.org
              3 years

              I think the foreach one should have been recursion.

                • DeriHunter@lemmy.world
                  3 years

                  Nope recursion would be a bigger cable connected to same cable only smaller, connected to the same cable only smaller, etc…

                  If this is how your recursion looks like you have a problem and you need to rethink your recursion step and and stop condition :)

                    • MagicShel@programming.dev
                      3 years

                      I disagree. Recursion is the same thing over and over again until the exit condition. Nothing is getting smaller except the remaining entries.

                        • Kogasa@programming.dev
                          3 years

                          That’s just “recurrence.” The same as a “while” loop. Recursion is specifically when a procedure invokes itself.

                            • MagicShel@programming.dev
                              3 years

                              Fair enough. Point is nothing is getting smaller except the call stack.

                                • Kogasa@programming.dev
                                  3 years

                                  The thing that’s getting smaller is the “complexity” or “distance from the trivial case” of the function invocation. This is an informal notion though.

                              • DeriHunter@lemmy.world
                                3 years

                                Of course it does, I suggest you go read about recursion. Here’s a link: https://www.cs.odu.edu/~toida/nerzic/content/recursive_alg/rec_alg.html

                                Good luck

                                  • Kogasa@programming.dev
                                    3 years

                                    There’s no formal reason why the input to a recursive function must be a “smaller” or “simpler” version of itself, that’s just a way of explaining it intuitively/informally. You need to reduce the “complexity” (meant informally as ‘deviation from a trivial case’) at every step (only) if you want to the algorithm to actually finish.

                                    • MagicShel@programming.dev
                                      3 years

                                      I’ve been writing code for 35 years and professionally for 25. I’m plenty familiar with it.

                                        • DeriHunter@lemmy.world
                                          3 years

                                          And still you get it wrong. I just linked you an academic article about it, fml. Never got people who are to proud to admit they are wrong.

                                            • jlar@lemmy.world
                                              3 years

                                              What the flip did you just freaking say about my code, you little script kiddie? I’ll have you know I’ve been writing code for 35 years and I’ve used recursion on several occasions, and I have over 300 confirmed successful deployments. I am trained in twelve different programming languages and I’m the top coder in the entire Stack Overflow leaderboard. You are nothing to me but just another code review. I will debug you the flip out with precision the likes of which has never been seen before on this GitHub, mark my freaking words. You think you can get away with saying that crap to me over the Internet? Think again, scripter. As we speak I am contacting my secret network of tech support across the globe and your IP is being traced right now so you better prepare for the DDoS, maggot. The storm that wipes out the pathetic little thing you call your Python script. You’re freaking terminated, kid. I can be anywhere, anytime, and I can refactor your code in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in machine learning, but I have access to the entire arsenal of Google Cloud Services and I will use it to its full extent to wipe your miserable code off the face of the repository, you little wannabe. If only you could have known what unholy retribution your little ‘clever’ comment was about to bring down upon you, maybe you would have held your tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn rookie. I will rain code all over you and you will drown in it. You’re freaking done, kiddo.

                                              • MagicShel@programming.dev
                                                3 years

                                                Point is I know how it works. Maybe you want to argue the analogy, but that doesn’t mean I don’t understand recursion. I’ve used it on several occasions.

                                    • darcy@sh.itjust.works
                                      3 years

                                      now do function and return

                                      • twotenth@lemmy.ml
                                        3 years

                                        Need one for loop unrolled

                                        • Sagrotan@lemmy.world
                                          3 years

                                          TIL my life is a logic trap…

                                          • Drew Belloc@programming.dev
                                            3 years

                                            While true is how i store my usb extension

                                            • nobug-404@geddit.social
                                              3 years

                                              Case

                                              Programmer Humor@programming.dev

                                              programmer_humor@programming.dev

                                              Subscribe from remote instance

                                              Create post

                                              Report community

                                              Modlog
                                              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
                                                • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
                                              Visibility: Public

                                              This community is visible to everyone.

                                              • 2.09K users / Day
                                              • 3.63K users / Week
                                              • 8.02K users / Month
                                              • 12.2K users / 6 months
                                              • 2.63K posts
                                              • 98.5K comments
                                              • 2 local subscribers
                                              • 34.4K subscribers
                                              • UI: 1.0.0-beta.0
                                              • BE: 1.0.0-alpha.20
                                              • Modlog
                                              • Instances
                                              • Docs
                                              • Code
                                              • join-lemmy.org