![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/8140dda6-9512-4297-ac17-d303638c90a6.png)
Permits is only required when the compiler can’t see the extending classes. IE inner classes can extend without needing to be written out in a permits
clause. This isn’t really that useful but I’ve taken advantage of it more than once so who knows
Yo whatup
Permits is only required when the compiler can’t see the extending classes. IE inner classes can extend without needing to be written out in a permits
clause. This isn’t really that useful but I’ve taken advantage of it more than once so who knows
Semantic whitespace is awful because whitespace (something that you can’t actually see) has meaning in how the program runs. Braces {
}
for scopes gives you the ability to easily tell at a glance where a scope ends. Whitespace doesn’t allow for that. Especially, especially when you can accidentally exit a scope (two new lines in a row with Python) and it’s not actually an error (Pythons global scope). Yeah formatters and linters make this less of an issue but it sucks… Languages with legible symbols for scoping are significantly easier to reason about, see end
symbols in Lua.
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.
It erases the type of what your pointing at. All you have is a memory location, in contrast to int*
which is a memory location of an int
Nah bro that’s just the memory leaks, your supposed to force close and reopen it every so often so the OS cleans up after their shitty application
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.
Ah sure, like scripts and stuff. I have some absolutely atrocious python hanging out to help me do shit. I don’t have like any actual projects that are just a trash fire though
I don’t really get the code point. Like your own code written for personal projects is probably gonna be pretty high quality I’d hope? Sometimes we just write trash to get something finished but soon as I’ve had to change it… hell yeah I’m unfucking that mess, no way do I want to figure out what it does a second time.
JetBrains might not be my friend but they don’t hold anywhere near the dev tool monopoly Adobe does for artists. Know what happens if JetBrains starts to blow massive ass? I finally sit down and figure out how to get my terminal editor working with my LSP. Yeah I lose some productivity but not as much as I’d lose by using Visual Studio or fuckn Eclipse.
Thanks for well contributing to Lemmy but you sure are quite the annoying character. Now don’t go and abuse your newfound abilities and remove the blocking feature <3
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
I mean yeah but not anywhere near badly enough to be willing to deal with a phone keyboard…
There’s a couple grifters who pretend (or are stupid enough) to think so yes. It’s like the “doctors” the anti vax guys point at
What Rust provides is statically guaranteed memory safety. Some C++ types will prevent memory issues however the language itself is unsafe. Playing with raw pointers is just as valid as using std::unique_ptr
. In Rust however you must sign a contact (using unsafe
) in order to play with raw pointers. Unsafe is you the programmer promising that you followed the rules. This is like how C++ says it’s illegal to write UB and your program will break (and it’s your fault) but enforced through a special type of block
Yes Rust is harder to write than C, that’s basically by design as it’s due to the statically guaranteed memory safety. That’s pretty magical. C doesn’t have that and neither does C++ even with smart pointers and such. Rusts unsafe keyword is poorly named, what it actually does is tell the compiler that you the programmer guarantee Rusts rules are upheld within the unsafe block.
For example
Access or modify a mutable static variable
That is a global, that’s incredibly hard to impossible to statically prove it’s safely done, so you have to do it in an unsafe block. So you violating Rusts rules within an unsafe block is actually using the unsafe block wrong. That’s not what it’s for
Unsafe Rust really just let’s you play with pointers
This is the entirety of what Unsafe Rust allows
Instance of Vim? Swap buffers fool
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.