Details
-
AboutI have opinions programming languages
-
Skillsi can make some really nice V60 pour over
-
LocationSchnitzel
Joined devRant on 6/16/2020
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
C++ has a long way to go I believe but I get that it's annoying for him to see "C/C++" everywhere, as he calls it an "imaginary language".
The problem is that many C++ codebases also include C parts. I mean, it is the biggest advantage, you can start introducing C++ into an existing C codebase and start using a proper language (yes I'm on shitting on C here) bit by bit.
But many devs, especially the "old school" ones still don't understand the core basics of C++. They never heard of RAII, despite using it with e.g. lock_guard.
Like the amount of times I've seen a malloc for an array in a codebase that was written with C++11 available, or one colleague who wrote it in the same function with vectors, maps, etc. is just insane to me.
If you know C++ decently well it's a good language to write well defined, safe code. Many people just don't, and well it's very easy to get into that magic undefined behavior area imo. -
people have been taking this way too personal and emotional like holy shit who cares
-
@jestdotty I think Pulsar was the successor to Atom, though I never tried it.
I think I'll give it a shot, and maybe try lapce again. Even though it'll be difficult to get either of these on the corporate pc. -
@ViRaS just... basic things not working anymore
I open the settings menu, it's blank. Not even buttons visible.
I open the extensions tab, it takes about 3 minutes to actually show the extensions that are installed.
The extensions that need 3 more minutes to install, if it works at all.
And I think all of these problems don't exist in a "normal" environment. But I'm using the remote development on a machine that doesn't have internet access, and for some reason that just seems to break things... -
Lapce can't hit 1.0 soon enough for me
-
@AlgoRythm yeah its gnu specific, though I think clang has something with a similar name
__FUNCTION__ is standard, though I think it stems from C and is only the functions name, not the return type, class, namespace, template arguments, etc -
@Lensflare not sure if it's undefined, but it is definetly weird
https://godbolt.org/z/nra1Gv8oY -
@lorentz oh I have a good one too: do you want schroedingers polymorphism? Then just implement the public virtual functions as private and see what happens!
-
@lorentz can't say I read about it but it has happened to me.
Once got a bug report of our system crashing during its shutdown (which should be clean, with exit code 0 and all). After broot forcing a whole bunch I added a check during the shutdown to see if the shared_ptr we're resetting is actually at refcount 1 when we do. Turns out, in some very rare cases, another thread had a weak_ptr locked to a shared_ptr and kept one particular component alive (and then destroyed it, in the worker thread).
Of course this shouldn't crash the application. In fact it shouldn't have happened to begin with, the thread really should be joined properly. But that particular project's software structure is a mess and that's just what I gotta deal with.
We now use this refcount check to see if we're joining all threads and everything correctly. Oh also we have circular dependencies between components :) -
the worst part about this is that the compiler won't give a shit about it, even if it can directly detect this.
Edit: clang-tidy has a warning for that, might be interesting (https://clang.llvm.org/extra/...) -
Getting lifetimes right in C++ in an application where you have all sorts of different states and components being brought up and shut down (i.e. entire windows) is very tricky.
And weak_ptr doesn't solve it imo. It can prevent leaks but it might also extend your lifetime of your object in some other thread, which can directly change your behavior... -
Any USB WiFi nic will work okay
An actual WiFi PCI card would be better but honestly a complete waste. If you want a good connection you go wired not wireless. -
I never set one up and I've only barely used one and yeah it feels just... off
Its like team speak 3, the ui is of a certain era and just didn't age that well. -
I am cringe but I am free.
-
@IHateForALiving it wasn't that bad... it was more like
param.randomLimitLower = 0;
param.randomLimitUpper = 360;
param.randomEnabled = true;
...
...
...
EXPECT_GT(result[0], 0);
like, we could've seen this coming to be fair -
@Lensflare oh those are also fun
we tend to test the snychronous components on their own. Multithreaded stuff get dedicated, very complex tests. Everything that isn't strictly part of the multithreaded functionality is done through dependency injection, so that in unit tests we can test the actual threading and so on.
In one test, one of the dependecies I injected had a mutex in there so that I could lock that mutex from the test to "pause" my worker. Using an atomic counter around that I could check to wait until the worker was exactly where I wanted it to be. -
Oh the algorithm had random input from 0..360
But the rest checked if the output was >0 at given points
Well this was simple, I feared for the worst (undefined behavior) -
most people in management don't either, yet they will parade it around
-
Pray that one of the mods awaken from their slumber and yeet these bots off of the platform
-
Can you do us all a favor and jump off a sky scraper? Thanks in advance
-
@chaosesqueteam kys
-
Be the change you want to see in the world
-
@chaosesqueteam who the fuck even are you
-
@black-kite nope... A windows domain controller and small lab network I have the honor of maintaining
-
Reminds me of this
I feel like some people have completely twisted priorities in code reviews
https://morling.dev/blog/... -
I'm absolutely used to the layout so I don't really see any problems with it (and I write mostly C++)
Though I do know some German devs who use other layouts mainly because of programming. One of em even uses Dvorak but I feel like that's a different rabbit hole... -
wait that is actually a useful feature why did I never know about this?!
-
@retoor do you mean that specifically for that library?
-
@b2plane I would expect to have an async version of that send function, so you could make your sendSocketIOMessage async as well.
But I don't know that library, I just expect IO to be asynchronous in general. -
from what I understand you want to send read acknowledgements to all other clients?
Either way, if you wanna send something to every client, you're gonna have to loop over all of them in some way or another.
What I think could improve this performance wise is making this async. I suspect all of this is network based so most of the runtime of sendEvent will be spent waiting on IO.
I guess you could also process let's say 8 or so of these async operations at the same time.
But I don't know if that would make any better, I would suggest to do some measurements.