Reported by:

Progress on Nekoverse 2.0 :firecat: :marseyfediverse: :marseyneko:

HI losers ive been making this thing and this other thing (but not focused atm) and i'm hoping soemday i'll deploy it to rDrama.cc or something

discuss

@Schizo @BIPOC

picrel is Copebox FE displaying the results of my server's inner workings :marseymerchantsoy: discuss (again)

41
Jump in the discussion.

No email address required.

Man is doing this in C++, I gotta respect

Jump in the discussion.

No email address required.

I wish I had used C or Go or something, but for now I'm writing C-style C++ as a way to cope

Jump in the discussion.

No email address required.

You should really use const references more often bb

Also there's way too many references for this to be "C-style C++". That's a good thing, though, because writing C-style code in C++ is r-slurred even for dramacels.

Jump in the discussion.

No email address required.

I disagree, personally. Worse, it's coming from someone who's been doing this language for a little while...

You should really use const references more often bb

There are cases where I'm not for reasons. In classes, the costs of references can actually be pointless when you just need to move stuff, which is what std::move does, more of a (useless) hint to the compiler to, well, move something and forget about it! Compilers are smart enough to optimize this information, so being an aesthetic neurodivergent C++nile doesn't actually matter to 100% of compilers.

That's why I think mostly believe C++ is really r-slurred;;; compilers are supposed to be doing all the work, not programmers ;-) C++, if anything, makes optimizing code harder on compilers due to all the features and abstractions you can do. The only nice thing C++ ever did was do stuff at compile time for us.

C-style code in C++ is r-slurred even for dramacels.

When you're working with a lot of C libraries, you aren't left with a choice. References are just fancy pointers and its not hard to just not misuse them.

If this was a large project written in a corporation, then yes, I'd use all these smart features and be very liberal about writing my code, but I'm a single developer and I'm very confident in certain parts and not-so-confident in other parts (hence why I just use references in places where it works best)

Jump in the discussion.

No email address required.

In classes, the costs of references can actually be pointless when you just need to move stuff, which is what std::move does, more of a (useless) hint to the compiler to, well, move something and forget about it!

Sure but I meant stuff like this: https://code.nekobit.net/fossil/wormhole/file?name=src/config/config_http.cpp

You're passing the YAML node as non-const reference. Might as well make it const.

As far as the cost of references, they effectively compile down to pointers (unless optimized further), so usually a good choice perf-wise for anything beyond like plain ints. And as far as moving goes, that's only when you want to take ownership of an object - most times you're not doing that so it doesn't apply.

I'm not going to defend C++ further though because it's a generally shit language, for the reasons you mention. And I know it's an absolute meme, but Rust is just an all-around better choice if you're not working off existing code (or don't need a specific C++ library). Unfortunately it's not a real option at my own job since we have a ton of internal libraries in C++ and porting them makes it pretty clearly not worth the effort.

When you're working with a lot of C libraries, you aren't left with a choice. References are just fancy pointers and its not hard to just not misuse them.

True, no way around FFI. I often just write a small RAII wrapper around C library types though, depending on what I'm doing. It's easy and makes it so you can't forget to, for example, uninitialize/destroy an object after you're done with ti.

but I'm a single developer

Yeah, to be clear, you do you. Write it however you want, it's your project and you don't have a boss to appease here.

Jump in the discussion.

No email address required.

You're passing the YAML node as non-const reference. Might as well make it const.

Good catch, yeah i can fix that. I've personally never been a const-correctness neurodivergent, since it's usually abused in worlds of JS and all that, but this is a good case where it clearly implies "never gonna change this!" Having an eye over code is nice so i always appreciate people communicating these kinda things. Personally, this clearly isn't an issues though, and I probably woulda noticed that (or not, so ill do it anyway lole)

I'm not going to defend C++ further though because it's a generally shit language,

I wasn't in no way disagreeing, I like C more, but it's really just a tool that you must use effectively (but that's hard to define!). In reality you can use it however you want, the rest of the sepples world are just stupid neurodivergents who focus on new shit. Might as well use Rust if you want all that safety and soyslop, after going through that phase, you really just want to write code!

I like C++ because it has some of the Soyslop from Rust and Go and all that, but keeps the pure raw "beauty" of C :marseyautism: Best of both worlds

RAII wrapper around C library types though

I used to do that, but it gets tiring after a while when you do it over and over and over, and awfully demotivating. 99% of the time you'll be using a destructor anyway, so writing shitty wrappers over top of that is just a useless use of abstraction. We have cowtools for checking memory management and they work pretty darn well! Use them!!!

PS: You can also just use std::shared_ptr or std::unique_ptr to handle C-style destruction that isn't a delete or free() call! See an example here, never abstract a C type with a stupid fricking class ever again (unless you use it 24/7)

Rust is just an all-around better choice

Rust still needs work IMO, I like to use things that are well developed and specified and well tested, Rust is still in a sorta beta phase with things changing, much like JS and all that is, and in the past... C++ was like this, still is. C++ is still a fricking mess and Rust is superiorely what I would want though, i don't disagree. If i want safety I just abuse the OS for that, Rust code seems to have this general idea that we must do everything ourselves, including memory safety. I try to get as much of that as I can myself.

I still like managing memory manually, cuz its fun neighbor :hapyday:, rust neighbors seem toforget you should have fun, i like digging deep and knowing what im doing without hundreds of abstractions. Rust isn't a perfect world IMO, but i dont disagree there are better applications of what I'm doing. It is 100% a matter of opinion and as obvious, you do you and I'll do me :marseythumbsup:

Jump in the discussion.

No email address required.

I still like managing memory manually

Heh, I think that's really what it comes down to, explains not liking RAII wrappers much as well.

I like C, too. I used to do embedded development, obviously in C. It was nice, but part of that was because I was writing for a RTOS, so the whole system was far less complicated. There wasn't really any built-in dynamic memory management, for example, no malloc()/free(). I wound up writing my own object pool implementation, which was kinda fun.

PS: You can also just use std::shared_ptr or std::unique_ptr to handle C-style destruction that isn't a delete or free() call!

I know :marseyhappytears: IMO the better smart pointers are the best thing they've ever added to C++. I basically never write new or delete ever. It all gets handled for me, and if you use them as fields in a class, then the compiler-generated destructor effectively does everything you need, so you more or less never have to write one again.

Jump in the discussion.

No email address required.

100% agree, Smart pointers are the best, nice thing that C++ ever brought us. The rest is garbage. That's why people should appreciate C-style C++ just a little bit, you can send a huge middle finger to the rest, and write whatever the frick you want and use whatever features you want, and cause micro-:marseypopcorntime: and trigger C++ neurodivergents that've never finished a single program of value cuz they jerk off at the language at the same time :marseybeandrool:

Manual memory management isn't a hard chore for me at all, considering I clean my room IRL and i dont mind picking up messes I make :marseywholesome: It is a downside of C's simplicity, but the less options, the less thinking, the more code writing and easier ways to think of abstractions. Ever ask yourself why most Rust :!marseytrain:s are incredibly mentally ill and while Bjarne looks the way he does? :marseynoooticer:

Never said i didn't appreciate RAII btw, a lot of RAII's core is the equivalent of creating a problem (Exceptions) and then solving it (RAII), thus, RAII is useless


Unrelated, but one of my biggest pet peeves of C++ and Rust combined is the insane compilation times. Really, the more in the language, the more to abstract and optimize :marseydepressed:, that's why it takes so long to compile. Compiling is IMO the biggest development staller, and don't even get me going on C++ template errors anyway. I'd rather take a segfault in my butt that I can very quickly debug and maybe even learn than deal with terse compilation errors and std::throws and panics (same thing lmao)

i also use slow butt computers and collect meme hardware as a hobby, so I appreciate those quick compile times mate

Jump in the discussion.

No email address required.

Ever ask yourself why most Rust :marseytrain:s are incredibly mentally ill

tbh I just assumed it was because you need to be neurodivergent, at least to some extent, to actually fully understand all the ins and outs of the borrow checker.

edit:

Unrelated, but one of my biggest pet peeves of C++ and Rust combined is the insane compilation times. Really, the more in the language, the more to abstract and optimize :marseydepressed:, that's why it takes so long to compile.

Rust has definitely been getting better at this over the years, but yeah, they take a while. At work, our build, without any caching, takes around 3-4 hours. One full build. We can only get away with it because of ccache. Still dumb that we need to set something like that up.

Jump in the discussion.

No email address required.

Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.

Jump in the discussion.

No email address required.

should be :marseyrave#: :marseytrans2#:

fr though, I really enjoy deploying Go server-side.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.