|
C is perfectly balanced for smug superiority. It being terrible is actually a great thing if you know it extremely well and can avoid the gotchas while looking down on the poor fools shooting their own feet constantly. It being terrible keeps you employed for life and gives you the status of being a respected expert. Thank goodness it's terrible! C++ is truly the ultimate successor to C when you think about it that way lol
|
# ? Mar 1, 2022 20:12 |
|
|
# ? May 17, 2024 14:20 |
|
As a professional C++ programmer, I have a lot of criticisms of the language, but the idea that it doesn’t effectively address any of the problems of C is pretty silly. You don’t get hard static guarantees, so yes, you can still write a one-liner that completely subverts the language. Nonetheless, if you use the basic tools the language gives you (destructors for resource management, lambdas for scoping), you can make large classes of bugs much harder to introduce by accident. That is valuable even if it’s imperfect.
|
# ? Mar 1, 2022 20:40 |
|
I'd agree that disciplined, consistent use of a subset of C++ is safe, and maybe inherently safer than "conventional" C or C++. It's also true that disciplined, consistent use of C with modern APIs can also be done safely. There's a tradeoff in the overall complexity of the language (and perhaps the assembly generated by the compiler) and programmer convenience. Both of those statements stand in contrast to something like Rust, for which safety was a fundamental point of design.
|
# ? Mar 1, 2022 20:46 |
|
Spatial posted:Simply do not make mistakes. A great strategy except that it never ever works and will never work. The C language cannot fail, it can only be failed.
|
# ? Mar 1, 2022 21:11 |
|
C/C++ are great when people know what they are doing ergo we are doomed.
|
# ? Mar 1, 2022 22:24 |
|
I am partial to “you need a testing team, but it should be rare for bugs to slip past your dev teams automated testing”
|
# ? Mar 2, 2022 02:16 |
|
Quickly followed by a hearty chuckle from all on the call and back to throwing in more scope by cutting dev time spent on automated tests.
|
# ? Mar 2, 2022 02:34 |
|
16 years and I've never worked on a project with automated testing beyond "run the game in attract mode overnight and fix the crash tomorrow"
|
# ? Mar 2, 2022 06:21 |
|
Tei posted:These are outside the toolbox. You are going to build whatever using the tools inside the toolbox and undefined behaviors are whatever. You simply stay away from them. If you code depend on a undefined behavior, your code is kind of crap, even if your binary works. I can never tell whether you are trolling or not.
|
# ? Mar 2, 2022 15:13 |
|
Xarn posted:I can never tell whether you are trolling or not. I have bad opinions
|
# ? Mar 2, 2022 17:55 |
|
rjmccall posted:As a professional C++ programmer, I have a lot of criticisms of the language, but the idea that it doesn’t effectively address any of the problems of C is pretty silly. You don’t get hard static guarantees, so yes, you can still write a one-liner that completely subverts the language. Nonetheless, if you use the basic tools the language gives you (destructors for resource management, lambdas for scoping), you can make large classes of bugs much harder to introduce by accident. That is valuable even if it’s imperfect. Yep. I am more confident in C++ than C that once my code compiles, it will run. But, debugging C is piss-easy compared to C++. I've ripped out the C++ parts of compilation units and replaced the code with plain C in the quest to find bugs or performance issues.
|
# ? Mar 2, 2022 20:39 |
|
more falafel please posted:16 years and I've never worked on a project with automated testing beyond "run the game in attract mode overnight and fix the crash tomorrow" Lol, well, I have seen what I would call a good test suite once or twice and also a few adequate ones. Then there is the vast wasteland.
|
# ? Mar 3, 2022 00:19 |
|
The classic logic applies here:quote:Some people, when confronted with a problem, think "I know, I'll use automated testing." Now they have two problems.
|
# ? Mar 3, 2022 00:38 |
|
smackfu posted:The classic logic applies here: Yeah but at least they understand one of them.
|
# ? Mar 3, 2022 00:47 |
|
Good testing is possible and I hope you don't give up on trying to attain it.
|
# ? Mar 3, 2022 01:30 |
|
60 minutes into "the kubernetes cluster is broken - our app works fine", I ask to look at their codecode:
LET ME TELL YOU WHY, MY GOOD BITCH
|
# ? Mar 3, 2022 05:39 |
|
more falafel please posted:16 years and I've never worked on a project with automated testing beyond "run the game in attract mode overnight and fix the crash tomorrow" This sounds like game dev, though, unless maybe possibly if you're writing the engine and plan to keep it around for a few years.
|
# ? Mar 3, 2022 07:25 |
|
Volmarias posted:This sounds like game dev, though, unless maybe possibly if you're writing the engine and plan to keep it around for a few years. As someone whose worked in service games for most of my career, I can confirm. The thinking is emblematic of the older boxed game model, where code bases were often thrown away after the game launched. Games can absolutely be put under test. I know because I've done it and seen it done. Unfortunately, the state of QA in the industry means this work isn't generally valued highly. Successful games today have lifespans of a decade or more. They're effectively indistinguishable from a tech startup. The only reason some people in games think games can't be tested is because they don't exert any effort trying to or learning how to write code that's easy to test.
|
# ? Mar 3, 2022 11:36 |
|
Junkiebev posted:"Our logs don't show any errors" There isn't a court that wouldn't convict.
|
# ? Mar 3, 2022 12:37 |
|
Junkiebev posted:60 minutes into "the kubernetes cluster is broken - our app works fine", I ask to look at their code You're putting one over on us right? I want to believe
|
# ? Mar 3, 2022 13:27 |
|
If I make my logging unreachable then the app will never have errors. Genius.
|
# ? Mar 3, 2022 14:10 |
|
They didn't even see a stack overflow?
|
# ? Mar 3, 2022 14:28 |
|
NihilCredo posted:They didn't even see a stack overflow? They did, and they tried googling to find out what that meant, but they just found a bunch of friendly explanations on how to implement fizzbuzz.
|
# ? Mar 3, 2022 14:41 |
|
NihilCredo posted:They didn't even see a stack overflow? I am not seeing the error I expect ergo it is an infrastructure problem.
|
# ? Mar 3, 2022 14:55 |
Ticket resolved: Add ∞ memory to target machine to avoid stack overflow error
|
|
# ? Mar 3, 2022 15:06 |
|
Ola posted:They did, and they tried googling to find out what that meant, but they just found a bunch of friendly explanations on how to implement fizzbuzz. FizzBuzzEE once again shows the community its importance and value
|
# ? Mar 3, 2022 19:19 |
|
FizzBuzz.ai
|
# ? Mar 3, 2022 19:23 |
|
Bongo Bill posted:Good testing is possible and I hope you don't give up on trying to attain it. This. Also, learn to love encapsulation and stateless functions if you want to get the most out of testing.
|
# ? Mar 4, 2022 02:13 |
|
Polio Vax Scene posted:Ticket resolved: Add ∞ memory to target machine to avoid stack overflow error This reminds me of a bad technical sales call I had once for web hosting product. The prospect said "whaddya mean it doesn't have unlimited disk space? Isn't this an enterprise offering??"
|
# ? Mar 4, 2022 02:19 |
|
Junkiebev posted:60 minutes into "the kubernetes cluster is broken - our app works fine", I ask to look at their code That reminds me of an internal software that I had to manage in my first job (a long time ago), and as I was reading it I realized that the programmer was learning to code while he wrote it. The software had ten distinct steps, and in each step he was slowly getting better and better with errors. Like in step 1 he didn’t know that mysql_query() could fail. In step 2 he’d check mysql_error(), but literally ignore it. In step 3, he’d echo the error to the screen, but would just continue to the next step. In step 4 he’d check for an error, and if one happened he’d just try again, and this time he wouldn’t check for an error. Frankly it was a work of art. I wish I’d preserved it.
|
# ? Mar 4, 2022 04:15 |
|
wolfman101 posted:This. Also, learn to love encapsulation and stateless functions if you want to get the most out of testing. Stateless is the way. I don't understand why every classroom I ever attended tried teaching me object oriented.
|
# ? Mar 4, 2022 09:05 |
|
rjmccall posted:As a professional C++ programmer, I have a lot of criticisms of the language, but the idea that it doesn’t effectively address any of the problems of C is pretty silly. You don’t get hard static guarantees, so yes, you can still write a one-liner that completely subverts the language. Nonetheless, if you use the basic tools the language gives you (destructors for resource management, lambdas for scoping), you can make large classes of bugs much harder to introduce by accident. That is valuable even if it’s imperfect. Also as a more and more frequently intoxicated professional C++ programmer, destructors and RAII are overrated. Just write your free immediately after you write your malloc, you lazy poo poo. Only being semi-ironic here. Memory management just really isn’t that hard. I’m increasingly of the opinion that the C problems C++ does address just aren’t worth the other bullshit it brings to to the table. Also, my recent experiences have turned me off of lambdas completely. Debugging them multiple levels deep is a massive rear end-ache. TBF, the codebase I’ve been working in for the past year is a huge pile of poo poo, which has soured me on C++ even more, though I was already turning against it before.
|
# ? Mar 4, 2022 10:46 |
|
Nolgthorn posted:Stateless is the way. I don't understand why every classroom I ever attended tried teaching me object oriented. Because those who write the class plans are not following industry trends or are just stuck in their ways. For example when I was at College in the UK (optional equivalent to US Highschool) doing a general IT/Programming course one of the lecturers would only teach COBOL. He was told to teach web applications as his current lesson plan wasn’t keeping up with the world so he just wrote a new lesson plan that was COBOL for web applications… and was promptly fired.
|
# ? Mar 4, 2022 14:06 |
|
wolfman101 posted:This. Also, learn to love encapsulation and stateless functions if you want to get the most out of testing. Most of the testing that people complain about is automated integration testing and I don’t know how stateless applies there.
|
# ? Mar 4, 2022 14:11 |
|
chglcu posted:Also as a more and more frequently intoxicated professional C++ programmer, destructors and RAII are overrated. Just write your free immediately after you write your malloc, you lazy poo poo. Only being semi-ironic here. Memory management just really isn’t that hard. I’m increasingly of the opinion that the C problems C++ does address just aren’t worth the other bullshit it brings to to the table. memory management in c++ only gets hard if you go whole hog in on the oop bullshit. 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.
|
# ? Mar 4, 2022 17:19 |
|
Bruegels Fuckbooks posted:memory management in c++ only gets hard if you go whole hog in on the oop bullshit. 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. How is reference counting "oop bullshit"? I realize the definition is somewhat nebulous but oop doesn't mean "thing I dislike".
|
# ? Mar 4, 2022 17:40 |
|
chglcu posted:Memory management just really isn’t that hard. I’m increasingly of the opinion that the C problems C++ does address just aren’t worth the other bullshit it brings to to the table. 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.
|
# ? Mar 4, 2022 17:43 |
|
pokeyman posted:How is reference counting "oop bullshit"? I realize the definition is somewhat nebulous but oop doesn't mean "thing I dislike". 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.
|
# ? Mar 4, 2022 17:45 |
|
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. 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 17:47 |
|
|
# ? May 17, 2024 14:20 |
|
Just lol if valgrind isn't part of your CI/CD. Double lol if you don't have CI/CD
|
# ? Mar 4, 2022 17:56 |