Ranter
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
Comments
-
@CatFoodParty I just want readable compiler errors, I have been staring at this screen for hours and nothing works for seemingly no reason
-
@LotsOfCaffeine if you're on GCC, try substituting it with clang. Much more readable errors.
-
iiii90854y@CatFoodParty your prof made a good joke on you 🤣 if C++ is convoluted mess, Perl is just singularity of convolutionness
-
@RememberMe I would have said the complete opposite, but both of them are sometimes unreadable.
-
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. -
galena71484y@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. -
@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 :)) -
@junon uhhh i think thats a diffrent version of cpp im not using that last part :/ thats not what code cademy teached o_O
-
@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`. -
@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
-
@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.
-
@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. -
@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 -
codecrow2174ybeen 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.
-
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 -
@LotsOfCaffeine Ohh that's your problem. The whole "visual c++" ecosystem is a mess.
-
@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. -
@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.
-
@junon
Whenever I see something that behaves oddly, my first stop is the source. Second stop is IDA. -
@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.
-
@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 -
@LotsOfCaffeine you might be better off using CLion? The VSCode c/c++ extension is pretty fragile in my experience.
-
@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 -
@LotsOfCaffeine I've had decent results with vim + coc + a c++ language server, might go that way.
-
@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 :/ -
@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.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
Fuck C++ I am so done with this garbage
No I do not accept differing opinions
rant
c++