|
Bruegels Fuckbooks posted:The pattern for shared pointer is "oh wait, this class is owned by multiple other classes, how do I deal with that?" That's OOP as gently caress, storing unnecessary poo poo as members. I'm saying there's a veritable cornucopia of ways to misuse shared pointers, no need to limit yourself to classes.
|
# ? Mar 4, 2022 18:03 |
|
|
# ? May 17, 2024 01:44 |
|
DoomTrainPhD posted:Just lol if valgrind isn't part of your CI/CD. I proudly continuously integrate and continuously deliver bad code.
|
# ? Mar 4, 2022 18:05 |
|
DoomTrainPhD posted:Just lol if valgrind isn't part of your CI/CD. Of course we have CD! We have a cabinet full of burnable discs
|
# ? Mar 4, 2022 18:10 |
|
Bruegels Fuckbooks posted:once you get to the point where reference counting and shared_ptr seem like a good solution for the problem you're having, you've hosed. pretty sure that caring about any of this nerd bullshit is actually negatively correlated with having hosed, op!!!
|
# ? Mar 4, 2022 18:48 |
|
more falafel please posted:You still have to think about it, you just think about it differently. If you use smart pointers wrong, they can still leak, dangle, use-after-free, double-free, etc. There's no strategy for resource management that just means you don't have to think about resource management anymore.
|
# ? Mar 4, 2022 18:53 |
|
Smart pointer often smarter than programmer.
|
# ? Mar 4, 2022 18:54 |
|
Presto posted:I'm a battle-scarred old C programmer, and I will happily take smart pointers, because then the memory gets released automatically and that's one less thing I have to think about. A C programmer who doesn't like memory allocation? What in the world
|
# ? Mar 4, 2022 19:02 |
|
ynohtna posted:Smart pointer often smarter than programmer.
|
# ? Mar 4, 2022 19:10 |
|
Wait, you don't -fsanitize=address everything always?
|
# ? Mar 4, 2022 19:13 |
|
And not working on MSVC has the benefit of being able to use `__attribute__(cleanup)` in C, which is nice.
|
# ? Mar 4, 2022 19:16 |
|
Presto posted:How does one use smart pointers wrong, without deliberately going well out of your way to do it? Multithreading + std::shared_ptr = .
|
# ? Mar 4, 2022 19:29 |
|
Absurd Alhazred posted:Multithreading + std::shared_ptr = .
|
# ? Mar 4, 2022 19:52 |
|
Absurd Alhazred posted:Multithreading + std::shared_ptr = .
|
# ? Mar 4, 2022 21:16 |
|
Presto posted:How does one use smart pointers wrong, without deliberately going well out of your way to do it? Absurd Alhazred posted:Multithreading + std::shared_ptr = . This, also circular references, which are easier to come by than you might think, especially if you're updating existing code to use smart pointers. If you're not going whole Herb Sutter and never using a bare T* anywhere, at some point you're going to have to pass a T* to some other code, that could do something stupid with it. This isn't an anti-smart pointer rant, it's the same rant I've gone on a thousand times that "automatic memory management" is a lie, or at best a massive oversimplification. You aren't managing memory, now you're managing reference counting. There's a lot of situations (maybe even most situations) where that's preferable! Smart pointers are good, actually. But they don't eliminate classes of bugs, they make classes of bugs easier to avoid, and come with a runtime CPU/cache/memory cost. It's almost the core design principle of C++ is to give you as many tools as humanly possible so that you can decide which ones to shoot yourself in the foot with.
|
# ? Mar 4, 2022 22:44 |
BigPaddy posted:COBOL for web applications thread title
|
|
# ? Mar 4, 2022 22:47 |
|
http://www.coboloncogs.org/
|
# ? Mar 4, 2022 22:51 |
|
more falafel please posted:It's almost the core design principle of C++ is to give you as many tools as humanly possible so that you can decide which ones to shoot yourself in the foot with. We're all Bugs Bunny to C++'s Yosemite Sam.
|
# ? Mar 4, 2022 22:51 |
|
I worked for a startup years ago that believed the secret to high quality C/C++ code was using AI to find and fix bugs based on automated test cases. Imagine if you will a codebase with literally hundreds to thousands of test cases necessary to assure the correctness of the codebase without anybody ever running the software. Yet not all is well because for some reason all the developers who created these tests are incapable of fixing bugs that the tests exposed. They may malloc but forget to free memory but fail to understand the error messages that valgrind produces in spite of integrating that into the automated tests. How about we use AI to randomly change the software in hundreds of different ways and then see which ones pass all the test cases? (Hence the need for all the test cases) Developers will clearly love some tool trying to do their jobs and won't call it glorified shotgun debugging. There were minor issues with integrating with everyone's build scripts that I was supposed to fix while our AI expert worked on uh, parsing C source code using neural networks. He figured teaching a network to parse English would be a good start. I'd suggested clang repeatedly but had no success. I'm forgetting a ton but that was a year of my life I'll never get back.
|
# ? Mar 4, 2022 23:47 |
|
That’s a great story. I particularly love the implication that there’s a fountain of sweet cash-out money waiting for anyone who can make a better static analysis and bugfinding tool.
|
# ? Mar 5, 2022 00:22 |
|
The Something Awful Forums > Discussion > Serious Hardware/Software Crap > The Cavern of COBOL > Coding Horrors: parsing C source code using neural networks
|
# ? Mar 5, 2022 00:28 |
|
ultrafilter posted:The Something Awful Forums > Discussion > Serious Hardware/Software Crap > The Cavern of COBOL > Coding Horrors: parsing C source code using neural networks when you think about it, that's what we all do every day
|
# ? Mar 5, 2022 01:38 |
|
smackfu posted:Most of the testing that people complain about is automated integration testing and I don’t know how stateless applies there. Minimize the pain by first minimizing the amount of state, and second by performing the logic on a lower layer than interacting with the database.
|
# ? Mar 5, 2022 05:35 |
|
1337JiveTurkey posted:I worked for a startup years ago that believed the secret to high quality C/C++ code was using AI to find and fix bugs based on automated test cases. Imagine if you will a codebase with literally hundreds to thousands of test cases necessary to assure the correctness of the codebase without anybody ever running the software. Yet not all is well because for some reason all the developers who created these tests are incapable of fixing bugs that the tests exposed. They may malloc but forget to free memory but fail to understand the error messages that valgrind produces in spite of integrating that into the automated tests. wat
|
# ? Mar 5, 2022 15:35 |
|
1337JiveTurkey posted:I worked for a startup years ago that believed the secret to high quality C/C++ code was using AI to find and fix bugs based on automated test cases. Imagine if you will a codebase with literally hundreds to thousands of test cases necessary to assure the correctness of the codebase without anybody ever running the software. Yet not all is well because for some reason all the developers who created these tests are incapable of fixing bugs that the tests exposed. They may malloc but forget to free memory but fail to understand the error messages that valgrind produces in spite of integrating that into the automated tests. Looks like they turned that AI testing stuff and made a product to sell - https://www.functionize.com
|
# ? Mar 5, 2022 16:49 |
|
1337JiveTurkey posted:How about we use AI to randomly change the software in hundreds of different ways and then see which ones pass all the test cases? (Hence the need for all the test cases) this is called mutation testing
|
# ? Mar 5, 2022 16:55 |
|
MarxCarl posted:Looks like they turned that AI testing stuff and made a product to sell - https://www.functionize.com i drink with a couple of software qa managers and i imagine they will be very pissed off when i load this website on my cellphone at the bar and ask them why they're not doing this yet. (yes, i know this product is horseshit, all products aimed at qa test automation are horseshit, it's just fun to watch the light in their eyes die out slowly)
|
# ? Mar 5, 2022 17:43 |
|
Bruegels Fuckbooks posted:i drink with a couple of software qa managers and i imagine they will be very pissed off when i load this website on my cellphone at the bar and ask them why they're not doing this yet. (yes, i know this product is horseshit, all products aimed at qa test automation are horseshit, it's just fun to watch the light in their eyes die out slowly) I'm DevOps, and I found out about this when one of the QA guys was asking me if I knew where he could host it. The answer to that was, your department paid for this, they can get that for you, I went out and found it and just started laughing at it. This is poo poo they sell upper management as, "Hey look anyone can write a test case even you, just point and click, it's good forever, and tests more than a human." It's the same line of poo poo they all say, but now with "AI" and "Machine Learning" tacked on. This is a bunch of sane looking people: https://www.functionize.com/company
|
# ? Mar 5, 2022 17:57 |
|
Absurd Alhazred posted:Multithreading + std::shared_ptr = . And how do you do that? Well, just use strands. Well, one strand to be exact. And allocate 20 threads while your program is essentially single threaded. And then wonder why it's slow.
|
# ? Mar 5, 2022 18:52 |
|
Hammerite posted:this is called mutation testing No, it's sorta the opposite of mutation testing. The goal of mutation testing is to find things not covered by tests by discovering what changes you can make without making any tests fail. They're trying to make changes to the code to make failing tests pass.
|
# ? Mar 5, 2022 19:37 |
|
MarxCarl posted:I'm DevOps, and I found out about this when one of the QA guys was asking me if I knew where he could host it. The answer to that was, your department paid for this, they can get that for you, quote:THEY DON'T BITE At least a few of these people need an asterisk next to that
|
# ? Mar 5, 2022 20:16 |
|
Styling horror from work.
|
# ? Mar 5, 2022 20:20 |
|
Plorkyeran posted:No, it's sorta the opposite of mutation testing. The goal of mutation testing is to find things not covered by tests by discovering what changes you can make without making any tests fail. They're trying to make changes to the code to make failing tests pass. Rereading it you're right. I made the mistake of reading it and applying a charitable interpretation of what was being described.
|
# ? Mar 5, 2022 20:21 |
|
DoomTrainPhD posted:Styling horror from work. Feels like Borat function declarations. Heating, Ventilation, Keep Alive... NOT
|
# ? Mar 5, 2022 20:24 |
|
Plorkyeran posted:No, it's sorta the opposite of mutation testing. The goal of mutation testing is to find things not covered by tests by discovering what changes you can make without making any tests fail. They're trying to make changes to the code to make failing tests pass. Basically teaching the computer how to succumb to confirmation bias.
|
# ? Mar 5, 2022 21:28 |
|
LOOK I AM A TURTLE posted:Basically teaching the computer how to succumb to confirmation bias. New thread title?
|
# ? Mar 5, 2022 22:39 |
|
LOOK I AM A TURTLE posted:Basically teaching the computer how to succumb to confirmation bias. Sounds more like test driven development
|
# ? Mar 5, 2022 22:45 |
|
MarxCarl posted:This is a bunch of sane looking people: https://www.functionize.com/company I'll have some of what Head of Marketing is having.
|
# ? Mar 5, 2022 22:55 |
|
Hammerite posted:Rereading it you're right. I made the mistake of reading it and applying a charitable interpretation of what was being described. I did the exact same thing but reread it before actually posting my reply saying that it's mutation testing.
|
# ? Mar 6, 2022 01:15 |
|
The next step would be to write a tool which automatically generates tests by calling your function, seeing what happens, and asserting that that should happen. Add coverage-guided input generation and bam instant 100% code coverage without all the pesky work needed for things like property testing.
|
# ? Mar 6, 2022 01:21 |
|
|
# ? May 17, 2024 01:44 |
|
Plorkyeran posted:The next step would be to write a tool which automatically generates tests by calling your function, seeing what happens, and asserting that that should happen. Add coverage-guided input generation and bam instant 100% code coverage without all the pesky work needed for things like property testing. While that's probably not what you'd start with on a green field project, yeah that kind of "what happens should happen" is absolutely a good approach if you're working on a legacy system either for a refactor or just maintenance. If it does something different, a test will fail. You get to decide if that's good or bad but at least no changed behavior will slip through without being interrogated.
|
# ? Mar 6, 2022 01:50 |