19

Fuck C++ I am so done with this garbage

No I do not accept differing opinions

Comments
  • 18
    Prof once told me in school that if I hated C++, I might like Perl. I did not.
  • 1
    @CatFoodParty I just want readable compiler errors, I have been staring at this screen for hours and nothing works for seemingly no reason
  • 15
    @LotsOfCaffeine if you're on GCC, try substituting it with clang. Much more readable errors.
  • 5
    @CatFoodParty your prof made a good joke on you 🤣 if C++ is convoluted mess, Perl is just singularity of convolutionness
  • 1
    What errors? Maybe we can help.
  • 1
    @RememberMe I would have said the complete opposite, but both of them are sometimes unreadable.
  • 1
    A few tips:

    Look for "error" and ignore "note" unless you're trying to find which file included what. That cuts most of the large template-related errors down to a single line.

    As others have mentioned, switch to Clang. Better error messages.

    Turn on coloring if you can (most compilers support this). It helps.

    If you're using a build system, might be helpful to run the single command in question instead of invoking the build system, until you've solved the problem.
  • 1
    I respect your right to agency. 😁
  • 5
    Join the Rust Revolution!
  • 1
    You ever just std::vector<std::vector<int>>;
  • 0
    Rust is not an acceptable answer to C/C++. Sorry.
  • 2
    @Ranchonyx I actually have a
    std::map<std::string, std::vector<std::vector<int>>>
    in prod at the moment.
    Pass that all over a method pointer and you'll realize just how fucked things will get.
  • 0
    Have a piece of peach pie and a grog. :)
  • 0
    int main(){
    std::cout << "C++ says ur bad xD\n";
    }
  • 1
    @Phazor001 << std::endl, not '\n'
  • 0
    @junon ya blame me for that first thing is i started learning on code cademy right now then i come to my rant theme about someone cussing out C++

    i need to work on hello world more :))
  • 0
    @junon why is it endl instead of cout? im using cout and it works fine
  • 1
    @Phazor001

    std::cout << "Hello, world!" << std::endl;
  • 0
    @junon uhhh i think thats a diffrent version of cpp im not using that last part :/ thats not what code cademy teached o_O
  • 1
    @Phazor001 The `std::` in front of it indicates it is standard. Been there since pre-C++11. CodeAcademy is not a good source for C++ by the way. Learn the primer there and then move on to better sources (like a book).

    Putting `\n` in strings intended to go to the standard out/err streams is kind of frowned upon because it makes your code non-portable. On some systems `std::endl` will emit something other than `\n`.
  • 0
    @junon Rip, well i have to learn what i got for now this is school computer. at least i can get the understanding then it will be much more easier to learn that version :P
  • 2
    @Phazor001 "that version" there is no version here, it has existed in every (compliant) compiler for decades now. You should be able to use `std::endl` even in codeacademy.
  • 0
    @junon well it doesnt have that in there it has
    "\n" to end
  • 1
    @junon on the other hand std::endl will flush the output stream every time because on most platforms it's implemented something like a platform specific "\n" and then a std::flush. It's absolute garbage for performance when used inside eg. a loop. I believe there's some additional wonkiness with interactive output devices where endl behaves like \n but I haven't seen it ever break. If you really wanted unbuffered IO for eg. multithreaded error messages you'd probably use cerr instead anyway.

    @Phazor001 I also think it's not a major issue, use whatever code academy does but just keep in mind that it's a *potential* problem.
  • 0
    @RememberMe \n is going to flush anyway... stdout is line buffered by default.
  • 3
    @junon only to interactive devices, I think?.

    Just printed a million numbers, first with endl, then with \n.
  • 1
    @RememberMe Interesting, TIL. Thanks :)
  • 0
    @junon why isn't Rust a viable choice?
  • 3
    @junon @RememberMe
    Just to clarify, point to src:
    std:endl calls flush internally

    Quote:
    00511 * This manipulator is often mistakenly used when a simple newline is
    00512 * desired, leading to poor buffering performance. See
    00513 * http://gcc.gnu.org/onlinedocs/... for more
    00514 * on this subject.

    https://gcc.gnu.org/onlinedocs/...

    Line 516
  • 1
    been programming for almost 11 years. gotta say, never found a reason to pick up C++. and i intend to keep it that way. collect my own garbage? yeeeeh....no thanks.
  • 2
    @codecrow where do you take your garbage irl?
  • 1
    AND MY GOD FUCK THE TOOLING AROUND THIS PIECE OF SHIT LANGUAGE

    OH NO IM SORRY VSCODE HAS TO KILL ITSELF OVER "MISSING HEADER FILES" EVEN THOUGH THE PROJECT BUILDS JUST FINE

    WHEN WILL THIS OVERLY USELESS, CONVOLUTED, INSULT TO GOD PIECE OF SHIT BE REPLACED
    I'VE BEEN IN THIS PROJECT FOR ONLY A FEW MONTHS AND I ALREADY HAVE ENOUGH OF THIS CRAP
  • 0
    @LotsOfCaffeine Ohh that's your problem. The whole "visual c++" ecosystem is a mess.
  • 2
    @SortOfTested Wow. I had no idea. I was taught that it was a cross platform endl a long, long time ago and that it should be used over \n. I've never read anything to the contrary until today.

    Feels like I just found out I was adopted. And I know that feeling, all too well.
  • 2
    @junon One draw back of not using endl is in debugging. It can buffer up and not reflect when the code actually ran. This has been a mess for a codebase that uses cout for debug stuff in some areas and qDebug in other areas. The cout stuff that doesn't have endl appears to occur at locations different than it should. So it really depends on what you are doing.
  • 0
    @junon
    Whenever I see something that behaves oddly, my first stop is the source. Second stop is IDA.
  • 1
    @Demolishun holy crap, what a mess, ouch. I've had to deal with code like that and it was an absolute pain. That's what cerr and stderr are for ffs.
  • 1
    @RememberMe 20 years and as many compilers in between. Yay...
  • 0
    @junon that's not visual c++, I'm on Linux using GCC
    It's just that the extension for vscode (≠ visual studio) does some weird stuff
  • 1
    @LotsOfCaffeine you might be better off using CLion? The VSCode c/c++ extension is pretty fragile in my experience.
  • 0
    @RememberMe yeah clion would be an option, but last time I checked it had even worse input lag over remote (everything is developed on remote virtual machines)

    I'm considering going full terminal just to have the smallest input latency, or some other remote solution
  • 0
    @LotsOfCaffeine I've had decent results with vim + coc + a c++ language server, might go that way.
  • 0
    @RememberMe yeah I looked at manually setting up a language server and going with a terminal editor

    It's just a good bit of effort to set it up and I haven't found the time for it

    I wanted to get into some of that stuff in my free time (mainly for pure C, not C++) but my laptop hasn't arrived yet :/
  • 0
    @SortOfTested I've never noticed it behaving weirdly, though I tend to treat console output as being expensive anyway. Usually I just fire up godbolt nowadays, though I might have dropped into gdb before.

    @LotsOfCaffeine Yeah, I just meant any of that stuff. The programs made for programming by Microsoft are terrible, pretty much across the board. Have been this way for decades, they're just now socially acceptable because VSCode uses web technologies which means it's (somehow) superior.

    I've only ever had issues getting things to work in Visual Studio et al.
  • 1
    @junon
    To me, slow = strange 😋
  • 0
    @SortOfTested you misunderstand me, clearly.
Add Comment