Yo whatup

  • 0 Posts
  • 61 Comments
Joined 9 months ago
cake
Cake day: September 28th, 2023

help-circle
  • Yup, libraries should usually let the consumer chose what to do with an error, not crash the program without a choice in the matter. The only real exception is performance critical low level code such as the core of a graphics or audio driver. Though in those cases crashing also often isn’t an option, you just power through and hope things aren’t too screwed up.




  • It’s complicated. Paul isn’t really a good guy, but he’s not really a bad guy either. He’s just a dude. He’s a dude who has limited vision into the future from which he cannot escape. He’s not using his future vision to pick the bad choices he’s trying to pick the best ones he can and the hand he’s dealt kinda just sucks.




  • Smart pointers model ownership. Instead of (maybe) a comment telling you if you have to free/delete a returned pointer this information is encoded into the type itself. But that’s not all, this special type even handles the whole deleting part once it goes away.

    Since they model ownership you should only use them when ownership should be expressed. Namely something that returns a pointer to a newly allocated thing should be a std::unique_ptr because the Callie has ownership of that memory. If they want to share it (multiple ownership of the object) there’s a cheap conversion to std::shared_ptr.

    How about a function that takes in an object cause it wants to look at it? Well that doesn’t have anything to do with ownership so make it a raw pointer, or better yet a reference to avoid nullability.

    What about when you’ve got a member function that wants to return a pointer to some memory the object owns? You guessed it baby raw pointer (or again reference if it’ll never be null).


  • Um what? I didn’t like hide extra meaning in what I said. High quality code doesn’t imply all that extra shit you added. It’s code that’s easy to read and modify. Typically this just means you name stuff well and document things that aren’t obvious. Usually my docs explain why something exists since thinking it’s unnecessary cause you don’t remember what the original problem was a common occurrence before I started doing so.

    Is high quality code ran through a formatter? I’d hope so yeah. There should be a consistent code style across the entire project. Doesn’t matter what it it long as it’s consistent.

    100% code coverage is meaningless and as such a pointless metric. Also 100% coverage is explicitly tied to the implimentaion as all code paths have to be reached which is obviously not a good idea (tests have to change when the implimentaion changes as you’re testing the implimentaion not the api).

    Really a lot of this is just meaningless buzz words as an attempt at some sort of gotcha. Really don’t understand how you even interpreted a statement so simple in this way.






  • Traister101@lemmy.todaytoMemes@lemmy.mlYes, but
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    ReVanced is a modded YouTube (and others) app. IE normal YouTube but you fuck with it locally to skirt what got the original Vanced guys. Adblock, OLED black theme same old thing Vanced provided. I’ve used NewPipe very little but I’d summerise a comparison as ReVanced has better user experience (thanks to Google making the app) and you can sign in/get notifications ect




  • Traister101@lemmy.todaytoProgrammer Humor@programming.devwait what
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    4 months ago

    Looking at code on somebody else’s screen is entirely missing the point of using tabs over spaces. The entire point is that mine looks like how I want and theirs looks like how they want even though the file is identical. We can each have wildly different tab width and it’ll look wildly different to each of us when we program. That’s again the point.

    Code formatters are great! I love them. Using tabs over spaces is objectively a better formatting option. One of my favorite features in code formatters is that they’ll swap out spaces to tabs for you insane people who insist on mashing the space bar to indent.


  • Traister101@lemmy.todaytoProgrammer Humor@programming.devwait what
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    4 months ago

    What’s yaml have to do with anything? It’s like python with syntactic whitespace which is unrelated to this discussion. The Tab vs Space debate is entirely around non syntactic whitespace which doesn’t effect how the code is parsed. And yes Python technically does both tabs and spaces but it’s all sorts of fucky.

    Terminal editors while still used a ton aren’t really what I was referring to. Newer terminal editors such as Helix have tab width configured per language most of which default to a width of 4 spaces but toml/yaml both default to 2 spaces. I was mainly referring to GUI editors as frankly that’s just what most people use nowadays. JetBrains IDEs, Visual Studio, Eclipse, VS Code, Notepad++ were primarily what I was thinking of as I’ve used all of them and they all default to a tab width of 4 hence why I said nearly universal. Also I said nearly terminal editors being the only editors I’ve used that don’t default to a width of 4 seems like a fair usage of the term.


  • Traister101@lemmy.todaytoProgrammer Humor@programming.devwait what
    link
    fedilink
    arrow-up
    7
    arrow-down
    2
    ·
    4 months ago

    Then don’t? The whole reason nearly all the spaces guys do 4 spaces is cause that’s the nearly universal tab width. You won’t like this but the same exact argument can be made for spaces yet I’d bet you haven’t even once configured the width of those.

    I don’t actually change tab width, it’s the default 4 spaces equivalent for me but just because I don’t take advantage of the ability doesn’t mean I should prevent others from doing so.



  • Traister101@lemmy.todaytoProgrammer Humor@programming.devwait what
    link
    fedilink
    arrow-up
    102
    arrow-down
    10
    ·
    4 months ago

    Tabs are objectively the better choice as it allows each dev individually to decide tab width in their editors. Spaces in contrast don’t allow this same flexibility as they are used for much more than simply indentation, for example you likely put a space after each argument or operator IE func(arg1, arg2) or 1 + 2.