Principal Engineer for Accumulate

  • 0 Posts
  • 116 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle



  • I almost never create a tarball, so I have to look up the syntax for that. Which is as simple as man tar. But as far as extracting it almost couldn’t be easier, tar xf <tarball> and call it a day. Or if you want to list the contents without extracting, tar tf <tarball>. Unless you’re using an ancient version of tar, it will detect and handle whatever compression format you’re using without you having to remember if you need z or J or whatever.




  • Ethan@programming.devtoProgrammer Humor@programming.devRelatable
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    1 month ago

    I didn’t say never copy and paste. I’m saying when you push a commit you should understand what all the LOC in that commit do (not counting vendored dependencies). If you don’t understand how something works, like crypto (not sure what Hamilton or Euler refers to in this context), ideally you would use a library. If you can’t, you should still understand the code sufficiently well to be able to explain how it implements the underlying algorithm. For example if you’re writing a CRC function you should be able to explain how your function implements the CRC operations, even if you don’t have a clue why those operations work.


  • Ethan@programming.devtoProgrammer Humor@programming.devRelatable
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    1 month ago

    I said you need to understand what the code you wrote (as in, LOC that git blame will blame on you) does. Not that you need to fully understand what the code it calls does. It should be pretty obvious from context that I’m referring to copy-pasting code from stack overflow or an LLM or whatever without knowing what it does.





  • Ethan@programming.devtoProgrammer Humor@programming.devRelatable
    link
    fedilink
    English
    arrow-up
    30
    arrow-down
    5
    ·
    edit-2
    1 month ago

    If you’re adding code you don’t understand to a production system you should be fired

    Edit: I assumed it was obvious from context that I’m referring to copy-pasting code from stack overflow or an LLM or whatever without knowing what it does but apparently that needs to be said explicitly.





  • Ethan@programming.devtoProgrammer Humor@lemmy.mlLabels go brrrr
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    1 month ago

    nasm is an assembler though, not a ‘languages’

    That’s like saying “clang is a compiler though, not a language”. It’s correct but completely beside the point. Unless you’re writing a compiler, “cross platform assembler” is kind of an insane thing to ask for. If want to learn low level programming, pick a platform. If you are trying to write a cross-platform program in assembly, WHY!? Unless you’re writing a compiler. But even then, in this day and age using a cross-platform assembler is still kind of an insane way to approach that problem; take a lesson from decades of progress and do what LLVM did: use an intermediate representation.


  • I’ve genuinely never had a problem with it. If something is wrong, it was always going to be wrong.

    Have you worked on a production code base with more than a few thousands of lines of code? A bug is always going to be a bug, but 99% of the time it’s far harder to answer “how is this bug triggered” than it is to actually fix the bug. How the bug is triggered is extremely important.

    Why is it preferable to have to write a bunch of bolierplate than just deal with the stacktrace when you do encounter a type error?

    If you don’t validate types you can easily run into a situation where you write a value to a variable with the wrong type, and then some later event retrieves that value and tries to act on it and throws an exception. Now you have a stack trace for the event handler, but the actual bug is in the code that set the variable and thus is not in your stack trace. Maybe the stack trace is enough that you can figure out which variable caused the problem, and maybe it’s obvious where that variable was set, but that can become very difficult very fast in a moderately complex application. Obviously you should write tests, but tests will never catch every weird thing a program might do especially when a human is involved. When you’re working on a moderately large and complex project that needs to have any degree of reliability, catching errors as early as possible is always better.