|
Sapozhnik posted:c++: where the most obvious answer to every question is always wrong ive got some stuff going in rust, it just isn't grabbing me atm so i moved over to c++ as suicide is too painful
|
# ? May 17, 2017 01:17 |
|
|
# ? Jun 6, 2024 05:58 |
|
There's no crying in C++. Template errors aren't actually hard if you're literate and can look at line numbers. And acclimate a bit.
|
# ? May 17, 2017 02:18 |
|
Thank you guys, Im gonna check those books out!
|
# ? May 17, 2017 02:53 |
|
Sapozhnik posted:c++: where the most obvious answer to every question is always wrong
|
# ? May 17, 2017 04:10 |
|
other obvious, and usually correct answers to C++ quandries: - "it helps the compiler generate fast code" - "because memory is an array of bytes" it's bad that modern c++ pushes you into template poo poo from the first day because C++ wihtout templates is p. straightforward to learn Gazpacho fucked around with this message at 04:29 on May 17, 2017 |
# ? May 17, 2017 04:27 |
|
rust is a bazillion times better and if you're writing greenfield c++ ityool 2017 you are loving up bad
|
# ? May 17, 2017 04:39 |
|
Bloody posted:rust is a bazillion times better and if you're writing greenfield c++ ityool 2017 you are loving up bad
|
# ? May 17, 2017 04:49 |
|
i'm finding work so ... no, not loving up
|
# ? May 17, 2017 04:50 |
|
i mean some ppl have to suck dick for money or write php doing c++? could be worse i guess
|
# ? May 17, 2017 05:01 |
|
Bloody posted:rust is a bazillion times better and if you're writing greenfield c++ ityool 2017 you are loving up bad I think I'd rather write C99 than greenfield C++.
|
# ? May 17, 2017 05:07 |
|
ulmont posted:I think I'd rather write C99 than greenfield C++. same but C11 is a thing now and newer = better than
|
# ? May 17, 2017 06:22 |
|
Bloody posted:same but C11 is a thing now and newer = better than lmao
|
# ? May 17, 2017 06:24 |
|
most of the deep problems of c++, like unsafe pointers and manual memory management, are there in c. c is a simpler language, so those problems are more obvious in your code, but that simplicity also means you can't really do anything about them, so they stay obvious in your code. c++ gives you the basic tools to try to fix most of those problems, and they actually compose pretty nicely, but there are holes in the model that you just have to individually learn about and internalize how to avoid. once you've done that, which is annoying but not actually all that difficult especially if you have any experience with those problems from c, c++ is just massively superior in almost every way except compile time. it is painful to write even a moderately complex program in c because the language gives you almost no tools for abstraction or encapsulation, so either everything turns into a giant unmaintainable mess or you start writing your own opaque type system with bespoke idioms for namespacing and initialization and destruction and memory management, all of which of course has to be manually enforced, and then you start taking the next logical step and wrapping more stuff in macros and you've lost all of that theoretical simplicity and obviousness and certainly all sense of perspective and when any of it blows up you're instantly elbows-deep in the debugger which can't even give you a meaningful line number because of all your macros but by god at least you're not one of those filthy c++ programmers who are happily writing well-abstracted value types with constructors and destructors and methods and private state, because dontcha know it's all bullshit because the language will just let you return a reference to a local variable without even a warning (because you've turned off all the warnings, you're a c programmer goddamnit) and how would you ever know that that's a problem anyway rust is basically c++ with weird syntax except it makes everything unsafe a hard compiler error. but it still strongly pushes you towards c/c++-like idioms like "it's totally safe to return an interior pointer here because i know the outer memory is still valid" except that it forces you to prove that that's true at compile time which you can only do by repeatedly ritually impaling yourself on the dull blade of the borrow checker until you have mastered the sacred precepts of the nine-fold nested lifetimes
|
# ? May 17, 2017 08:05 |
|
eh... lifetimes are easy e: more accuratly: theyre straightforward
|
# ? May 17, 2017 08:44 |
even C++ experts get confused about the syntax
|
|
# ? May 17, 2017 10:15 |
|
why doesn't C have namespaces, that would be cool
|
# ? May 17, 2017 12:59 |
|
rt4 posted:why doesn't C have namespaces, that would be cool because the simple and stable abi is one of the things which is keeping c relevant
|
# ? May 17, 2017 13:26 |
|
c has namespaces. just prepend every symbol with _______MY_BUTT____NAMESPACE__
|
# ? May 17, 2017 13:47 |
|
if that clashes, add more underscores
|
# ? May 17, 2017 13:47 |
|
Rust is c++ without 30 years of baggage. It's not visionary imo, in the space of non-vm langs. in the last few years of new langs what's it competing with? Go, and D?
|
# ? May 17, 2017 13:53 |
|
i thought rust was a game about swinging dongers
|
# ? May 17, 2017 14:09 |
|
Berious posted:i thought rust was a game about swinging dongers under patriarchy, everything is about swinging dongers
|
# ? May 17, 2017 14:24 |
|
just went to download vs2017 and lol they no longer support iso installations, if you want to do an offline installation you have to do a bunch of dumb poo poo including installing a lot of certificates lmao https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio-in-offline-environment gj microsoft
|
# ? May 17, 2017 14:32 |
|
Every struct type in C is a namespace
|
# ? May 17, 2017 16:38 |
|
gonadic io posted:Rust is c++ without 30 years of baggage. It's not visionary imo, in the space of non-vm langs. in the last few years of new langs what's it competing with? Go, and D? is D that new? and does literally anybody use it?
|
# ? May 17, 2017 16:41 |
|
rjmccall posted:most of the deep problems of c++, like unsafe pointers and manual memory management, are there in c. c is a simpler language, so those problems are more obvious in your code, but that simplicity also means you can't really do anything about them, so they stay obvious in your code. c++ gives you the basic tools to try to fix most of those problems, and they actually compose pretty nicely, but there are holes in the model that you just have to individually learn about and internalize how to avoid. once you've done that, which is annoying but not actually all that difficult especially if you have any experience with those problems from c, c++ is just massively superior in almost every way except compile time. it is painful to write even a moderately complex program in c because the language gives you almost no tools for abstraction or encapsulation, so either everything turns into a giant unmaintainable mess or you start writing your own opaque type system with bespoke idioms for namespacing and initialization and destruction and memory management, all of which of course has to be manually enforced, and then you start taking the next logical step and wrapping more stuff in macros and you've lost all of that theoretical simplicity and obviousness and certainly all sense of perspective and when any of it blows up you're instantly elbows-deep in the debugger which can't even give you a meaningful line number because of all your macros but by god at least you're not one of those filthy c++ programmers who are happily writing well-abstracted value types with constructors and destructors and methods and private state, because dontcha know it's all bullshit because the language will just let you return a reference to a local variable without even a warning (because you've turned off all the warnings, you're a c programmer goddamnit) and how would you ever know that that's a problem maybe it's different inside apple idk, i haven't come across any major open source c projects that abuse preprocessor macros to that extent. and who the hell writes production c code with warnings turned off? c++'s bullshit does not mesh well at all, it is the next most godawfully misdesigned language next to php. it's one long bloody trail of badly thought out ideas and unforseen interactions between them whose consequences were hastily worked around only to create even more consequences to be worked around. i'd much rather have a bunch of error handling boilerplate in plain old c than have to deal with manual memory management and exceptions in the same language.
|
# ? May 17, 2017 16:43 |
|
Bloody posted:is D that new? and does literally anybody use it? D is about 20 years old iirc, and no
|
# ? May 17, 2017 16:49 |
|
Gazpacho posted:Every struct type in C is a namespace every pair of curly braces in C is a namespace
|
# ? May 17, 2017 16:51 |
|
Berious posted:i thought rust was a game about swinging dongers over 1% of posts on /r/rust are about the game (whose subreddit is /r/playrust)
|
# ? May 17, 2017 16:52 |
|
Bloody posted:is D that new? and does literally anybody use it? idk i'm just spitballing here.
|
# ? May 17, 2017 16:53 |
|
no one uses d, it doesn't compete with anything go competes with c++ for 50% of what c++ does, the other 50% remains c/c++ territory pretty sure rust is just a troll of c++ folks, not that I've written a line of it
|
# ? May 17, 2017 16:55 |
|
nothing can troll c++ folks more than c++
|
# ? May 17, 2017 17:00 |
|
rjmccall posted:most of the deep problems of c++, like unsafe pointers and manual memory management, are there in c. c is a simpler language, so those problems are more obvious in your code, but that simplicity also means you can't really do anything about them, so they stay obvious in your code. c++ gives you the basic tools to try to fix most of those problems, and they actually compose pretty nicely, but there are holes in the model that you just have to individually learn about and internalize how to avoid. once you've done that, which is annoying but not actually all that difficult especially if you have any experience with those problems from c, c++ is just massively superior in almost every way except compile time. it is painful to write even a moderately complex program in c because the language gives you almost no tools for abstraction or encapsulation, so either everything turns into a giant unmaintainable mess or you start writing your own opaque type system with bespoke idioms for namespacing and initialization and destruction and memory management, all of which of course has to be manually enforced, and then you start taking the next logical step and wrapping more stuff in macros and you've lost all of that theoretical simplicity and obviousness and certainly all sense of perspective and when any of it blows up you're instantly elbows-deep in the debugger which can't even give you a meaningful line number because of all your macros but by god at least you're not one of those filthy c++ programmers who are happily writing well-abstracted value types with constructors and destructors and methods and private state, because dontcha know it's all bullshit because the language will just let you return a reference to a local variable without even a warning (because you've turned off all the warnings, you're a c programmer goddamnit) and how would you ever know that that's a problem This expresses my frustration with C programmers much better than I've ever been able to. I swear, if I hear from C programmer one more time combination of "its beautifully simple language", "well you can hide that in macros" and "It took me the entire day in debugger to find the bug"
|
# ? May 17, 2017 17:01 |
|
For my own purposes I've found C + Python to be a better option than C++, but I know some applications call for all-native code. I've watched Rust and it looks okay, but I haven't had an opportunity to use it in anger yet. The thing that annoys me about C++ besides the compile times and the landmines in the language design is the difficulty of controlling ABIs, symbol visibility, and linking. like, C++ programmers are still doing "pImpl"s right? I don't know that anything has changed that would removed that bullshit. But I've successfully avoided having to do C++ for the last 10 years, so who knows!
|
# ? May 17, 2017 17:34 |
|
crazypenguin posted:But I've successfully avoided having to do C++ for the last 10 years, so who knows! same, it's really cool e: to clarify, i used to do c++. i no longer do c++. also it's more like seven years clean and off the crack but hey, close enough
|
# ? May 17, 2017 17:39 |
|
crazypenguin posted:C + Python i'm but a programming child compared to many of you, but i've recently gone down this path and its pretty fuckin' fantastic so far
|
# ? May 17, 2017 17:40 |
|
BiohazrD posted:just went to download vs2017 and lol they no longer support iso installations, if you want to do an offline installation you have to do a bunch of dumb poo poo including installing a lot of certificates lmao you are doing an offline install which means you wont be able to get those certificates from the internet which is how it normally happens
|
# ? May 17, 2017 17:46 |
|
crazypenguin posted:For my own purposes I've found C + Python to be a better option than C++, but I know some applications call for all-native code. if you want a stable abi in c++, yeah, you have to do pImpl-like stuff. this is also true in c, you can't expose a struct definition in c and expect to maintain binary stability. it's a pretty simple set of rules to follow in both languages, if you're changing types or function signatures in your public headers you're probably in trouble ofc that's a feature that most languages either don't provide at all or have similar problems with, like even with a jit in java you can change the fields of a class but you certainly can't change any method signatures
|
# ? May 17, 2017 17:51 |
|
rjmccall posted:if you want a stable abi in c++, yeah, you have to do pImpl-like stuff. this is also true in c, you can't expose a struct definition in c and expect to maintain binary stability. I suppose that's mostly true. When you put it this way, I guess maybe "shared_ptr" is actually a change that kinda obsoletes pImpl, by encouraging people do do things the C-style "just use a pointer" way instead of wanting a old-style C++ "let's pretend this is allocated on the stack to get automatic memory management, but really it's just a pImpl." I've long since forgotten the rules about how vtables get laid out, though. (Probably implementation defined.) ABI compat is still a huge pain because of that. Sure in Java you can't change the method signature, but you can freely add new methods! Has anything improved that situation?
|
# ? May 17, 2017 18:04 |
|
|
# ? Jun 6, 2024 05:58 |
|
Shaggar posted:you are doing an offline install which means you wont be able to get those certificates from the internet which is how it normally happens and the automated certificate installer can't be supplied from a folder because? that link gives a non-answer.
|
# ? May 17, 2017 18:08 |