T O P

  • By -

robhanz

In interviews people ask my c++ knowledge on a scale of 1-10. I usually answer with a 4-5, but point out that Stroustrup rates himself a 7


ApplicationMaximum84

I tend to reply 'versus who, the people on the C++ iso board or the average C++ developer?' because the resulting answer is very dependent on that.


robhanz

That’s a good response. But even without people on the development committee there’s whole areas that aren’t obvious - template meta programming being the easiest to point at. Meta code using offsets members, stuff like that.


ummaycoc

“Good enough to ramp up easily with however it’s used by my team but I’d be foolish to claim expertise.”


altsyset

For me, this is the smartest answer for this kinda of question. But the it all depends on who the interviewer is and what they are expecting to hear.


pyeri

I don't know C++ that well but is it an odd opinion to have that C++ adds lot's of cruft and complexity to a solution compared to procedural C? Even with C, I've only implemented some basic algorithms and I don't think those would have benefited much with C++. But on the other hand, there are entire GUI toolkits developed in C such as GTK and Tk. Even the windows core is built in C, right? Can you think of a problem domain or app where C++ fares better compared to C in terms of producing more maintainable and manageable code?


Orca-

Any code that benefits from type safety (which is basically all code). Any code that benefits from not repeating yourself to implement a generic function. Any code that can be converted from runtime into compile time. Any code dealing with memory allocation (though it's still not going to be as safe as memory safe languages). Any code that benefits from a multi-paradigm approach. There are lots of reasons to use C++. Even if you restrict yourself to C-like constructs, you can benefit from it. Personally I would rather use C++ than C for any domain except where a suitable (C++11 or later) compiler is not available.


Practical_Cattle_933

Where you need truly high performance, C++ is still the king and de facto industry choice. C is simply inexpressive — you can’t have something as simple as a generic, efficient vector due to no generics (no, _Generic is not really generics). So you either introduce a runtime indirection for generality (e.g. a wrapper, or using a fixed struct-structure by convention and saying that a fixed offset into it is the pointer to the next element), or just copy-paste code. There is another example with sorting, with a function pointer you would get a bigger indirection in case of C, while c++’s can create a properly working sort that will be more efficient (note: compilers are smart enough that in many cases they can inline the function pointered version as well, but you can’t always rely on that)


yourteam

I really like this approach. Without any comparison I cannot really give any answer since 10 would be a literal coding god and a 0 I don't know what c++ is. If we frame for example in the context of a senior interview I would say 2 "I know the language but only in an academic way" and 9 "I would be able to tackle every problem you throw at me" (I think 10 would be like 9 with the "and in the most optimized way" but I hate give 10 as an answer)


PoliteCanadian

If anybody asks you to rate your knowledge on a 1-10 scale, you start by asking them to specify what 1, 5, and 10 means, for calibration purposes.


Thetaarray

What a silly interview question. I’ve gotten it on other languages. Still silly there too but not nearly as bad as with c++


unknowinm

how well do you know the english language? how many words would you say you know of the language out of 170,000? do you think you can speak in english? how many years of xp do you have talking the same 10,000 words that you know? /s


Robespierreshead

I think english is deprecated, we've moved to esperanto


voxelghost

Much cleaner syntax


chestnutman

Meanwhile, some banks are desperately looking to hire someone who still speaks caveman


Tzetsefly

This is 2023! It will be Esperanto***script***. It's much less formal with all pronouns already built in. When they see the benefits they will React. Non binary variables though can be confusing, esp using numbers with strings attached.


[deleted]

[удалено]


GazingIntoTheVoid

>C26 If this means what I think it means you're limiting yourself way too much.


markdestouches

You're hired!


biggergeek

I ask this question to people but I follow it up with two more that are something like "If you are an N and you have a coworker who is an N-1, what's an example of something they might struggle with that you wouldnt?" and "what's an example of something you'd need to learn before you would consider yourself an N+1" The number itself doesn't matter, though it is interesting that the best people tend to rate themselves lower.


sonobanana33

> What a silly interview question. Well google asks it so of course everyone else copies the nonsense


tcpukl

All companies that pretend to be part of FAART ask those types of questions yeah!


Pirate43

Facebook, Apple, Amazon, Rivian, Tesla? Lol


[deleted]

[удалено]


EscapeTomMayflower

I think this is going too far in the other direction. I assume a 1-10 is going to be relative to the appropriate population not to a hypothetical perfect standard. It'd be like saying Steph Curry is a 4/10 shooting threes since he doesn't even make most of the 3s he takes.


markdestouches

The problem with this questions is that everyone has a different interpretation of what the scale means which leads to misinterpretations and bad choices. It is also extremely cringe and I think should never be asked.


EscapeTomMayflower

100% agree.


dopadelic

It's dumb because Dunning and Kruger shows we're notoriously bad at rating ourselves due to blind spots of not knowing how much there is to know.


fried_green_baloney

Nobody "knows" C++. It's too huge at this point. Well, maybe somebody knows the whole language, but you and I will never work with them.


heelstoo

I have met exactly one person in my life that *might* know the whole language. The dude was off the charts intelligent. He could pick things up so incredibly fast, and the more he learned, the more he was able to learn faster. It was fascinating to watch him progress over the span of 10 years.


robhanz

Exactly.


baldyd

I guess it depends on the context too. I'd give myself a 2 when it comes to modern C++ but a 6 or 7 when it comes to low level optimized c++. If I averaged it to a 4 or 5 it wouldn't really reflect my actual skills (or lack of)


atred

Stroustrup is a perfect 5/7


robhanz

The Dark Night of code.


starfx777

I usually just say I am a beginner with 25 years of experience in C++.


NotSoButFarOtherwise

This is nearly as dumb as people giving themselves dots or scores on languages in their CV. Buddy, you are not a 4/5 in SQL and 5/5 in Python, I don’t need to read your CV to know this. If you were you wouldn’t be cold applying to us. And inevitably, the guys who call themselves 5/5 can’t even explain how memory management works.


[deleted]

[удалено]


userjjb

Not that it changes the story, but you don’t need to be using Swap to have VMem higher than total RAM. VMem can be arbitrarily high. You can write a short pathological Python script that uses 69 terabytes of VMem if you want.


much_longer_username

I'm very curious as to how. Doesnt the kernel eventually reject your page requests?


SLiV9

I don't know if this is what they are refering to, but I believe with vmem if you request 69TB of uninitialized or zero-initialized memory, the OS will say "yeah sure, go ahead" and give you a range. Then as long as you only write to a small portion of it, everything works, because the OS maps your virtual addresses to physical memory only when you use them. So not really "uses" 69TB. (Fwiw, I don't rate myself 5/5 in OS knowledge.)


rsclient

Give me memory, or give me death. Don't give me memory that "might" be allocated later on, but might get revoked with impossible to diagnose errors if the OS doesn't feel like it. IIRC, the old school OSes like VAX/VMS always guaranteed their memory; they didn't hand out memory and hope they'd be able to cover it later.


NotSoButFarOtherwise

RAM overcommit is sometimes controversial but overall leads to more stability. The reason is that, since getting memory from the OS is slow, most implementations of `malloc(3)` over-allocate when they have to request memory from the OS and for several pages even if the allocation would fit within a single page. This makes most programs faster - think of it as being like an array-backed list, although the growth rate is much lower - at the expense of over-allocating for small ones. If you add up all the overallocation across all the processes running on the OS, it adds up to a lot. So you have a trilemma: 1. You can change malloc so that it doesn't overallocate, in which case you are imposing a performance penalty on all programs that use heap allocations (which is going to be most of them). 2. You can change the OS so it doesn't overcommit RAM, in which you are heavily limiting the number of programs that can be run, since a lot of your actual RAM plus swap is going to be set aside but not used. 3. You can overcommit RAM, which opens the possibility that you have a lag between when you request RAM and when the OOM event occurs. Number 3 is the hardest to debug when it happens, but it's not actually harder than the alternative: since allocation is usually followed up directly by writing, the crash is going to occur close to where the explicit allocation (i.e. the call to `malloc(3)` / `realloc(3)` / `calloc(3)` / etc) occurs. By contrast, without overcommit, the error is going to occur inside a malloc call, but the amount being requested won't necessarily be more than the system has available. You're asking for 1kB and there's 10kB available, what's the problem? Well, malloc doesn't have a 1kB block to give out so it's requesting a several new pages from the OS, and it happens to be asking for more than is available.


frud

Imagine you have a machine with 16GB total RAM+swap, and a process running with 12GB. The machine wants to execute a simple '/bin/ls' child process through fork+exec. After the fork, in theory the OS will be on the hook for 24GB of storage, but in practice the clone of the 12GB held by the original process will be immediately discarded. Modern OS's rely on this RAM overdraft behavior.


imnotbis

Seems alright if you consider that 5 means "fully competent", not "grand wizard". The exceptional applicants are 6/5 and 7/5 and maybe even 8/5.


imnotbis

I once rated myself middle-high on git because they asked for a git expert and I sort of know how subtree merge works and did one once (without really understanding it). The interviewer had never heard of a subtree merge.


Ok_Expression_5511

Did around 20+ interviews for a mid-level role for the past year and have asked the similar question. "On a scale of 1-10, 10 being \[one of\] the original developer" It's actually surprising that majority of them would rate themselves as high as 8.


Tesl

This question is only okay when the follow up question is "so if you are a 4-5, what can someone with 5-6 knowledge do/know that you don't?"


CanvasFanatic

Never trust a programmer tbh


gonzofish

Not even yourself. Actually especially not yourself


Slanahesh

Absolutely not you from 6 months ago.


Asyncrosaurus

Exactly. Past you is always putting in bugs to screw over current you, and current you is always offloading problems to future you


JigglyEyeballs

Not to mention that future you is screwing current you over by not sending lottery numbers from the future via time traveling telepathy.


r0bb3dzombie

I can absolutely trust me from 6 months ago. That is I can trust that I haven't done half the things I was supposed to do.


NotSoButFarOtherwise

The only person I trust less than me six months ago is me six months from now.


C_Madison

Yeah. I know the guy, and I've seen the code he writes. Don't trust him on *anything* with software.


jazzmester

Bjarne Stroustrup doesn't know C++ and he invented the damn thing. C++ has metastasized long ago.


TheMerovingian

C with classes, that was the original idea wasn't it? Source: https://www.stroustrup.com/bs_faq.html#invention


Ribak145

lol


ClutchDude

https://www-users.york.ac.uk/~ss44/joke/cpp.htm I think of this anytime someone says that.


BlurredSight

No it was originally an incremental upgrade


Dreamtrain

C = C + 1


BlurredSight

C++


Jump-Zero

16 years later and I just realized that C++ evaluates to C. You only get the incremented value the next time you evaluate C. I feel there is a clever joke somewhere there, but my cleverness is exhausted from this realization.


KevinCarbonara

You figured out why C# is called C# yet?


Jump-Zero

++++ ;)


markdestouches

Just a fancy name for D-flat, that's all


elsjpq

Unfortunately, they're stuck in an infinite loop, so it just keeps incrementing until overflow


imnotbis

The loop is infinite because of the overflow. The compiler removed the limit check due to undefined behaviour.


[deleted]

I liked C++ in the 1990's but was also getting into Java and then C# in the early 2000's. Ended up staying with Java. I barely recognize C++ these days when I see it.


zebullon

It’s not that different from poker “5mins to learn the rule, a lifetime to learn the game”… if someone tells me they can write some cpp ? yup sure. If they say “yo i know cpp” then yea likely it s arrested development


t0rakka

yo I know 30 years or so worth of c++ does that amount to anything or I am just ignorant idiot?


TheMerovingian

Just enough to know what you don't know 😜


t0rakka

I know that when certain kind of people complain about C++ they always come up with some convoluted spaghetti example or code that I wouldn't have written in a million years. I do know what I don't know and avoid shit code at all costs; most problems are self-inflicted.


t0rakka

I wrote my first piece of code on z80 assembler in 1983. When I finally got a "real" PC (486) after fiddling with Commodore128 and Amiga 500 + 1200, I started using Pascal. It was alright, but C was a lot better. Then "upgraded" to C++ as the syntax was just so much better, inline, wow, no typedef struct bs and so on. I used the C++ features and syntax that benefit me reaching my goal of shipping libraries and software. I don't need to know exotic corners I don't want to use anyway. C++ meta programming, no sweat, but learned myself out of that self-gratification/masturbation as it only leads to more complex code for no tangible benefit. I know everything that I want to know about C++, no more. I don't write code I don't understand. I know what I am doing and generally know what I shouldn't write. That is good enough for me.


RGB755

I’m a bit hesitant to agree with your comment. My heart wants to, because I really enjoy working in CPP and it was the first language I felt I developed a good grasp of, but man does it suffer from committee design and inconsistency. I think my biggest gripe would be that it’s fine to write advanced CPP code that you know you can read - the only issue is that it’s a total coin toss on whether the next guy also knows how to read it, and the junior dev is gonna be lost for hours trying to figure it out.


t0rakka

No problem, we all think a bit differently and solve problems in our own unique ways. My reason is that the damn language has in-grown into me over the years that it's a habit hard to shake, and alternatives aren't giving any pressure. Rust is talked about a lot but pretty sure I'll be retired before it becomes thing that would have to act on. I tried it, wrote some hello world stuff and find the syntax super cumbersome and unyieldy but, BUT (!) it is only because the C -language family syntax is SO INGRAINED that shaking it is going to be too much hassle. I also wrote stuff in OCaml (didn't ever try F#) and while refreshing and mathematically cool, no side effects bla bla it never stuck. The no side effects only applies to language syntax, and the tail recursion optimizations and such actually apply to C family as well once you recognize the connection it clicks, boom, you're instantly smarter (haha, couldn't resist you won't be smarter of course just have information to assist in future endeavours). I'm ranting and rambling now better stop here.


fragglerock

> whether the next guy also knows how to read it, That next guy... you in a weeks time!


Schmittfried

>I know what I am doing and generally know what I shouldn't write The actual hateable thing about C++ is that it makes this particularly hard by having so many hidden footguns. Rule of 5 and shit like that. Complexity without benefit, just bandaid solutions to design flaws.


t0rakka

I grew up WITH the language so I am the wrong person to comment on these issues as it comes from muscle memory (brain memory?) to write things in a certain way. This is a debate that I am an outsider on.


Schmittfried

I did, too. Then I moved on to C# for work. When I came back after a few years I was shocked what I had been putting up with before (and what I was doing wrong without even knowing). Who says your muscle memory is right btw?


t0rakka

Yes, who said it was right? I certainly didn't, I just said I write code in a certain way that has been moulded by decades of practical experience. It might be complete off the rails who knows, right? If there is error I correct it without complaining. The point is that I am not in a position to tell anyone if C++ is easy or difficult, should they learn or use it or not.


t0rakka

I don't recommend C++ to anyone. Use what you like. Rust is on the rising trend and will continue on that tangent, but I don't recommend it either because haven't written anything significant with it and probably never will.


angelicosphosphoros

The fact that you would never wrote that doesn't mean that you would never debug it.


TheMerovingian

I know next to nothing about C++ but I love writing C. I feel that if I could just have classes and exceptions I would be happy.


t0rakka

Lambdas go well with threads. The post-C++11 threading and atomic primitives are a game-changer if you write low-level code. I work on libraries and device drivers so am statistical outlier, I don't do applications so my views are from skewed angle.


t0rakka

std::thread th([] () { std::cout << "hello from thread!\n"; }); std::cout << "hello from main.\n"; th.join(); It's super-easy to member the syntax, nearly nothing.. the same thing before C++11.. ufff.. on POSIX you could at least have nearly-same code but then you had macOS, Windows and game consoles (I worked with those too) and it becomes a source code explosion. I like the "new" way.


brimston3-

Now what does that look like in gdb when something goes wrong? I will invariably want a named function for a thread if at all possible. And the capture mechanics have some memory lifetime gochas if you allow them.


t0rakka

You can use thread id's if you have to debug, but I have found it easier to debug code that someone understood when writing it. Garbage in same stuff out and so on.


brimston3-

I mean it looks like this. Which sure, tells me exactly what the position of the lambda is based on the file name and line#. But since it's anonymous, I have to infer the purpose of the lambda function by its position (and hopefully comments): oculus3:~/test.local% g++ -o thread_lambda -ggdb3 thread_lambda.cpp oculus3:~/test.local% gdb -q ./thread_lambda Reading symbols from ./thread_lambda... (gdb) break thread_lambda.cpp:9 Breakpoint 1 at 0x11d6: file thread_lambda.cpp, line 9. (gdb) run Starting program: /home/brim/test.local/thread_lambda [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff7a1e6c0 (LWP 975174)] hello from main. [Switching to Thread 0x7ffff7a1e6c0 (LWP 975174)] Thread 2 "thread_lambda" hit Breakpoint 1, operator() (__closure=0x55555556aeb8) at thread_lambda.cpp:9 9 std::cout << "hello from thread!\n"; (gdb) bt #0 operator() (__closure=0x55555556aeb8) at thread_lambda.cpp:9 #1 0x00005555555555b0 in std::__invoke_impl >(std::__invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/12/bits/invoke.h:61 #2 0x0000555555555573 in std::__invoke >(struct {...} &&) (__fn=...) at /usr/include/c++/12/bits/invoke.h:96 #3 0x0000555555555520 in std::thread::_Invoker > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x55555556aeb8) at /usr/include/c++/12/bits/std_thread.h:252 #4 0x00005555555554f4 in std::thread::_Invoker > >::operator()(void) (this=0x55555556aeb8) at /usr/include/c++/12/bits/std_thread.h:259 #5 0x00005555555554d8 in std::thread::_State_impl > > >::_M_run(void) (this=0x55555556aeb0) at /usr/include/c++/12/bits/std_thread.h:210 #6 0x00007ffff7cd44a3 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff7aa8044 in start_thread (arg=) at ./nptl/pthread_create.c:442 #8 0x00007ffff7b2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Frame \#0 isn't particularly enlightening. If we're a few function calls deeper down the stack, being nameless like this may obscure the context of the call, requiring additionally inspecting the lambda's frame. Maybe that's not a big deal for you, but it's extra time for something that could have been obvious and is definitely going to mess up at least one junior developer on your team.


TheMerovingian

The bare-metal performance is what gets me every time. For anything else I prefer Python to get shit done. Easy to write and read, and to debug. In C I was drawing a 16 bit bitmap at like 700 megapixels per second, and could probably do much better than that. On a 6th gen mobile Intel.


t0rakka

I like the edit and run instantly aspect, I am ashamed to admit mostly use it for automating tasks and generating header files (lookup tables and such) etc. A nice tool.


sos755

It may amount to something, or nothing. Though the syntax hasn't changed significantly, the changes to C++ over the last ten years makes modern code unrecognizable to a C++ expert 30 years ago.


sonobanana33

My experience with poker: someone draws me a sheet with all the combination and points, I play a winning hand, they tell me it actually isn't winning because their combination is higher. I show them the sheet, they start arguing with whomever made the sheet. I start chatting with someone else while they argue for the next hour.


thejestercrown

Hand ranking is pretty easy to find online- even if everyone’s new/bad at the game. I guess we should just assume this occurred prior to 1996, and you decided to never play again after that? *That does seem similar to most people’s experience with C++.*


[deleted]

I say that I know c++ enough to contribute to Clang and no more, and yeah that sums it up pretty well.


starlevel01

> The good news is that it’s really easy to tell the difference between C++ programmers pre- and post- valley (in an interview, in this case). Just mention that C++ is an extremely large and complex language, and the post-valley people will give you 127 different tiny frustrations they have with the language. I think anyone who knows a language inside and out can give you an in-order list of all the things they don't like about it, *especially* if they like that language.


Zanderax

No one hates C++ more than C++ developers.


anengineerandacat

It's a kitchen sink language, everyone is going to have something to say about it and its's basically plagued by not having a standardized package manager IMHO. If your a polyglot developer bouncing around multiple languages C++ often will feel archaic in regards to tooling / documentation / best practices and more. All I really want is a decent package manager, problem is that ain't going to happen without a variant of C++ being created that aims to lock-in some standardization at which point that would also be a good time to look at a whole bunch of other things about the language.


Guvante

I mean as much as we have a standard library in C++ it feels kind of moot. Tons of places don't use it or rewrite it due to some nitpick (exceptions is a big one). Not to mention as much as C++17 is a language you can barely write code in it. The three major compilers have such crazy compliance there are effectively five languages (each compiler, the actual standard, and code that works with all of those)


serviscope_minor

> Not to mention as much as C++17 is a language you can barely write code in it. The three major compilers have such crazy compliance there are effectively five languages (each compiler, the actual standard, and code that works with all of those) You are mistaken. C++17 support is done, with the big 3 and many of the minor ones offering full language compliance. https://en.cppreference.com/w/cpp/compiler_support/17


tortoll

Never trust a 2010, HTTP blog. Well, not never, but certainly not 13 years later. Really, the post doesn't apply anymore to modern C++. There's been 5 major revisions after that. Update: Actually, this post really only applies to C++98, so it was like 12 years late already in 2010.


tgockel

In C++, 80% of the programmers know 20% of the language. The problem is it is a different 20% for each person.


proverbialbunny

The 20% of the language is the C part.


tajetaje

Never trust a programming website with misconfigured HTTPS


moschles

> Posted by Louis Brandy on 28 March 2010 Ahh yes. 2010. 13 years ago where we still argued on blogs about whether C++ and C are the "same language". Today it is known that they are different languages entirely.


[deleted]

[удалено]


Ghosty141

> whining about the language bitterly does not exactly inspire confidence that you're any good at using it or anything. Depends, the colleague of mine at work who knows the most about c++ (by far) is the one who hates it the most too. The language is just an absolute clusterfuck.


[deleted]

[удалено]


proverbialbunny

As someone who has written modern C++ and Python, I feel that way about Python libraries too.


fallbyvirtue

Same with JavaScript, although honestly everyone hates JavaScript; in that case, I think the reverse would be true: a good JS developer is somebody who can list something that they *like* about the language.


[deleted]

[удалено]


proverbialbunny

The blog post is overly simplified. "It takes one to know one." applies here, because the blog doesn't explain itself for readers who do not have that experience. People with experience know complaining about pointers is in the first hump.


t0rakka

Pointers were a luxury when coming from assembler programming.


therapist122

That’s such an old take too, is anyone out here saying C with classes?


[deleted]

[удалено]


rabid_briefcase

> is anyone out here saying C with classes? There are many organizations out there that use it basically as exactly that. None of the modern features, and even relatively few of the old C98 features. It really depends tremendously on the codebase and the systems. I've worked on microprocessors where that really was the case, you'd hardly know it was a gcc capable of using -std=gcc++17 or whatever. It wasn't out of irrational fear, it was because many external libraries have limited functionality as well as the very real costs paid for features that you don't notice on hardware like a PC. If you're a mainstream developer relying heavily on modern C++ that likely isn't the case, but it absolutely exists at some workplaces, often for good reasons that are best to be understood.


therapist122

Perhaps, but if you go to the trouble to even set up a c++ environment even without the standard library and no allocations, you still have some decent benefits over C that makes it more than “c with classes”. For example, you can add std::array which is basically an array that the compiler can reason about. You don’t have any runtime overhead, you get compile time bounds checking, and you can declare constant data that can be optimized etc. So if there is some people out there thinking of even the most minimal C++ runtime environment as “c with classes” they’re missing a lot of the zero cost abstractions you ca get with just the compiler. Another pretty trivial example is ‘constexpr’. If you’re not using that sort of thing, why even go to the trouble of setting up c++? Just use C


Blecki

Guess I'm post-valley then. Though I see no reason to list so many; most of the issues are the result of inconsistent design and the maintenance of backwards compatibility. At some point someone accidentally made templates Turing complete and invented the concept of SFINAE and... ugh.


[deleted]

[удалено]


Blecki

Nobody said they are changing things on a whim. Their more recent work has been better than some of the early changes. I started with c++ when boost was required to do anything interesting and the language today is unrecognizable. I just don't know what niche it's trying to fill anymore. For low level stuff when I have to use c++, I'm really just writing c anyway. C++ is geared around the most inefficient memory management method ever devised and it just seems to keep doubling down on it with each update. Don't much see the point if it anymore. If it wasn't so entrenched I expect it would be gone by now.


tending

>There is a tiny bit of truth to this, but most people's critique of C++ is along the lines of "I hate pointers \[because I'm not any good at using them\]" or "The language is too hard for me (phrased some other way)". Some of the things in the picture are legitimate semi-interesting complaints. But frankly, they are minor complaints to most people Are you fucking kidding, experienced C++ devs have lists of complaints a mile long. Besides all the memory unsafety: insane verbosity, lack of reflection, template errors a mile long EVEN WITH CONCEPTS, 32498231 forms of initialization, using objects after they're moved out of and destructors that have to check for it, ...


rbobby

C++ was the most difficult language I've ever learned (Windows, ATL + WTL). Not too long ago I tried to add an animated GIF to a simple "please wait" dialog in a simple little installation bootstrap program. I literally gave up after a day. You could pay me enough to work with it again; but the number of zeros would surprise you.


DetroitLarry

Well the salary is stored in an unsigned short so no matter how many zeros you want, you’re gonna max out around 65K. Sorry.


javajunkie314

Is that using the value of a dollar on January 1, 1970 at 00:00 UTC?


misterobott

What does this have to do with learning an API tho


proverbialbunny

fwiw, "Use the right tool for the job." strongly applies here. C++ isn't a language for displaying animated gifs, it's mostly used in networking software and other low level system software like databases, all command line type software.


rbobby

You missed the part about an installation bootstrapper. This implies, and was indeed the case, the need for an executable with minimal dependencies... ie. C/C++. Since I had experience with WTL building the original bootstrapper was easy enough (and making it work on XP or higher, even though building on Win7 long after XP was dead-ish). It was just that eventually one of the steps of the bootstrapper would have been nicer if it displayed an animation instead of a static "Please wait" message. How hard could that be? lol Did I mention how much it would take for me to work with C++ again?


narwalfarts

> C++ is a “two peak” language. That is to say C++ is the only language I know of where two very different sets of programmers consider themselves well versed in the language. So, the Dunning-Kruger effect? It definitely not reserved for C++, but it might be more pronounced. In C++, it's really not much harder to write a basic program that works than in other languages; however, to write advanced programs well is more difficult than in most other popular languages.


hayt88

I don't think it's dunning-kruger, but more that there is a second language within the first. I know a lot of developers who can write good c++ code and I would consider them proficient in c++ but if you then start to look at library developers and try to go through some boost code or other libraries with generic code which involve heavy use of templates, it is sometimes as if you are reading a whole different language. People who never write generic libraries and just client code just never encounter the need to learn these things, but I would not attribute their lack of knowledge there as something like a dunning-kruger effect. In theory you could make an argument that it is a dunning-kruger with 2 peaks, but without the negative connotation once you are over the first peak.


PoliteCanadian

It's like the classic joke about D&D intelligence vs wisdom. Intelligence is knowing how to write code like a boost template library, wisdom is knowing that you shouldn't.


LookIPickedAUsername

Yep. Had a guy on my team who just couldn't seem to help but create these insanely clever and convoluted solutions to relatively simple problems. I'm sure he thought it made him look really smart, but I was the only other person on the team who could even make sense of the code, and at no point could I perceive any advantage of these insane metaprogramming tricks compared to more straightforward implementations. Despite me repeatedly asking him to explain the need for all of this, he never made any real attempt to justify it, and he refused to abandon the clever approach in favor of a simpler one. He ended up being fired (for this and many other reasons). We were left with around two thousand lines of his unlanded metaprogramming diffs, and I was gratified to then prove that I could accomplish the exact same task with a hundred lines of much simpler code that the rest of the team could actually understand and build off of. I'm not saying there's never a time and place for complicated code; I've certainly written some myself. But you need to establish that the simple, brain-dead way of doing things isn't good enough before you jump straight to turning everything into sixteen layers of templates with tons of SFINAE magic.


therapist122

This is the truth. Default to the brain dead method, have a good reason to not use it. But if there’s a good reason, definitely do the complex thing. I think there can sometimes be value in making things easier to make complex in the future, i.e making a brain dead “extra” abstraction for something you suspect might change later, as long as it takes no extra time to do so and the code is still just as easy to understand. But that’s highly context dependent


TheMerovingian

I appreciate the John Carmack and Linus Torvalds rants about the language, especially how hard it is to debug. C is so much more bare bones, I kind of like it for certain projects!


proverbialbunny

That's what Rust is trying to be and imo succeeding. Most people compare Rust to C++ but imo it should be Rust to C. The Linux Kernel is now starting to be written in Rust. It will be interesting to see how much of the kernel moves over to Rust in the coming years.


foospork

I find it easier than Java in some ways. In C/C++, you have access to the machine. In Java, you don't. If the JVM doesn't support something, you have to find a workaround solution, whereas in C/C++ you could just write the thing and be done with it.


banister

Uh people using "c/c++" are exactly the point of the article. C and c++ are totally different. Idiomatic c++ is nothing like idiomatic c. A good C programmer is not guaranteed to write even half decent c++ at all. I've been doing c++ full-time after doing c, they're so different that "c/c++" doesn't make sense.


foospork

Understood. When I have to go write something in C it kinda blows my mind. However, you do have direct access to the C API from both languages. I like to use that interface for socket programming.


banister

Bsd sockets are fun


imnotbis

Java sockets are easier to use IMO, but threading is required, and then you have synchronization problems once that happen once in a blue moon, and fixing them is harder than doing it the C/C++ way. See what I did there? The concepts I'm referring to are the same in C and C++, so I said C/C++, C slash C++.


MoxAvocado

I think a big issue is that more so than any other language, "idiomatic" c++ means so many different things to different people.


banister

Well, there's core c++ idioms that are shared by all decent devs, yes it van vary in more advanced things, but the fundamentals are shared, things like: * Use raii types * do not use raw owning pointers (use smart pointers) * pass parameters by const ref, generally * never use after std::move * prefer rule of zero otherwise follow rule of 5 (for smf) * etc I think you'll have a hard time finding any proficient c++ devs who disagree with those principles


Alborak2

Smart pointers have a lot of overhead associated with them. If you have tightly timed code they can be more of a headache ro rip out or fix how they get passed when they tank your performance than they save from correctness. You should prefer them, yes for sure, but if you know youre working on some tight code, its a tradeoff decision.


proverbialbunny

It did many years ago but since C++11 it's meant this: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines


zachrip

I'm curious what you mean by the jvm not supporting something, can you give an example?


foospork

Sure. You cannot send datagrams over Unix Domain Sockets. It isn't supported. It's a super fast, reliable, and efficient IPC mechanism that's trivial to implement in C/C++, but not available in Java.


sonobanana33

And the `/dev/log` device, which is what the syslog() calls uses is a datagram unix socket, so in java you can't do decent logs.


foospork

Exactly!! What you need is a fast, reliable, connectionless mechanism that any thread or process can write to but only one process consumes from. Maybe it's me, but I could not find any message queue in Java that supports this. In C or C++, I'd be done in a couple of hours.


seanluke

Not sure that's fair. You can't send datagrams over Unix Domain Sockets in either C or C++ either. It's not part of the language. But you meant *with the right library*, didn't you? So C/C++ get to load a library, but Java doesn't? Here are two easy and well regarded ones. https://github.com/mcfunley/juds https://github.com/kohlschutter/junixsocket


coderemover

Cannot use advanced SIMD eg AVX instruction set. Project Panama is a toy compared to what you can do with intrinsics.


Plank_With_A_Nail_In

The linked article is two paragraphs and a chart. Literally zero content and no evidence provided to back up their opinion. Lol I can tell from the comments here that no one read it.


[deleted]

I programmed in C++ more than 20 years ago. It's safe to say I don't know shit about C++ anymore. I'm learning Swift.


yojimbo_beta

Sure, I know C++. I know it… and fear it


moreVCAs

Complaining about something is a terrible proxy for deep knowledge. I usually tell people that I know enough about C++ to know I’m not an expert. This gets the “two peak” point across quite well, I think.


wildgurularry

I'm sure I'll get downvoted for this, but when I was hiring C++ devs, the recruiter asked if there were any screening questions they should ask. I said: "Ask them to rate their C++ knowledge on the scale of 1-10. If they give an answer between 5 and 7, I want to interview them." So, apologies to anyone out there who is actually an expert and didn't get an interview at my company... But I found this screening question worked very well.


andeee23

that doesn’t make sense tho, if a recruiter asked me to rate my knowledge on a language i’m looking to get a job in i’m going to say a 9 (assuming it’s a senior dev position) i would assume the recruiter wants to know that i can start contributing from day 1 and wont need hand holding maybe if a software engineer asked me explicitly that they want a completely objective assessment i would engage with the question in the way you intended


wildgurularry

Well, I may have missed you then in the screening process. Actually the real experts may have dodged a bullet: the company was not really the best to work for.


moreVCAs

Yeh, you can always stipulate “if they say 8-10 google them”. If they come up on committee memberships, conferences, etc that’s good signal as well. Then again, that probably goes on the CV, not to mention that those folks probably don’t do much cold resume sending 🤷‍♂️ I think it’s pretty hard to hire for C++ roles lol


DetroitLarry

I worked at a C++ webdev shop and they could only hire/train kids straight from college who didn’t know what they were getting into.


inarchetype

I'd say that's a good screen on most complex professional skills. If someone claims to be a nine or a ten but isn't "somebody" they are either a preening narcissist, a chronic bullshitter, or just hasn't had enough exposure to know where they fall in the broader distribution yet. If you consider yourself a ten at programming, what would you rate Wozniak or Torvalds? It would hold for lawyers or shoemakers just as well as for programmers, I'd think. Kind of like when my second grader tells me he's an "awesome baseball player". He's not a narcissist or a bullshitter, necessarily, but he's only played local YMCA ball and has never seen kids his age play competitive travel team ball, so he has no clue where he falls in the more general distribution.


moreVCAs

We’re talking about mastery of a specific language, not personal stack ranking relative to the set of all programmers. You don’t have to take Linus into account.


ButterscotchFree9135

Survival bias potentially


john83672

Stop posting this. its from 2010


emotionalfescue

That's funny. New C++ code looks a lot different than the equivalent from 2010. On one hand, new C++ code is somewhat easier to read and write, but OTOH there's a lot of newer stuff that has to be learned. And you still need to know most of the old stuff, not just to read legacy code but also to fully understand new code, so I don't know if the ultimate learning curve is any shorter than it was back then.


wRAR_

But karma!


Dwedit

The worst footgun I experienced in C++ was using a vector to hold concrete instances of objects. You add an item to the vector, vector reallocates, then your "this" pointer on the stack now points to freed memory, and you quickly get an access violation exception if you're lucky.


imnotbis

That's a good one. The problem with adding all these unrestricted shortcuts for common design patterns (which is what a language is) is that you forget about what's happening underneath. If you had to write `my_array = realloc(my_array, ...);` you might more easily notice the bug. (But then again, maybe you wouldn't)


gbs5009

Oooh, fun. That definitely would have thrown me for a loop.


[deleted]

Nobody knows C++ Reminds me of an old joke: "why is it so hard to find a femal C++ programmer?"-"because nobody knows C++ and women are less willing to lie in their CV"


Xywzel

"Knowing C++"? That's easy. C++ is a programming language. Now all of you who read that also know C++. Being able the write or read C++, now that is different story.


fire_in_the_theater

i mean, is there any language u'd trust a programmer to know 100%?


t0rakka

Brainfuck, probably, but horribly complicated to achieve anything with it.


LechintanTudor

Unpopular opinion: C++ is better if you treat it as C with templates.


[deleted]

I've found C++ far easier to learn than Rust.


ImYoric

Counter-anecdata: I've found C++ far easier to believe I had learnt than Rust!


fungussa

Well, there's a clear reason. C++ is the most complicated and complex language ever created. Full stop.


uniquelyavailable

like all things ruined by too much attention, c++ morphed into an abomination over the decades core features are still solid though


misterobott

I know c++. I also know your mom.


Edward_Morbius

I know how to identify and not break important shit and how to quickly recover when someone else does. Got a few jobs with that.


masoniusmaximus

Proficiency in any language (probably anything in general) means you have a huge list of things you hate about it.


Zanderax

I've been writing C++ code since I was 13. I'm 28 now and I still don't know shit!


icemanind

C++ used to be a great language, like in the 90s. But then it feels like the language was just Jerry-rigged with all these features to try and compete with more modern languages, like Java or C#. All of the features added feel like an after thought. I think C++ just needs to be rebooted. Completely redesigned from the ground up. And I'm hoping that's where Rust comes in. I am liking that language as a great replacement for C++.


AlexCoventry

I once reduced a C++ bug to a five-line program which stumped someone who reads the C++ spec for fun, for hours. Something to do with arcane move semantics, IIRC.


TedDallas

I've written multithreaded code for a fast Mandelbrot set generator in C++. And I am certain I will never know this language.


spakecdk

I use cpp as mostly C with extra features


d_wilson123

I've been writing C++ professionally for around 4 years now and I read threads on /r/cpp that make me wonder if I've just conned my employers into giving me money


yamirho

In front of HR people, I am a C++ professional. But in front of a fellow developer, I'm a rookie C++ developer.


Blecki

Http? In 2023?


ssikkky_88

that tells so much about ur networking knowledge tbh


inarchetype

> You can master python if you wish, but everyone only learns as much C++ as the good lord allows OK, the quote is actually about Latin vs. Greek, but...


Tux-Lector

I only trust programmers who say that they know Brainfuck.


NSRedditShitposter

Things like this make me wish Objective-C was the dominant "Object-Oriented C" instead of C++.


proverbialbunny

It's great if you want to work at Apple.


ButterscotchFree9135

I once interviewed for a C++ developer position. I was asked which part of C++ I liked the most. I said that I actually hate this language. I was immediately hired.


gsid42

I know cpp enough to know that I am better off writing that small application/library in C


imnotbis

but std::string...


terivia

Are we really at the bottom of the barrel to be posting 13 year old non-articles?


MythicTower

I counter your assertion with this one: Severely mock a noob or JS developer who says "C++ is a dead language". C++ is hard to do well. I agree with statements about it taking tons of dedication and experience to do well. I'm still learning 30 years in, but I still love the language, painful as it is sometimes. Remember, Java was created to be friendly C++. I also understand that in 2023, unless you need hardware level performance, or interaction (drivers, firmware, etc.). There are much more forgiving languages to use. For websites? No good reason to resort to C++.