tchncs
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 2 years ago

How NOT TO CODE: Intel's Linux Thunderbolt Utils Code is the WORST I have EVER SEEN!

www.youtube.com

external-link
message-square
16
link
fedilink
57
external-link

How NOT TO CODE: Intel's Linux Thunderbolt Utils Code is the WORST I have EVER SEEN!

www.youtube.com

☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 2 years ago
message-square
16
link
fedilink
#GNU #grep anti patterns that cause #bugs #t2sde #linux #Ads & more @Amazon: https://services.exactcode.de/amzn.cgi?index=electronics&keywords=laptop You can...
alert-triangle
You must log in or # to comment.
  • 5714@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    27
    ·
    2 years ago

    I don’t code, but is hardcoding sudo EVER a reasonable thing in C?

    • const_void@lemmy.ml
      link
      fedilink
      arrow-up
      21
      ·
      2 years ago

      It’s not reasonable in any language

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      14
      arrow-down
      2
      ·
      2 years ago

      it is not

  • roadrunner_ex@lemmy.ca
    link
    fedilink
    English
    arrow-up
    15
    ·
    2 years ago

    Putting aside the “should/shouldn’t do” argument, I was also wondering if the code is even viable. I imagine that ‘ls’ and ‘sudo’ are probably pretty ubiquitous, but I bet there exist some Linux installs out there with a different shell than ‘bash’, and some might not have ‘grep’ too. That would lead to some pretty cryptic bugs for the end user, eh?

    • SteveTech@programming.dev
      link
      fedilink
      English
      arrow-up
      16
      ·
      2 years ago

      I might be wrong, but I believe Debian ships without sudo, only su by default (or at least if you configure a root password in the setup).

      • N0x0n@lemmy.ml
        link
        fedilink
        arrow-up
        11
        ·
        edit-2
        2 years ago

        You’re right ! And I really should get used to how debian works with su.

        But with docker it’s very convenient to add an user in the docker groupe with sudo :/

        • SteveTech@programming.dev
          link
          fedilink
          English
          arrow-up
          6
          ·
          2 years ago

          And I really should get used to how debian works with su.

          I only know because installing sudo is usually the very first thing I do whenever I have to install it haha.

    • const_void@lemmy.ml
      link
      fedilink
      arrow-up
      13
      ·
      2 years ago

      I bet there exist some Linux installs out there with a different shell than ‘bash’,

      100%. Alpine is one such distro.

      • eutampieri@feddit.it
        link
        fedilink
        arrow-up
        7
        ·
        2 years ago

        Also, doas instead of sudo

      • Lunya \ she/it@iusearchlinux.fyi
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        Iirc Void too.

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      8
      arrow-down
      2
      ·
      2 years ago

      That code is a crime against nature and humanity.

    • Nat (she/they)@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      I believe POSIX mandates grep and a shell that should be able to handle everything this code uses, but sudo is a problem

    • MangoPenguin@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Debian doesn’t come with sudo and it’s always annoying running into stuff that has it hardcoded (or just added by default to a command)

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 years ago

    FYI, the Intel code used to be here (https://github.com/intel/thunderbolt-utils) but apparently was archived a week ago. So instead, the video creator posted the fork here: https://github.com/rxrbln/thunderbolt-utils

  • espresso_con_panna@lemmy.ml
    link
    fedilink
    arrow-up
    5
    ·
    2 years ago

    geez I tried my best not to be stereotypical, but…I am a flawed human being and I searched for their linkedin profile, it suddenly all checks out

    • Tartas1995
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      deleted by creator

      • espresso_con_panna@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        I don’t like being cryptic at all, but “free speech” doesn’t always include discriminatory ones. And being flawed, I can’t stop my brain from generating those thoughts, so I just tried to be a slightly friendlier a*hole. Otherwise I could have said: PhD, yeah of course, so many of them are so used to writing shitty code without peer reviews for so long, that totally checks out. And Indian…again. well, no wonder.

        • Tartas1995
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          deleted by creator

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

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: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 76 users / day
  • 861 users / week
  • 1.34K users / month
  • 6.12K users / 6 months
  • 846 local subscribers
  • 40.9K subscribers
  • 1.97K Posts
  • 40.6K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org